> 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/xpanse-api/xpanse-public-api/attack-surface-rules.md).

# Attack Surface Rules

APIs for managing attack surface rules

## Get All Attack Surface Rules

> Get all or a subset of attack surface rules. \<br />Required License: \*\*Cortex Xpanse Expander\*\*<br>

```json
{"openapi":"3.0.2","info":{"title":"Cortex Xpanse REST API","version":"2.12.0"},"tags":[{"name":"Attack Surface Rules","description":"APIs for managing attack surface rules"}],"servers":[{"url":"https://api-{{fqdn}}"}],"paths":{"/public_api/v1/get_attack_surface_rules/":{"post":{"parameters":[{"in":"header","name":"authorization","description":"api-key","schema":{"type":"string"},"required":true},{"in":"header","name":"x-xdr-auth-id","description":"api-key-id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAttackSurfaceRulesResponse"}}}},"400":{"description":"Bad Request. Got an invalid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}},"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/DefaultApiErrorResponse"}}}},"402":{"description":"Unauthorized access. User does not have the required license type to run this API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}},"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/DefaultApiErrorResponse"}}}},"422":{"$ref":"#/components/responses/UNPROCESSABLE_ENTITY"},"500":{"description":"Internal server error. A unified status for API communication type errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultApiErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAttackSurfaceRulesRequest"}}},"description":""},"summary":"Get All Attack Surface Rules","tags":["Attack Surface Rules"],"description":"Get all or a subset of attack surface rules. <br />Required License: **Cortex Xpanse Expander**\n"}}},"components":{"schemas":{"GetAttackSurfaceRulesResponse":{"type":"object","properties":{"reply":{"$ref":"#/components/schemas/AttackSurfaceRulesPage"}},"required":["reply"],"additionalProperties":true},"AttackSurfaceRulesPage":{"type":"object","properties":{"total_count":{"type":"integer","minimum":0},"result_count":{"type":"integer","minimum":0},"attack_surface_rules":{"type":"array","items":{"$ref":"#/components/schemas/AttackSurfaceRule"}}},"required":["attack_surface_rules","result_count","total_count"],"additionalProperties":true},"AttackSurfaceRule":{"type":"object","properties":{"attack_surface_rule_name":{"type":"string"},"enabled_status":{"type":"string"},"priority":{"type":"string"},"description":{"type":"string"},"attack_surface_rule_id":{"type":"string"},"category":{"type":"string"},"knowledge_base_link":{"type":"string"},"created":{"type":"integer"},"modified":{"type":"integer"},"modified_by":{"type":"string"},"remediation_guidance":{"type":"string"},"asm_alert_categories":{"type":"array","items":{"type":"string"}}},"required":["asm_alert_categories","attack_surface_rule_id","attack_surface_rule_name","category","created","description","enabled_status","modified","priority","remediation_guidance"],"additionalProperties":true},"DefaultApiErrorResponse":{"type":"object","properties":{"reply":{"description":"The query results upon error.","allOf":[{"$ref":"#/components/schemas/GenericReply"}]}},"required":["reply"],"additionalProperties":true},"GenericReply":{"type":"object","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."}},"additionalProperties":true},"Error":{"type":"object","properties":{"code":{"type":"integer","description":"Error code"},"status":{"type":"string","description":"Error name"},"message":{"type":"string","description":"Error message"},"errors":{"type":"object","description":"Errors"}}},"GetAttackSurfaceRulesRequest":{"type":"object","properties":{"request_data":{"$ref":"#/components/schemas/GetAttackSurfaceRulesRequestData"}},"required":["request_data"],"additionalProperties":true},"GetAttackSurfaceRulesRequestData":{"type":"object","properties":{"filters":{"type":"array","items":{"$ref":"#/components/schemas/AttackSurfaceRulesFilter"},"description":"Provides an array of filtered fields. Each JSON object can contain the following keywords:\n  - field\n  - operators\n  - value\n"},"search_from":{"type":"integer","default":0,"minimum":0,"description":"An integer representing the starting offset within the query result set from which you want attack surface rules returned"},"search_to":{"type":"integer","default":500,"minimum":0,"description":"An integer representing the end offset within the result set after which you do not want attack surface rules returned. <br />Attack surface rules in the alerts list that are indexed higher than this value are not returned in the final results set. \n"},"sort":{"$ref":"#/components/schemas/GetAttackSurfaceRulesSort"}},"additionalProperties":true,"description":"(Required) A dictionary containing the API request fields.<br />An empty dictionary returns all results."},"AttackSurfaceRulesFilter":{"type":"object","properties":{"field":{"type":"string","enum":["attack_surface_rule_id","category","priority","enabled_status","asm_alert_categories"],"description":"Identifies the alert field the filter is matching. Filters are based on the following keywords:\n  - enabled_status\n  - category\n  - priority\n  - attack_surface_rule_id\n  - asm_alert_categories\n"},"operator":{"type":"string","enum":["in"],"description":"String that identifies the comparison operator you want to use for this filter. \n  - in\n"},"value":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Value that this filter must match. The contents of this field will differ depending on the alert field that you specified for this filter"}}},"GetAttackSurfaceRulesSort":{"type":"object","properties":{"field":{"type":"string","default":"created","enum":["enabled_status","priority","category","attack_surface_rule_id","attack_surface_rule_name","created"]},"keyword":{"type":"string","default":"desc","enum":["ASC","asc","DESC","desc"],"description":"Can either be ASC (ascending order) or DESC (descending order)."}},"additionalProperties":true,"description":"Identifies the sort order for the result set. By default, the sort is defined as created, DESC."}},"responses":{"UNPROCESSABLE_ENTITY":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}
```


---

# 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/xpanse-api/xpanse-public-api/attack-surface-rules.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.
