Introduction
While our user interface provides a user-friendly way to create and manage these definitions, there are instances where automation becomes a more desirable option. Whether you want to integrate your asset system seamlessly or dynamically generate Component Definitions as part of an Open Threat Model integration, our latest release introduces a powerful API endpoint to simplify this process.
Using the API Endpoint
You can effortlessly create and edit Component Definitions through code. Additionally, you can retrieve detailed information about a Component Definition using a GET request.
Endpoint Information
-
Endpoint URL:
https://<your_instance>.iriusrisk.com/api/v1/security-content/components/<component_ID>
-
Retrieve Component Definition Details (GET):
-
HTTP Method:
GET
-
Headers:
accept: application/json
api-token: <your_api_token>
-
HTTP Method:
-
Create or Edit Component Definition (PUT)
-
HTTP Method:
PUT
-
Headers:
accept: application/json
api-token: <your_api_token>
Content-Type: application/json
-
Request Body:
{
"name": "string",
"desc": "string",
"visible": true,
"category": {
"name": "string" },
"riskPatterns": [
{ "libraryRef": "string",
"ref": "string"
}
]
}
-
Examples using cURL
Retrieve Details (GET):
curl -X 'GET' \
'https://<your_instance>.iriusrisk.com/api/v1/security-content/components/<component_ID>' \
-H 'accept: application/json' \
-H 'api-token: <your_api_token>'
Create or Edit (PUT):
curl -X 'PUT' \
'https://<your_instance>.iriusrisk.com/api/v1/security-content/components/<component_ID>' \
-H 'accept: application/json' \
-H 'api-token: <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "ExampleComponent",
"desc": "This is an example Component Definition",
"visible": true,
"category": {
"name": "ExampleCategory"
},
"riskPatterns": [
{
"libraryRef": "ExampleLibrary",
"ref": "ExampleReference"
}
]
}'
<your_instance>
, <component_ID>
, <your_api_token>
) with your specific information.Conclusion
Automating Component Definitions via API streamlines your workflow, allowing you to integrate IriusRisk seamlessly into your existing systems and processes. Whether you are managing assets or incorporating Open Threat Models, this feature empowers you to efficiently create, edit, and retrieve detailed information about Component Definitions programmatically.
Comments
0 comments
Please sign in to leave a comment.