Convert Scan-specific Credentials to Managed Credentials
To convert a scan-specific credential object to a managed credential object, use the following steps.
STEP 1: Determine the ID of the scan where the credential object is stored
- Use the GET /scans endpoint to view a list of your scans.
- Search for the relevant scan. For example, you might search by its name, "Basic Scan".
- Note the idattribute for that scan.
Example (Excerpted from Response Message)
In this example, the scan ID is 58.
{
  "name":"Basic Scan",
  "id":58
}
STEP 2: Determine the ID of the credential object you want to convert
- Use the GET /editor/scan/{scan_id} endpoint to list the scan configuration details. The {scan_id} parameter in the path for this endpoint is the scan ID you determined in Step 1.
- Search for the relevant credentials category. For example, you might search by "Windows".
- Note the value in the relevant credentials.data[].types[].instances[].id attribute.
Example (Excerpted from Response Message)
In this example, the credential ID is 168.
{
  "credentials": {
    "data": [
      {
        "types": [
          {
            "inputs": [
            ],
            "max": -1,
            "name": "Windows",
            "instances": [
              {
                "ad_hoc": true,
                "summary": "Domain: www.example.com, User: [email protected], Auth method: Password",
                "inputs": [
                  {
                    "id": "auth_method",
                    "name": "Authentication method",
                    "type": "ui_radio",
                    "options": [],
                    "default": "Password",
                    "required": true
                  }
                ],
                "id": 168
              }
            ],
            "settings": {
              "authentication": {}
            }
          }
        ],
        "name": "Host",
        "default_expand": 1
      }
    ]
  }
}
STEP 3: Convert the scan-specific credential object
Use the POST /scans/{scan_id}/credentials/{credentials_id}/upgrade endpoint to convert the credential to a managed credential.
Example Request Body
{
  "name": "Standard Windows",
  "settings": {
    "auth_method":"Password",
    "username":"admin",
    "password":"********"
  },    
  "type": "Windows",
  "category": "Host",
  "ad_hoc": false,
  "permissions":[
    {
      "grantee_uuid":"d2704692-4d79-4f31-9101-6071a9b6b635",
      "name":"[email protected]",
      "permissions":64,
      "type":"user"
    }
  ]
}
Updated 8 months ago
