PaloAltoNetworks / prisma.pan.dev

The home of Developer docs for Prisma by Palo Alto Networks
https://prisma.pan.dev
MIT License
21 stars 38 forks source link

Issue with "Policy API" in @site/api/cloud/cspm/policy.mdx #79

Closed mph13 closed 3 years ago

mph13 commented 3 years ago

Thank you for taking the time to help us improve our documentation! Please describe the problem and a suggested fix below and we'll get back to you as soon as we can. --DevRel

Describe the problem

The "Update Policy" endpoint states that not ALL body params are required. This is true, but there are still red stars indicating required params - these should be removed if not necessary. Second, the blurb below states that the policy will stay "enabled" if you don't pass anything; this is not true. When updating the policy via this endpoint, any modification without also explicitly passing the "enabled: true" param will actually DISABLE the policy.

Location: https://prisma.pan.dev/api/cloud/cspm/policy#operation/update-policy

States:

Although multiple body parameters are marked as required, to update a policy, you need to provide only the body parameters that you want to update with the exception of the boolean parameter enabled, which will default to a value of true unless otherwise specified

Suggested fix

  1. Remove the red stars for the non-required params
  2. Change the API endpoint to when a param is passed, keep the policy enabled. (Please don't just change the document. The API is broken and should remain enabled when updating a policy).
debbm commented 3 years ago

Merged fix that changes the documentation for https://prisma.pan.dev/api/cloud/cspm/policy#operation/update-policy to describe the enabled parameter more accurately. As you know, there was another ticket for Engg to address the behavior in oob policies. Addressing the "required" flags is harder. Theses flags are set on the models, not on each API. I understand the concern, and I agree the current solution is not ideal. Any fix I can think of, though, is non-trivial and would probably require Engg and PM agreement. I can open an Engg ticket.