AttackForge Enterprise

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

PUT /api/ss/library/asset/:id HTTP/1.1
Host: demo.attackforge.com
X-SSAPI-KEY: APIKey
Content-Type: application/json
Connection: close

Query

id (string)

Identifier for the asset.

Example:

PUT /api/ss/library/asset/6035baa5fa29850a2a100ea9 HTTP/1.1

name (string) (optional)

Name of the asset.

Example:

{
"name": "..."
}

type (string) (optional)

Type of asset. Must be one of the following: Web App, API, Mobile, Cloud, Infrastructure, Network, Wifi, Hardware, Other

Example:

{
"type": "Web App"
}

external_id (string) (optional)

External id for the asset. For example id associated with the asset in Configuration Management Database.

Example:

{
"external_id": "..."
}

details (string) (optional)

Details or notes relating to the asset.

Example:

{
"details": "..."
}

groups (array of strings) (optional)

List of AttackForge Groups to associate the asset with. Must include the Group Id.

Example:

{
"groups": ["5f31f2f1ccb8be08c49803d5", "5f9f5a5505c52f09833fa4e3"]
}

is_deleted (boolean) (optional)

Whether asset is deleted or not.

Example:

{
"is_deleted": false
}

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.

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 '{
"name": "attackforge.com",
"type": "Web App",
"external_id": "ASSET001",
"details": "This is the web site for AttackForge corporation.",
"groups": ["5f31f2f1ccb8be08c49803d5", "5f9f5a5505c52f09833fa4e3"],
"is_deleted": false
}'

Response

Response contains a status.

{
"status": "Asset Updated"
}