> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-cloud-api/cortex-platform/attack-surface-management.md).

# Attack Surface Management

APIs for attack surface management

## Get External Service

> Get service details according to the service ID. You can send up to 20 IDs.\ <br>

```json
{"openapi":"3.0.0","info":{"title":"Cortex Cloud Platform APIs","version":"Cortex Cloud 2.2"},"tags":[{"name":"Attack surface management","description":"APIs for attack surface management"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/assets/get_external_service":{"post":{"tags":["Attack surface management"],"summary":"Get External Service","description":"Get service details according to the service ID. You can send up to 20 IDs.\n\n","operationId":"post-public_api-v1-assets-get_external_service","parameters":[{"name":"Authorization","in":"header","description":"{api_key}","required":true,"schema":{"type":"string"}},{"name":"x-xdr-auth-id","in":"header","description":"{api_key_id}","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"request_data":{"type":"object","description":"A dictionary containing the API request fields.","properties":{"service_id_list":{"type":"array","description":"Represents the service ID you want to get details for.","items":{"type":"string"}}}}},"required":["request_data"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"reply":{"type":"object","description":"JSON object containing the query result.","properties":{"details":{"type":"array","description":"Service details according to the service ID.","items":{"type":"object","properties":{"service_id":{"type":"string"},"service_name":{"type":"string"},"service_type":{"type":"string"},"ip_address":{"type":"array","items":{"type":"string"}},"domain":{"type":"array","items":{"type":"object"}},"externally_detected_providers":{"type":"array","items":{"type":"string"}},"is_active":{"type":"string"},"first_observed":{"type":"integer"},"last_observed":{"type":"integer"},"port":{"type":"integer"},"protocol":{"type":"string"},"active_classifications":{"type":"array","items":{"type":"string"}},"inactive_classifications":{"type":"array","items":{"type":"object"}},"discovery_type":{"type":"string"},"business_units":{"type":"array","items":{"type":"string"}},"externally_inferred_vulnerability_score":{"type":"object","nullable":true},"externally_inferred_cves":{"type":"array","items":{"type":"object"}},"details":{"type":"object","properties":{"serviceKey":{"type":"string"},"serviceKeyType":{"type":"string"},"businessUnits":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}}}},"providerDetails":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"firstObserved":{"type":"integer"},"lastObserved":{"type":"integer"}}}},"certificates":{"type":"array","items":{"type":"object","properties":{"certificate":{"type":"object","properties":{"issuer":{"type":"string"},"issuerAlternativeNames":{"type":"string"},"issuerCountry":{"type":"string"},"issuerEmail":{"type":"string","nullable":true},"issuerLocality":{"type":"string"},"issuerName":{"type":"string"},"issuerOrg":{"type":"string"},"formattedIssuerOrg":{"type":"string"},"issuerOrgUnit":{"type":"string"},"issuerState":{"type":"string"},"publicKey":{"type":"string"},"publicKeyAlgorithm":{"type":"string"},"publicKeyRsaExponent":{"type":"integer"},"signatureAlgorithm":{"type":"string"},"subject":{"type":"string"},"subjectAlternativeNames":{"type":"string"},"subjectCountry":{"type":"string"},"subjectEmail":{"type":"string"},"subjectLocality":{"type":"string"},"subjectName":{"type":"string"},"subjectOrg":{"type":"string"},"subjectOrgUnit":{"type":"string"},"subjectState":{"type":"string"},"serialNumber":{"type":"string"},"validNotBefore":{"type":"integer"},"validNotAfter":{"type":"integer"},"version":{"type":"string"},"publicKeyBits":{"type":"integer"},"publicKeyModulus":{"type":"string"},"publicKeySpki":{"type":"string"},"sha1Fingerprint":{"type":"string"},"sha256Fingerprint":{"type":"string"},"md5Fingerprint":{"type":"string"}}},"activityStatus":{"type":"string"},"lastObserved":{"type":"integer"},"firstObserved":{"type":"integer"}}}},"domains":{"type":"array","items":{"type":"object"}},"ips":{"type":"array","items":{"type":"object","properties":{"ip":{"type":"string"},"protocol":{"type":"string"},"provider":{"type":"string"},"geolocation":{"type":"object","properties":{"latitude":{"type":"integer"},"longitude":{"type":"integer"},"countryCode":{"type":"string"},"city":{"type":"string"},"regionCode":{"type":"string"},"timeZone":{"type":"integer","nullable":true}}},"activityStatus":{"type":"string"},"lastObserved":{"type":"integer"},"firstObserved":{"type":"integer"}}}},"classifications":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"activityStatus":{"type":"string"},"values":{"type":"array","items":{"type":"object","properties":{"jsonValue":{"type":"string"},"firstObserved":{"type":"integer"},"lastObserved":{"type":"integer"}}}},"firstObserved":{"type":"integer"},"lastObserved":{"type":"integer"}}}},"tlsVersions":{"type":"array","items":{"type":"object","properties":{"tlsVersion":{"type":"string"},"cipherSuite":{"type":"string"},"firstObserved":{"type":"integer"},"lastObserved":{"type":"integer"},"activityStatus":{"type":"string"}}}},"inferredCvesObserved":{"type":"array","items":{"type":"object"}},"enrichedObservationSource":{"type":"string"},"ip_ranges":{"type":"object"}}}}}}}}}}}}},"400":{"description":"Bad Request. Got an invalid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}},"401":{"description":"Unauthorized access. An issue occurred during authentication. This can indicate an incorrect key, id, or other invalid authentication parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}},"402":{"description":"Unauthorized access. User does not have the required license type to run this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}},"403":{"description":"Forbidden access. The provided API Key does not have the required RBAC permissions to run this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}},"500":{"description":"Internal server error. A unified status for API communication type errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}}}}}},"components":{"schemas":{"reply":{"type":"object","title":"reply","description":"The query result upon error.","properties":{"err_code":{"type":"string","description":"HTTP response code."},"err_msg":{"type":"string","description":"Error message."},"err_extra":{"type":"string","description":"Additional information describing the error."}}}}}}
```

## Get All Services

> Get a complete or filtered list of all your external services.\
> \
> The maximum result limit is 500.\ <br>

```json
{"openapi":"3.0.0","info":{"title":"Cortex Cloud Platform APIs","version":"Cortex Cloud 2.2"},"tags":[{"name":"Attack surface management","description":"APIs for attack surface management"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/assets/get_external_services":{"post":{"tags":["Attack surface management"],"summary":"Get All Services","description":"Get a complete or filtered list of all your external services.\n\nThe maximum result limit is 500.\n\n","operationId":"post-public_api-v1-assets-get_external_services","parameters":[{"name":"authorization","in":"header","description":"api-key","required":true,"schema":{"type":"string"}},{"name":"x-xdr-auth-id","in":"header","description":"api-key-id","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["request_data"],"properties":{"request_data":{"type":"object","properties":{"filters":{"type":"object","description":"An array of filter fields. ","properties":{"field":{"type":"string","enum":["active_classifications","business_units_list","discovery_type","domain","externally_detected_providers","externally_inferred_cves","inactive_classifications","ip_address","ipv6_address","is_active","protocol","service_name","service_type","service_type_list","tags"],"description":"String that identifies the service field the filter is matching. Filters are based on the following case-sensitive keywords:\r\n\r\n- active_classifications\r\n- business_units_list\r\n- discovery_type\r\n- domain\r\n- externally_detected_providers\r\n- externally_inferred_cves\r\n- inactive_classifications\r\n- ip_address\r\n- ipv6_address\r\n- is_active\r\n- protocol\r\n- service_name\r\n- service_type\r\n- service_type_list\r\n- tags"},"operator":{"type":"string","enum":["contains","not_contains","eq","neq","in"],"description":"String that identifies the comparison operator you want to use for this filter. Valid keywords and values are:\r\n- **contains** / **not_contains**— use with `externally_detected_providers`, `domain`, `externally_inferred_cves`, `active_classifications`, `inactive_classifications`, service_name, `service_type`, `protocol`\r\n- **eq** / **neq**—  use with `service_name`, `service_type`, `protocol`, `ip_address`\r\n- **in** — use with `is_active`, `discovery_type`, `business_units_list`, `tags` "},"value":{"description":"Value that this filter must match. The contents of this field will differ depending on the services field that you specified for this filter:\r\n- active_classifications — String\r\n- business_units_list — String or list of strings in the format \"BU name\" or \"BU:BU name\", for example “Acme & Co, Inc.” or “BU:Acme & Co, Inc.”\r\n- discovery_type — String. Values are: `colocated_on_ip`, `directly_discovered`, `unknown`.\r\n- domain —  String\r\n- externally_detected_providers — String \r\n- externally_inferred_cves — String\r\n- inactive_classifications — String\r\n- ip_address — String\r\n- ipv6_address— String\r\n- is_active — String. Values are:`yes`, `no`\r\n- protocol — string \r\n- service_name —  String\r\n- service_type —  String\r\n- service_type_list —  String\r\n- tags — List of strings indicating the tags to filter on in the format `\"tag-family:tag-name\"`, for example `\"AR:registered to you\"`.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}},"vulnerability_test_results":{"type":"boolean","enum":[true],"description":"Use this field with the value `true` to get vulnerability test results for the last 14 days for each service.\r\nUsing this field will slow down the endpoint."},"search_from":{"type":"integer","description":"An integer representing the start offset index of results.","default":0},"search_to":{"type":"integer","description":"An integer representing the start offset index of results. Use this field to specify the number of results on a page when using page token pagination.","default":5000},"sort":{"type":"object","description":"Identifies the sort order for the result set.","properties":{"keyword":{"type":"string","description":"Can be either ASC (ascending order) or DESC (descending order). Default is ASC. Values are case sensitive."},"field":{"type":"string","description":"Values are: \r\n- service_name \r\n- first_observed \r\n- last_observed \r\nBy default, case-sensitive, sort is defined as service_name.\r\n"}}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"reply":{"type":"object","properties":{"total_count":{"type":"integer"},"result_count":{"type":"integer"},"external_services":{"type":"array","items":{"type":"object","properties":{"service_id":{"type":"string"},"service_name":{"type":"string"},"service_type":{"type":"string"},"ip_address":{"type":"array","items":{"type":"string"}},"domain":{"type":"array","items":{"type":"string"}},"externally_detected_providers":{"type":"array","items":{"type":"string"}},"is_active":{"type":"string"},"first_observed":{"type":"integer"},"last_observed":{"type":"integer"},"port":{"type":"integer"},"protocol":{"type":"string"},"active_classifications":{"type":"array","items":{"type":"string"}},"inactive_classifications":{"type":"array","items":{"type":"string"}},"discovery_type":{"type":"string"},"business_units":{"type":"array","items":{"type":"string"}},"externally_inferred_vulnerability_score":{"type":"string"},"externally_inferred_cves":{"type":"array","items":{"type":"object"}},"tls_versions":{"type":"array","items":{"type":"object"}},"inferred_cves_observed":{"type":"array","items":{"type":"object"}},"cloud_management_status":{"type":"string"}}}}}}}}}}},"400":{"description":"Bad Request. Got invalid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}},"401":{"description":"Unauthorized access. An issue occurred during authentication. This can indicate an incorrect key, id, or other invalid authentication parameters."},"402":{"description":"Unauthorized access. User does not have the required license type to run this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}},"403":{"description":"Forbidden access. The provided API Key does not have the required RBAC permissions to run this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}},"500":{"description":"Internal server error. A unified status for API communication type errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/reply"}}}}}}}},"components":{"schemas":{"reply":{"type":"object","title":"reply","description":"The query result upon error.","properties":{"err_code":{"type":"string","description":"HTTP response code."},"err_msg":{"type":"string","description":"Error message."},"err_extra":{"type":"string","description":"Additional information describing the error."}}}}}}
```

## Get vulnerability tests

> Get a complete or filtered list of vulnerability tests. Results include details about each test, including the number of services confirmed vulnerable.\ <br>

```json
{"openapi":"3.0.0","info":{"title":"Cortex Cloud Platform APIs","version":"Cortex Cloud 2.2"},"tags":[{"name":"Attack surface management","description":"APIs for attack surface management"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/assets/get_vulnerability_tests":{"post":{"summary":"Get vulnerability tests","description":"Get a complete or filtered list of vulnerability tests. Results include details about each test, including the number of services confirmed vulnerable.\n\n","operationId":"post-public_api-v1-assets-get_vulnerability_tests","parameters":[{"name":"Authorization","in":"header","description":"{api_key}","required":true,"schema":{"type":"string"}},{"name":"x-xdr-auth-id","in":"header","description":"{api_key_id}","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"\n\n","content":{"application/json":{"schema":{"type":"object","properties":{"request_data":{"type":"object","properties":{"filters":{"type":"array","description":"An array of filter fields.","items":{"type":"object","properties":{"field":{"type":"string","enum":["name","status","vulnerability_ids","description","affected_software","cwe_ids","vendor_names","severity_score","epss_score","count_vulnerable_services"],"description":"Identifies the field the filter will match on."},"operator":{"type":"string","description":"Identifies the comparison operator to use for this filter. The following list shows which operator can be used for each filter field:\r\n- `name`: contains, eq, neq\r\n- `status`: eq\r\n- `vulnerability_ids`: contains, not_contains\r\n- `description`: contains\r\n- `affected_software`: contains, not_contains\r\n- `cwe_ids`: contains, not_contains\r\n- `vendor_names`: contains, not_contains\r\n- `severity_score`: eq, neq, gte, lte\r\n- `epss_score`: eq, neq, gte, lte\r\n- `count_vulnerable_services`: eq, neq, gte, lte\r\n"},"value":{"type":"string","description":"Value depends on the filter field used.\r\n- `name`: string e.g. apache\r\n- `status`: Enabled, Disabled\r\n- `vulnerability_ids`: strings in the form of CVE IDs, such as CVE-1, CVE-2\r\n- `description`: string e.g. apache\r\n- `affected_software`: strings\r\n- `cwe_ids`: strings in the form of CWE IDs such as CWE-20\r\n- `vendor_names`: strings such as Cisco, Siemens\r\n- `severity_score`: numbers, such as 2, 3.5\r\n- `epss_score`: numbers, such as 2, 3.5\r\n- `count_vulnerable_services`: integers, such as 1,2,5"}}}}}}},"required":["request_data"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"reply":{"type":"object","properties":{"total_count":{"type":"integer"},"result_count":{"type":"integer"},"vulnerability_tests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"vulnerability_ids":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"status":{"type":"string"},"vendor_names":{"type":"array","items":{"type":"string"}},"affected_software":{"type":"array","items":{"type":"object","properties":{"NAME":{"type":"string"},"VERSION_START_INCLUDING":{"type":"integer","nullable":true},"VERSION_START_EXCLUDING":{"type":"integer","nullable":true},"VERSION_END_INCLUDING":{"type":"integer","nullable":true},"VERSION_END_EXCLUDING":{"type":"string"},"VENDOR":{"type":"string"},"PRODUCT":{"type":"string"},"VERSION":{"type":"string"}}}},"severity_score":{"type":"number"},"cwe_ids":{"type":"array","items":{"type":"string"}},"epss_score":{"type":"number"},"references":{"type":"array","items":{"type":"string"}},"remediation_guidance":{"type":"string"},"first_published":{"type":"integer"},"created":{"type":"integer"},"count_vulnerable_services":{"type":"integer","nullable":true}}}}}}}}}}}},"tags":["Attack surface management"]}}}}
```

## Bulk Update Vulnerability Tests

> Enable or disable vulnerability tests.\
> \
> To view vulnerability test results, use the \[Get All Services]\(<https://app.gitbook.com/s/ZuJbX2x7VQJhNovscCwE/cortex-platform/attack-surface-management#post-public\\_api-v1-assets-get\\_external\\_services>) or \[Get Service Details]\(<https://app.gitbook.com/s/ZuJbX2x7VQJhNovscCwE/cortex-platform/attack-surface-management#post-public\\_api-v1-assets-get\\_external\\_service>) endpoints.\ <br>

```json
{"openapi":"3.0.0","info":{"title":"Cortex Cloud Platform APIs","version":"Cortex Cloud 2.2"},"tags":[{"name":"Attack surface management","description":"APIs for attack surface management"}],"servers":[{"url":"https://api-yourfqdn"}],"paths":{"/public_api/v1/assets/bulk_update_vulnerability_tests":{"post":{"tags":["Attack surface management"],"summary":"Bulk Update Vulnerability Tests","description":"Enable or disable vulnerability tests.\n\nTo view vulnerability test results, use the [Get All Services](https://app.gitbook.com/s/ZuJbX2x7VQJhNovscCwE/cortex-platform/attack-surface-management#post-public_api-v1-assets-get_external_services) or [Get Service Details](https://app.gitbook.com/s/ZuJbX2x7VQJhNovscCwE/cortex-platform/attack-surface-management#post-public_api-v1-assets-get_external_service) endpoints.\n\n","operationId":"post-public_api-v1-assets-bulk_update_vulnerability_tests","parameters":[{"name":"Authorization","in":"header","description":"{api_key}","required":true,"schema":{"type":"string"}},{"name":"x-xdr-auth-id","in":"header","description":"{api_key_id}","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"request_data":{"type":"object","properties":{"test_names":{"type":"array","description":"Names of tests, for example [\"test1\", \"test2\", \"test3\"]\r\n ","items":{"type":"string"}},"status":{"type":"string","enum":["Enabled","Disabled"]}}}}}}}},"responses":{"200":{"description":"OK"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-cloud-api/cortex-platform/attack-surface-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
