<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Creating CI/build and run policies for container image labels / Dockerfile instructions in Prisma Cloud Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/creating-ci-build-and-run-policies-for-container-image-labels/m-p/588245#M1229</link>
    <description>&lt;P&gt;We have been deploying custom build and run policies via Checkov (targeting Terraform resources, i.e.: VMs). We do this via the Governance pane in the Prisma Cloud "Cloud Security" component. These policies check usage of tags. Cool.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Now we're trying to create an equivalent set of policies for Container Images Labels. Specifically,&amp;nbsp;we want to create guardrails and alerting around the usage of container images labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone have an idea on how to create custom policies for this with Prisma Cloud?&amp;nbsp;(either from CSPM/governance or the CWP/runtime compliance checks, the documentation and examples is not loads extensive and support seems to be missing at times).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thoughts?&lt;/P&gt;
&lt;P&gt;&lt;LI-PRODUCT title="Prisma Cloud" id="Prisma_Cloud"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2024 10:17:19 GMT</pubDate>
    <dc:creator>patriciar</dc:creator>
    <dc:date>2024-05-29T10:17:19Z</dc:date>
    <item>
      <title>Creating CI/build and run policies for container image labels / Dockerfile instructions</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/creating-ci-build-and-run-policies-for-container-image-labels/m-p/588245#M1229</link>
      <description>&lt;P&gt;We have been deploying custom build and run policies via Checkov (targeting Terraform resources, i.e.: VMs). We do this via the Governance pane in the Prisma Cloud "Cloud Security" component. These policies check usage of tags. Cool.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Now we're trying to create an equivalent set of policies for Container Images Labels. Specifically,&amp;nbsp;we want to create guardrails and alerting around the usage of container images labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone have an idea on how to create custom policies for this with Prisma Cloud?&amp;nbsp;(either from CSPM/governance or the CWP/runtime compliance checks, the documentation and examples is not loads extensive and support seems to be missing at times).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thoughts?&lt;/P&gt;
&lt;P&gt;&lt;LI-PRODUCT title="Prisma Cloud" id="Prisma_Cloud"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 10:17:19 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/creating-ci-build-and-run-policies-for-container-image-labels/m-p/588245#M1229</guid>
      <dc:creator>patriciar</dc:creator>
      <dc:date>2024-05-29T10:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Creating CI/build and run policies for container image labels / Dockerfile instructions</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/creating-ci-build-and-run-policies-for-container-image-labels/m-p/617835#M1357</link>
      <description>&lt;P&gt;Hi Patriciar,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you would like to check for existence of labels in a Dockerfile at build time you can write a simple custom check, for example to check for org and purpose labels:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;metadata:
  id: "MyLabelCheck"
  name: "Ensure org and purpose labels are present"
  category: "APPLICATION_SECURITY"
definition:
  and:
    - cond_type: attribute
      resource_types:
        - LABEL
      attribute: value
      operator: contains
      value: "purpose="
    - cond_type: attribute
      resource_types:
        - LABEL
      attribute: value
      operator: contains
      value: "org="&lt;/LI-CODE&gt;
&lt;P&gt;That will check against the LABEL directive in Dockerfile, for example&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FROM node:alpine
LABEL org=Accounting purpose=Appserver
RUN useradd -m appuser
USER appuser
WORKDIR /usr/src/app
..etc..&lt;/LI-CODE&gt;
&lt;P&gt;Then you can tell checkov to load the additional check from the directory where you placed the yaml file&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;checkov [other paramereters] --framework dockerfile --external-checks-dir my_yaml_checks_dir/ --check MyLabelCheck &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 20:28:15 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/creating-ci-build-and-run-policies-for-container-image-labels/m-p/617835#M1357</guid>
      <dc:creator>JNeytchev</dc:creator>
      <dc:date>2024-11-14T20:28:15Z</dc:date>
    </item>
  </channel>
</rss>

