Jenkins - PrismaCloudScanImage function - 'result' file not found

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Jenkins - PrismaCloudScanImage function - 'result' file not found

L1 Bithead

Hi Everyone

 

I'm trialling scanning of container images with Prisma Cloud.  I'm finding myself stuck where the result of the scan cannot be found and the workflow fails.  THis happens during the PrismaCloudScanImage function rather than the later PrismaCloudPublish one.  The error message is as follow:

 

[PrismaCloud_DemoBuild] $ /home/jenkins/workspace/PrismaCloud_DemoBuild/twistcli18328331056399694186 images scan --docker-address tcp://192.168.0.179:12375 --ci --publish --details --address https://europe-west9.cloud.twistlock.com/france-607222237 --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 

 

A bit about the docker setup (This is a lab environment i have no concerns about security)

 

  • Jenkins is running in a container
  • The docker build agent 'alpine-dockercli' is dynamically created  upon running the pipeline. The Connect method is SSH. 
  • The docker build agent is based on alpine:latest and has SSHD, Java and Docker CLI installed
  •  
  • Jenkins makes an API call to a SOCAT container (192.168.0.179:12375) which exposes the REST API of the underlying docker Host 

 

Below is the pipeline script which is the example taken from the documentation

 

Any thoughts ?

 

 

 

pipeline {
    agent {label 'alpine-dockercli'}
    stages{
        stage('createImage') {
            steps{
                sh 'echo "Creating Dockerfile..."'
                sh 'echo "FROM ubuntu:bionic" > Dockerfile'
                sh 'echo "ENV MYSQL_HOST=DB_Server" >> Dockerfile'
                sh 'echo "ENV MYSQL_PASSWORD=5TTnvuTDJJSq6" >> Dockerfile'
                sh 'echo "LABEL description=Test_Twistlock_Jenkins_Plugin" >> 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'
            }
        }
    }
}

 

 

 

 

 

 

 

 

0 REPLIES 0
  • 286 Views
  • 0 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!