AttackForge Enterprise & AttackForge Core
Powered By GitBook
UpdateAssetInLibrary
This method can be used for the following: Update 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
PUT /api/ss/library/asset/:id HTTP/1.1
2
Host: demo.attackforge.com
3
X-SSAPI-KEY: APIKey
4
Content-Type: application/json
5
Connection: close
Copied!

Query

id (string)
Identifier for the asset.
Example:
1
PUT /api/ss/library/asset/6035baa5fa29850a2a100ea9 HTTP/1.1
Copied!
name (string) (optional)
Name of the asset.
Example:
1
{
2
"name": "..."
3
}
Copied!
type (string) (optional)
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!
is_deleted (boolean) (optional)
Whether asset is deleted or not.
Example:
1
{
2
"is_deleted": false
3
}
Copied!

Example

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

Request

Include API Token instead of stars in 'X-SSAPI-KEY: ***************************************' parameter.
1
curl -X PUT 'https://demo.attackforge.com/api/ss/library/asset/6035baa5fa29850a2a100ea9' -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
"is_deleted": false
8
}'
Copied!

Response

Response contains a status.
1
{
2
"status": "Asset Updated"
3
}
Copied!
Last modified 7mo ago