Palo Alto Networks Policies API

The Policies API from Palo Alto Networks — 82 operation(s) for policies.

OpenAPI Specification

palo-alto-networks-policies-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Palo Alto Networks Policies API
  version: '1.0'
  description: 'Operations tagged Policies across 5 of this provider''s published API definitions: palo-alto-code-policies-openapi.json, palo-alto-compute-34-03-openapi-34-03-138-sh-openapi.json, palo-alto-compute-openapi-34-04-145-sh-openapi.json, palo-alto-cwpp-34-03-openapi-34-03-138-saas-openapi.json, palo-alto-cwpp-openapi-34-04-145-saas-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.prismacloud.io
- url: PATH_TO_CONSOLE
tags:
- name: Policies
paths:
  /code/api/v1/policies/definition/{queryId}:
    post:
      description: "Prisma Cloud Application Security supports policy-as-code capabilities using YAML-based policy definition files to enable attribute and connection checks (composite checks).\n\n For information on defining YAML-based policies, see the Prisma Cloud documentation about the [Code Editor](https://docs.prismacloud.io/en/classic/appsec-admin-guide/get-started/code-repositories-policy-management/code-editor) and [Custom Build Policy Examples](https://docs.prismacloud.io/en/classic/appsec-admin-guide/get-started/code-repositories-policy-management/custom-build-policy-examples). If you are upgraded to Darwin, see  [Code Editor](https://docs.prismacloud.io/en/enterprise-edition/content-collections/governance/custom-build-policies/code-editor) and [Custom Build Policy Examples](https://docs.prismacloud.io/en/enterprise-edition/content-collections/governance/custom-build-policies/custom-build-policy-examples).\n\n To use the API request, add your token to the header. API supports both YAML and JSON configuration of Prisma Cloud Application Security custom policy schema.\n\n This API is used to validate a user defined Prisma Cloud Application Security YAML-based custom policy schema. It returns an array of errors for not supported keys, values, and more. This call is used to verify that a custom policy which is about to be saved is properly configured.\n\n Policy definitions include the following types:\noption 1 - \"attribute\" block (defined by cond_type=attribute) - checks the specific attributes of a given resource type\noption 2 - \"connection\" block (defined by cond_type=connection) - checks the existence of connection between given two resource group types\noption 3 - \"filter\" block (defined by cond_type=filter) - return given resource group types\noption 4 - \"and\"/\"or\"  - structure that supports nested \"and\"/\"or\" logic and blocks for options 1, 2 and 3\nUse the given examples as a reference for configuring the API request body."
      operationId: validateCustomPolicy
      parameters:
      - in: path
        name: queryId
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            example:
              definition:
                or:
                - attribute: instance_type
                  cond_type: attribute
                  operator: equals
                  resource_types:
                  - aws_instance
                  value: t3.micro
                - attribute: instance_type
                  cond_type: attribute
                  operator: equals
                  resource_types:
                  - aws_instance
                  value: t3.nano
              metadata:
                category: networking
                guidelines: In order to avoid compute issues in this account - change manually instances to be at least from type t3.small
                name: Org's compute instances should not be t3.micro or t3.nano
                severity: high
              scope:
                provider: aws
            schema:
              $ref: '#/components/schemas/PolicyValidation'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorsReturn'
          description: Policy definition
        '400':
          description: Invalid policy
        '403':
          description: Payment required
        '422':
          description: Request arguments validation error
      security:
      - CustomAuthorizer: []
      summary: Validate Policies - Code-based
      tags:
      - Policies
      x-codeSamples:
      - lang: Python + Requests
        source: "import requests\n\nurl = \"https://api.prismacloud.io/code/api/v1/policies/definition/{queryId}\"\n\npayload = {\n    \"definition\": {\n        \"attribute\": \"string\",\n        \"cond_type\": \"attribute\",\n        \"operator\": \"within\",\n        \"resource_types\": {\n            \"property1\": {\n                \"arguments\": [\"string\"],\n                \"provider\": \"string\"\n            },\n            \"property2\": {\n                \"arguments\": [\"string\"],\n                \"provider\": \"string\"\n            }\n        },\n        \"value\": \"string\"\n    },\n    \"metadata\": {\n        \"category\": \"elasticsearch\",\n        \"guidelines\": \"string\",\n        \"name\": \"string\",\n        \"severity\": \"critical\"\n    },\n    \"scope\": {\"provider\": \"aws\"}\n}\nheaders = {\n    \"content-type\": \"application/json\",\n    \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"
      - lang: Shell + Curl
        source: "curl --request POST \\\n  --url https://api.prismacloud.io/code/api/v1/policies/definition/{queryId} \\\n  --header 'authorization: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"definition\":{\"attribute\":\"string\",\"cond_type\":\"attribute\",\"operator\":\"within\",\"resource_types\":{\"property1\":{\"arguments\":[\"string\"],\"provider\":\"string\"},\"property2\":{\"arguments\":[\"string\"],\"provider\":\"string\"}},\"value\":\"string\"},\"metadata\":{\"category\":\"elasticsearch\",\"guidelines\":\"string\",\"name\":\"string\",\"severity\":\"critical\"},\"scope\":{\"provider\":\"aws\"}}'"
    servers:
    - url: https://api.prismacloud.io
  /code/api/v1/policies:
    post:
      deprecated: true
      description: "Prisma Cloud Application Security supports policy-as-code capabilities using YAML-based policy definition files to enable attribute and connection checks (composite checks).\n\n For information on defining YAML-based policies, see the Prisma Cloud documentation about the [Code Editor](https://docs.prismacloud.io/en/classic/appsec-admin-guide/get-started/code-repositories-policy-management/code-editor) and [Custom Build Policy Examples](https://docs.prismacloud.io/en/classic/appsec-admin-guide/get-started/code-repositories-policy-management/custom-build-policy-examples). If you are upgraded to Darwin, see  [Code Editor](https://docs.prismacloud.io/en/enterprise-edition/content-collections/governance/custom-build-policies/code-editor) and [Custom Build Policy Examples](https://docs.prismacloud.io/en/enterprise-edition/content-collections/governance/custom-build-policies/custom-build-policy-examples).\n\n To use the API request, add your token to the header. API supports both YAML and JSON configuration of Prisma Cloud Application Security custom policy schema.\n\n This API creates a new Prisma Cloud Application Security custom policy.\n\n The input will be a code-based policy definition file. The output will be a new policy id. In case of invalid code - output will include definition errors.\nUse the given examples as a reference for configuring the API request body for saving new policies.\n:::info\nUse the CSPM endpoint [Add Policy](/prisma-cloud/api/cspm/add-policy/) in place of this endpoint.\n:::"
      operationId: savePolicy
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/ErrorMessage'
                - $ref: '#/components/schemas/PolicyRes'
          description: Save a new policy data
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
        '202':
          description: Operation Accepted
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
        '400':
          description: Policy Validation Error
        '403':
          description: Payment required
        '422':
          description: Request arguments validation error
        '500':
          description: Failed to create new policy
      security:
      - CustomAuthorizer: []
      summary: Save New Policy
      tags:
      - Policies
      x-amazon-apigateway-integration:
        httpMethod: POST
        passthroughBehavior: when_no_match
        responseParameters:
          method.response.header.Access-Control-Allow-Headers: '''Content-Type,X-Amz-Date,Authorization,X-Api-Key'''
          method.response.header.Access-Control-Allow-Methods: '''*'''
          method.response.header.Access-Control-Allow-Origin: '''*'''
          method.response.header.Access-Control-Expose-Headers: '''etag'''
        type: aws_proxy
        uri: policies_api_arn
      x-codeSamples:
      - lang: Python + Requests
        source: "import requests\n\nurl = \"https://api.prismacloud.io/code/api/v1/policies\"\n\npayload = {}\nheaders = {\n    \"content-type\": \"application/json\",\n    \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)"
      - lang: Shell + Curl
        source: "curl --request POST \\\n  --url https://api.prismacloud.io/code/api/v1/policies \\\n  --header 'authorization: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{}'"
    servers:
    - url: https://api.prismacloud.io
  /code/api/v1/policies/table/data:
    get:
      deprecated: true
      description: "Prisma Cloud Application Security supports policy-as-code capabilities using YAML-based policy definition files to enable attribute and connection checks (composite checks).\n\n For information on defining YAML-based policies, see the Prisma Cloud documentation about the [Code Editor](https://docs.prismacloud.io/en/classic/appsec-admin-guide/get-started/code-repositories-policy-management/code-editor) and [Custom Build Policy Examples](https://docs.prismacloud.io/en/classic/appsec-admin-guide/get-started/code-repositories-policy-management/custom-build-policy-examples). If you are upgraded to Darwin, see  [Code Editor](https://docs.prismacloud.io/en/enterprise-edition/content-collections/governance/custom-build-policies/code-editor) and [Custom Build Policy Examples](https://docs.prismacloud.io/en/enterprise-edition/content-collections/governance/custom-build-policies/custom-build-policy-examples).\n\n To use the API request, add your token to the header. API supports both YAML and JSON configuration of Prisma Cloud Application Security custom policy schema.\n\n This API gets all Prisma Cloud Application Security custom policies with count of passed, failed, suppressed resources, scan status (compliant/non-compliant), and attached benchmarks of specific policies.\n\n Use the given examples as a reference for the expected output of this API request.\n:::info \n Use the CSPM endpoint [List Policies V2](/prisma-cloud/api/cspm/get-policies-v-2/) in place of this endpoint.\n :::"
      operationId: getCustomPoliciesTable
      parameters: []
      responses:
        '200':
          content:
            application/json:
              examples:
                Example 1:
                  value:
                    data:
                    - accountsData: {}
                      benchmarks:
                        CIS AWS V1.2:
                        - id
                        CIS AZURE V1.1:
                        - id
                        CIS KUBERNETES V1.5:
                        - id
                        HIPAA:
                        - id_1
                        - id_2
                        - id_3
                        - id_4
                        - id_5
                        - id_6
                        PCI-DSS V3.2:
                        - id_1
                        - id_2
                      category: IAM
                      code: null
                      conditionQuery: null
                      createdBy: null
                      guideline: https://docs
                      id: POLICY_ID
                      isCustom: false
                      provider: AWS
                      resourceTypes:
                      - aws_root
                      severity: CRITICAL
                      title: Title of the policy
                    - accountsData:
                        owner/repo:
                          amounts:
                            AWAITING_REMEDIATION: 0
                            CLOSED: 0
                            DELETED: 0
                            OPEN: 1
                            REMEDIATED: 0
                            SUPPRESSED: 0
                          lastUpdateDate: '2021-06-14T10:27:15.230Z'
                        owner2/repo2:
                          amounts:
                            AWAITING_REMEDIATION: 0
                            CLOSED: 0
                            DELETED: 0
                            OPEN: 1
                            REMEDIATED: 0
                            SUPPRESSED: 0
                          lastUpdateDate: '2021-06-14T10:27:11.490Z'
                      benchmarks:
                        CIS AWS V1.2:
                        - id
                        CIS AZURE V1.1:
                        - id
                        CIS KUBERNETES V1.5:
                        - id
                        HIPAA:
                        - id_1
                        - id_2
                        - id_3
                        - id_4
                        - id_5
                        - id_6
                        PCI-DSS V3.2:
                        - id_1
                        - id_2
                      category: IAM
                      code: null
                      conditionQuery: null
                      createdBy: null
                      guideline: https://docs
                      id: POLICY_ID
                      isCustom: false
                      provider: AWS
                      resourceTypes:
                      - aws_iam_user_policy
                      - aws_iam_user_policy_attachment
                      - aws_iam_policy_attachment
                      severity: CRITICAL
                      title: Policy title
                    filters:
                      accounts:
                      - owner/repo
                      - owner2/repo2
                      benchmarks:
                      - SOC2
                      - PCI-DSS V3.2
                      - HIPAA
                      - NIST-800-53
                      - ISO27001
                      - CIS AWS V1.2
                      - CIS AWS V1.3
                      - PCI-DSS V3.2.1
                      - FEDRAMP (MODERATE)
                      - CIS GKE V1.1
                      - CIS KUBERNETES V1.5
                      - CIS EKS V1.1
                      - CIS KUBERNETES V1.6
                      - CIS GCP V1.1
                      - CIS AZURE V1.1
                      - CIS AZURE V1.3
                      - CIS DOCKER V1.2
                      category:
                      - IAM
                      - Monitoring
                      - Logging
                      - Networking
                      - Storage
                      - Serverless
                      - Public
                      - General
                      - Elasticsearch
                      - Secrets
                      createdBy:
                      - Prisma Cloud Application Security
                      - user@email.com
                      provider:
                      - Kubernetes
                      - AWS
                      - GCP
                      - Azure
                      - Docker
                      resourceTypes:
                      - aws_root
                      - aws_iam_user
                      - aws_iam_access_key
                      - aws_iam_account_password_policy
                      - aws_root_access_key
                      - google_project
                      severity:
                      - CRITICAL
                      - HIGH
                      - MEDIUM
                      - LOW
              schema:
                anyOf:
                - $ref: '#/components/schemas/PoliciesTable'
                - $ref: '#/components/schemas/ErrorMessage'
          description: Returns custom policies with benchmarks and errors count
        '500':
          description: Failed to get custom policies with benchmarks and errors count
      security:
      - CustomAuthorizer: []
      summary: Get Custom Policies Table Data
      tags:
      - Policies
      x-codeSamples:
      - lang: Python + Requests
        source: 'import requests


          url = "https://api.prismacloud.io/code/api/v1/policies/table/data"


          headers = {"authorization": "REPLACE_KEY_VALUE"}


          response = requests.request("GET", url, headers=headers)


          print(response.text)'
      - lang: Shell + Curl
        source: "curl --request GET \\\n  --url https://api.prismacloud.io/code/api/v1/policies/table/data \\\n  --header 'authorization: REPLACE_KEY_VALUE'"
    servers:
    - url: https://api.prismacloud.io
  /code/api/v1/policies/{policyId}:
    put:
      deprecated: true
      description: "Prisma Cloud Application Security supports policy-as-code capabilities using YAML-based policy definition files to enable attribute and connection checks (composite checks).\n\n For information on defining YAML-based policies, see the Prisma Cloud documentation about the [Code Editor](https://docs.prismacloud.io/en/classic/appsec-admin-guide/get-started/code-repositories-policy-management/code-editor) and [Custom Build Policy Examples](https://docs.prismacloud.io/en/classic/appsec-admin-guide/get-started/code-repositories-policy-management/custom-build-policy-examples). If you are upgraded to Darwin, see  [Code Editor](https://docs.prismacloud.io/en/enterprise-edition/content-collections/governance/custom-build-policies/code-editor) and [Custom Build Policy Examples](https://docs.prismacloud.io/en/enterprise-edition/content-collections/governance/custom-build-policies/custom-build-policy-examples).\n\n To use the API request, add your token to the header. API supports both YAML and JSON configuration of Prisma Cloud Application Security custom policy schema.\n\n This API request updates an existing Prisma Cloud Application Security custom policy. The API contains the fields to be edited. Any field not included in the request will remain unchanged.\n\n You can use this API request to add fields that were previously not configured. The output will be the id of updated policy.\nUse the given examples as a reference for configuring the API request body.\n\n :::info\nUse the CSPM endpoint [Update Policy](/prisma-cloud/api/cspm/update-policy/) in place of this endpoint.\n:::"
      operationId: updatePolicy
      parameters:
      - description: '- the policy Id to update'
        in: path
        name: policyId
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/ErrorMessage'
                - $ref: '#/components/schemas/PolicyRes'
          description: Update a policy data
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
        '202':
          description: Operation Accepted
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
        '400':
          description: Policy Validation Error
        '422':
          description: Request arguments validation error
        '500':
          description: Could not update policy
      security:
      - CustomAuthorizer: []
      summary: Update Policy
      tags:
      - Policies
      x-amazon-apigateway-integration:
        httpMethod: POST
        passthroughBehavior: when_no_match
        responseParameters:
          method.response.header.Access-Control-Allow-Headers: '''Content-Type,X-Amz-Date,Authorization,X-Api-Key'''
          method.response.header.Access-Control-Allow-Methods: '''*'''
          method.response.header.Access-Control-Allow-Origin: '''*'''
          method.response.header.Access-Control-Expose-Headers: '''etag'''
        type: aws_proxy
        uri: policies_api_arn
      x-codeSamples:
      - lang: Python + Requests
        source: "import requests\n\nurl = \"https://api.prismacloud.io/code/api/v1/policies/{policyId}\"\n\npayload = {}\nheaders = {\n    \"content-type\": \"application/json\",\n    \"authorization\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\nprint(response.text)"
      - lang: Shell + Curl
        source: "curl --request PUT \\\n  --url https://api.prismacloud.io/code/api/v1/policies/{policyId} \\\n  --header 'authorization: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{}'"
    delete:
      deprecated: true
      description: "Prisma Cloud Application Security supports policy-as-code capabilities using YAML-based policy definition files to enable attribute and connection checks (composite checks).\n\n For information on defining YAML-based policies, see the Prisma Cloud documentation about the [Code Editor](https://docs.prismacloud.io/en/classic/appsec-admin-guide/get-started/code-repositories-policy-management/code-editor) and [Custom Build Policy Examples](https://docs.prismacloud.io/en/classic/appsec-admin-guide/get-started/code-repositories-policy-management/custom-build-policy-examples). If you are upgraded to Darwin, see  [Code Editor](https://docs.prismacloud.io/en/enterprise-edition/content-collections/governance/custom-build-policies/code-editor) and [Custom Build Policy Examples](https://docs.prismacloud.io/en/enterprise-edition/content-collections/governance/custom-build-policies/custom-build-policy-examples).\n\n To use the API request, add your token to the header. API supports both YAML and JSON configuration of Prisma Cloud Application Security custom policy schema.\n\n This API deletes an existing Prisma Cloud Application Security custom policy. The output will be the id of deleted policy.\n\n :::info\nUse the CSPM endpoint [Delete Policy](/prisma-cloud/api/cspm/delete-policy/) in place of this endpoint.\n:::"
      operationId: removePolicy
      parameters:
      - description: '- the policy Id to delete'
        in: path
        name: policyId
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                Example 1:
                  value:
                    policy: policy1
              schema:
                anyOf:
                - $ref: '#/components/schemas/ErrorMessage'
                - $ref: '#/components/schemas/PolicyRes'
          description: Remove a policy data by policy id
        '201':
          description: Policy removed
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
        '404':
          description: Policy id is not exist
        '422':
          description: Request arguments validation error
        '500':
          description: Could not remove policy
      security:
      - CustomAuthorizer: []
      summary: Delete Policy
      tags:
      - Policies
      x-amazon-apigateway-integration:
        httpMethod: POST
        passthroughBehavior: when_no_match
        responseParameters:
          method.response.header.Access-Control-Allow-Headers: '''Content-Type,X-Amz-Date,Authorization,X-Api-Key'''
          method.response.header.Access-Control-Allow-Methods: '''*'''
          method.response.header.Access-Control-Allow-Origin: '''*'''
        type: aws_proxy
        uri: policies_api_arn
      x-codeSamples:
      - lang: Python + Requests
        source: 'import requests


          url = "https://api.prismacloud.io/code/api/v1/policies/{policyId}"


          headers = {"authorization": "REPLACE_KEY_VALUE"}


          response = requests.request("DELETE", url, headers=headers)


          print(response.text)'
      - lang: Shell + Curl
        source: "curl --request DELETE \\\n  --url https://api.prismacloud.io/code/api/v1/policies/{policyId} \\\n  --header 'authorization: REPLACE_KEY_VALUE'"
    servers:
    - url: https://api.prismacloud.io
  /code/api/v1/policies/preview:
    post:
      description: "Prisma Cloud Application Security supports policy-as-code capabilities using YAML-based policy definition files to enable attribute and connection checks (composite checks).\n\n For information on defining YAML-based policies, see the Prisma Cloud documentation about the [Code Editor](https://docs.prismacloud.io/en/classic/appsec-admin-guide/get-started/code-repositories-policy-management/code-editor) and [Custom Build Policy Examples](https://docs.prismacloud.io/en/classic/appsec-admin-guide/get-started/code-repositories-policy-management/custom-build-policy-examples). If you are upgraded to Darwin, see  [Code Editor](https://docs.prismacloud.io/en/enterprise-edition/content-collections/governance/custom-build-policies/code-editor) and [Custom Build Policy Examples](https://docs.prismacloud.io/en/enterprise-edition/content-collections/governance/custom-build-policies/custom-build-policy-examples).\n\n To use the API request, add your token to the header. API supports both YAML and JSON configuration of Prisma Cloud Application Security custom policy schema.\n\n This API gets up to 30 results (by default) of non-compliant resources for a specific policy. The input is the policy to test and the output is an array of resources results.\n\n Use the first example to configure the API to test a policy, and use the second example as a reference of the expected output."
      operationId: policyPreview
      parameters: []
      requestBody:
        content:
          application/json:
            example:
              policy:
                policy_preview:
                  query:
                    attribute: value
                    cond_type: attribute
                    operator: exists
                    resource_types:
                    - aws_s3_bucket
                  resource_types:
                  - aws_s3_bucket
                  scope:
                    provider: aws
              resultsNumber: 20
              token: '12345'
            schema:
              $ref: '#/components/schemas/PolicyPreviewBody'
              type: string
        description: policy query
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                Example 1:
                  value:
                    data:
                    - arn: /../folderName/account/branch/provider/resource
                      awsAccountId: owner/repo
                      code: "---\nmetadata:\n  name: \"example\" \n  guidelines: \"guidelines example\" \n  category: \"elasticsearch\" \n  severity: \"critical\" \nscope:\n  provider: \"aws\" \ndefinition: #define the conditions the policy searches for.\n  or:\n  - cond_type: \"attribute\"\n    resource_types:\n    - \"aws_instance\"\n    attribute: \"instance_type\"\n    operator: \"equals\"\n    value: \"t3.micro\"\n  - cond_type: \"attribute\"\n    resource_types:\n    - \"aws_instance\"\n    attribute: \"instance_type\"\n    operator: \"equals\"\n    value: \"t3.nano\"\n"
                      createdBy: username
                      customerName: customerName
                      file_path: filePath
                      lines:
                      - 10
                      - 20
                      resource: aws_s3_bucket.logs
                      source: ''
                      status: Pass
                    - arn: arn
                      awsAccountId: owner/repo
                      code: resource code block
                      createdBy: username
                      customerName: customerName
                      file_path: filePath
                      lines:
                      - 4
                      - 6
                      resource: aws_s3_bucket.flowbucket
                      source: ''
                      status: Fail
                    token: '12345'
              schema:
                anyOf:
                - $ref: '#/components/schemas/policyPreviewResult'
                - $ref: '#/components/schemas/ErrorMessage'
          description: Got policy preview
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
        '403':
          description: Payment required
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: policies are not found
        '422':
          description: Request arguments validation error
        '500':
          description: Could not get policy preview data
      security:
      - CustomAuthorizer: []
      summary: Policy Preview
      tags:
      - Policies
      x-amazon-apigateway-integration:
        httpMethod: POST
        passthroughBehavior: when_no_match
        responseParameters:
          method.response.header.Access-Control-Allow-Headers: '''Content-Type,X-Amz-Date,Authorization,X-Api-Key'''
          method.response.header.Access-Control-Allow-Methods: '''*'''
          method.response.header.Access-Control-Allow-Origin: '''*'''
        type: aws_proxy
        uri: policies_api_arn
      x-codeSamples:
      - lang: Python + Requests
        source: "import requests\n\nurl = \"https://api.prismacloud.io/code/api/v1/policies/preview\"\n\npayload = {\n    \"checkovCheckId\": \"string\",\n    \"policy\": {\"policy_preview\": {\n            \"query\": {\n                \"attribute\": \"string\",\n                \"cond_type\": \"attribute\",\n                \"operator\": \"within\",\n                \"resource_types\": {\n                    \"property1\": {\n                        \"arguments\": [\"string\"],\n                        \"provider\": \"string\"\n                    },\n                    \"property2\": {\n                        \"arguments\": [\"string\"],\n                        \"provider\": \"string\"\n                    }\n                },\n                \"value\": \"string\"\n            },\n            \"resource_types\": \"string\",\n            \"scope\": {\"provider\": \"aws\"}\n        }},\n    \"policyId\": \"string\",\n    \"resultsNumber\": 0,\n    \"token\": \"string\"\n}\nheaders = {\n 

# --- truncated at 32 KB (480 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/palo-alto-networks/refs/heads/main/openapi/palo-alto-networks-policies-api-openapi.yml