Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/Help with "Add Policy" - Bad format on example JSON payload #601

Open
ytimyno opened this issue Feb 8, 2024 · 0 comments
Open

Issue/Help with "Add Policy" - Bad format on example JSON payload #601

ytimyno opened this issue Feb 8, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@ytimyno
Copy link

ytimyno commented Feb 8, 2024

Documentation link

https://pan.dev/prisma-cloud/api/cspm/add-policy/
Under "The JSON below is an example of the request body parameters you need to add a custom build policy:". Have not thoroughly validated the others.

Describe the problem

Example JSON payload below "The JSON below is an example of the request body parameters you need to add a custom build policy:" is incorrect. Easy to fix if you copy paste it to a code editor.
Problem is in payload.rule.children

Suggested fix

Change to:
payload = {
"cloudType": "aws",
"complianceMetadata": [],
"description": "",
"labels": [],
"name": "demo",
"policySubTypes": [
"build"
],
"policyType": "config",
"recommendation": "",
"rule": {
"children": [{
"criteria": "{"category":"Storage","resourceTypes":["aws_s3_bucket"],"conditionQuery":{"attribute":"acl","operator":"not_equals","value":"log-delivery-write","cond_type":"attribute"}}",
"type": "build",
"recommendation": ""
}
],
"name": "demo",
"parameters": {
"savedSearch": "false",
"withIac": "true"
},
"type": "Config"
},
"severity": "low"
}

@ytimyno ytimyno added the documentation Improvements or additions to documentation label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant