PaloAltoNetworks / PaloAltoNetworks/pan.dev
Issue with "Create an anti-spyware profile"
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 78
- Forks
- 88
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 18
Description
Documentation link
https://pan.dev/scm/api/config/ngfw/security/create-anti-spyware-profiles/
Describe the problem
The documentation has an inaccuracy where it states that the threat_name is allowed to be 3 characters long:
threat_name - string
Possible values: >= 3 characters
Default value: any
But if you try and create an anti-spyware profile with the field set to "any" for example, then it fails with a different validation error saying you need at least 4 characters, which is >= 4 characters and not what the documentation states:
Example payload:
{
"name": "Example",
"rules": [
{
"name": "example-rule",
"threat_name": "any",
"severity": [
"critical"
],
"action": {
"alert": {}
},
"packet_capture": "disable"
}
]
}
Which gives the following error response:
HTTP 400 for https://api.strata.paloaltonetworks.com/config/security/v1/anti-spyware-profiles?folder=All
{
"_errors": [
{
"code": "API_I00035",
"message": "Invalid Request Payload [object Object]",
"details": [
"\"rules[0].threat_name\" length must be at least 4 characters long",
]
}
],
"_request_id": "---"
}
Suggested fix
Change the api to allow threat_name with 3 characters or more instead of it being 4 characters or more, to align with the documentation
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the linked anti-spyware profiles documentation and inspect the entry for rules[].threat_name alongside the example payload and reported HTTP 400 response. Determine whether the documented minimum or the API validation is authoritative, then make the documentation and behavior consistent and verify the example no longer conflicts with the stated constraint.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100