<?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 Jenkins  -  PrismaCloudScanImage function -  'result' file not found in Prisma Cloud Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/jenkins-prismacloudscanimage-function-result-file-not-found/m-p/599783#M1306</link>
    <description>&lt;P&gt;Hi Everyone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trialling scanning of container images with Prisma Cloud.&amp;nbsp; I'm finding myself stuck where the result of the scan cannot be found and the workflow fails.&amp;nbsp; THis happens during the PrismaCloudScanImage function rather than the later PrismaCloudPublish one.&amp;nbsp; The error message is as follow:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE id="out" class="console-output"&gt;&lt;SPAN class="pipeline-node-24"&gt;[PrismaCloud_DemoBuild] $ /home/jenkins/workspace/PrismaCloud_DemoBuild/twistcli18328331056399694186 images scan --docker-address tcp://192.168.0.179:12375 --ci --publish --details --address &lt;A href="https://europe-west9.cloud.twistlock.com/france-607222237" target="_blank" rel="noopener"&gt;https://europe-west9.cloud.twistlock.com/france-607222237&lt;/A&gt; --ci-results-file prisma-cloud-scan-results.json dev/my-ubuntu:68
[PRISMACLOUD] failed to augment data: API error (404): Could not find the file /var/lib/twistlock/analysis/result in container &lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A bit about the docker setup (This is a lab environment i have no concerns about security)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Jenkins is running in a container&lt;/LI&gt;
&lt;LI&gt;The docker build agent 'alpine-dockercli' is dynamically created&amp;nbsp; upon running the pipeline. The Connect method is SSH.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;The docker build agent is based on alpine:latest and has SSHD, Java and Docker CLI installed&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Jenkins makes an API call to a SOCAT container (192.168.0.179:12375) which exposes the REST API of the underlying docker Host&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the pipeline script which is the example taken from the documentation&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any thoughts ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;pipeline {
    agent {label 'alpine-dockercli'}
    stages{
        stage('createImage') {
            steps{
                sh 'echo "Creating Dockerfile..."'
                sh 'echo "FROM ubuntu:bionic" &amp;gt; Dockerfile'
                sh 'echo "ENV MYSQL_HOST=DB_Server" &amp;gt;&amp;gt; Dockerfile'
                sh 'echo "ENV MYSQL_PASSWORD=5TTnvuTDJJSq6" &amp;gt;&amp;gt; Dockerfile'
                sh 'echo "LABEL description=Test_Twistlock_Jenkins_Plugin" &amp;gt;&amp;gt; Dockerfile'
                sh '''docker -H=tcp://192.168.0.179:12375 build --no-cache -t dev/my-ubuntu:$BUILD_NUMBER .'''
                }
            }
        }
        stage('twistlockScan') {
            steps{
                prismaCloudScanImage ca: '', cert: '', dockerAddress: 'tcp://192.168.0.179:12375', ignoreImageBuildTime: true, image: 'dev/my-ubuntu:$BUILD_NUMBER', key: '', logLevel: 'debug', podmanPath: '', project: '', resultsFile: 'prisma-cloud-scan-results.json', sbom: ''
                input "stop"
            }
        }
        stage('twistlockPublish') {
            steps{
                prismaCloudPublish resultsFilePattern: 'prisma-cloud-scan-results.json'
            }
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Oct 2024 14:33:13 GMT</pubDate>
    <dc:creator>Julien-Potier</dc:creator>
    <dc:date>2024-10-08T14:33:13Z</dc:date>
    <item>
      <title>Jenkins  -  PrismaCloudScanImage function -  'result' file not found</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/jenkins-prismacloudscanimage-function-result-file-not-found/m-p/599783#M1306</link>
      <description>&lt;P&gt;Hi Everyone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trialling scanning of container images with Prisma Cloud.&amp;nbsp; I'm finding myself stuck where the result of the scan cannot be found and the workflow fails.&amp;nbsp; THis happens during the PrismaCloudScanImage function rather than the later PrismaCloudPublish one.&amp;nbsp; The error message is as follow:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE id="out" class="console-output"&gt;&lt;SPAN class="pipeline-node-24"&gt;[PrismaCloud_DemoBuild] $ /home/jenkins/workspace/PrismaCloud_DemoBuild/twistcli18328331056399694186 images scan --docker-address tcp://192.168.0.179:12375 --ci --publish --details --address &lt;A href="https://europe-west9.cloud.twistlock.com/france-607222237" target="_blank" rel="noopener"&gt;https://europe-west9.cloud.twistlock.com/france-607222237&lt;/A&gt; --ci-results-file prisma-cloud-scan-results.json dev/my-ubuntu:68
[PRISMACLOUD] failed to augment data: API error (404): Could not find the file /var/lib/twistlock/analysis/result in container &lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A bit about the docker setup (This is a lab environment i have no concerns about security)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Jenkins is running in a container&lt;/LI&gt;
&lt;LI&gt;The docker build agent 'alpine-dockercli' is dynamically created&amp;nbsp; upon running the pipeline. The Connect method is SSH.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;The docker build agent is based on alpine:latest and has SSHD, Java and Docker CLI installed&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Jenkins makes an API call to a SOCAT container (192.168.0.179:12375) which exposes the REST API of the underlying docker Host&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the pipeline script which is the example taken from the documentation&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any thoughts ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;pipeline {
    agent {label 'alpine-dockercli'}
    stages{
        stage('createImage') {
            steps{
                sh 'echo "Creating Dockerfile..."'
                sh 'echo "FROM ubuntu:bionic" &amp;gt; Dockerfile'
                sh 'echo "ENV MYSQL_HOST=DB_Server" &amp;gt;&amp;gt; Dockerfile'
                sh 'echo "ENV MYSQL_PASSWORD=5TTnvuTDJJSq6" &amp;gt;&amp;gt; Dockerfile'
                sh 'echo "LABEL description=Test_Twistlock_Jenkins_Plugin" &amp;gt;&amp;gt; Dockerfile'
                sh '''docker -H=tcp://192.168.0.179:12375 build --no-cache -t dev/my-ubuntu:$BUILD_NUMBER .'''
                }
            }
        }
        stage('twistlockScan') {
            steps{
                prismaCloudScanImage ca: '', cert: '', dockerAddress: 'tcp://192.168.0.179:12375', ignoreImageBuildTime: true, image: 'dev/my-ubuntu:$BUILD_NUMBER', key: '', logLevel: 'debug', podmanPath: '', project: '', resultsFile: 'prisma-cloud-scan-results.json', sbom: ''
                input "stop"
            }
        }
        stage('twistlockPublish') {
            steps{
                prismaCloudPublish resultsFilePattern: 'prisma-cloud-scan-results.json'
            }
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 14:33:13 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/jenkins-prismacloudscanimage-function-result-file-not-found/m-p/599783#M1306</guid>
      <dc:creator>Julien-Potier</dc:creator>
      <dc:date>2024-10-08T14:33:13Z</dc:date>
    </item>
  </channel>
</rss>

