Add Blocked Commands API
Add Block Commands is a configuration-based API that helps you to add the blocked commands for a scripting language.
The API can be executed only by Manager user role.
Input ParametersInput Parameters
Parameters | Mandatory/Optional | Data Type | Description |
---|---|---|---|
languageId | Mandatory | Long | Provide a unique id with the combination of platform and language. |
commands | Mandatory | String | Provide the comma-separated string of commands, which the user wants to block from script creation. |
user | Optional | Object | Provide the details like name and id of user |
Authorization | Mandatory | String | Authorization token to authenticate to the Qualys Enterprise TruRisk™ Platform. Prepend the token with 'Bearer', followed by a space. For example: Bearer . |
API Request
curl -X POST 'https://<qualys_base_url>/sm/v1/block-commands' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{authToken}}' \ --data '{ "languageId": 4, "commands": "date,ls,mkdir", "user": { "id": "<USER ID>", "name": "<USER NAME>" } }'
Response
{ "errorCode": "0", "message": "Commands Blocked successfully", "body": { "id": 201 } }
To know the details of the response codes, refer to Appendix.