AttackForge Enterprise & AttackForge Core
Powered By GitBook
CreateAssetInLibrary
This method can be used for the following: Create an asset in the library (must have Assets Module enabled in your tenant configuration!);

Parameters

The following URL, Headers and Parameters are required for requests to this API endpoint. Where a parameter is optional, it will be indicated. Otherwise treat all parameters as mandatory.

Headers

1
POST /api/ss/library/asset HTTP/1.1
2
Host: demo.attackforge.com
3
X-SSAPI-KEY: APIKey
4
Content-Type: application/json
5
Connection: close
Copied!

Query

name (string)
Name of the asset.
Example:
1
{
2
"name": "..."
3
}
Copied!
type (string)
Type of asset. Must be one of the following: Web App, API, Mobile, Cloud, Infrastructure, Network, Wifi, Hardware, Other
Example:
1
{
2
"type": "Web App"
3
}
Copied!
external_id (string) (optional)
External id for the asset. For example id associated with the asset in Configuration Management Database.
Example:
1
{
2
"external_id": "..."
3
}
Copied!
details (string) (optional)
Details or notes relating to the asset.
Example:
1
{
2
"details": "..."
3
}
Copied!
groups (array of strings) (optional)
List of AttackForge Groups to associate the asset with. Must include the Group Id.
Example:
1
{
2
"groups": ["5f31f2f1ccb8be08c49803d5", "5f9f5a5505c52f09833fa4e3"]
3
}
Copied!

Example

The following example is a cURL request to create an asset in the library.

Request

Include API Token instead of stars in 'X-SSAPI-KEY: ***************************************' parameter.
1
curl -X POST 'https://demo.attackforge.com/api/ss/library/asset' -H 'Host: localhost:3000' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close' -d '{
2
"name": "attackforge.com",
3
"type": "Web App",
4
"external_id": "ASSET001",
5
"details": "This is the web site for AttackForge corporation.",
6
"groups": ["5f31f2f1ccb8be08c49803d5", "5f9f5a5505c52f09833fa4e3"]
7
}'
Copied!

Response

Response contains an asset library object.
1
{
2
"asset": {
3
"id": "...",
4
"created": "...",
5
"modified": "...",
6
"name": "...",
7
"type": "...",
8
"external_id": "...",
9
"details": "...",
10
"groups": "[{"name": "...", "id": "..."}]"
11
}
12
}
Copied!
Last modified 7mo ago