Jenkins Maven project
Table of Contents
Prisma Cloud Enterprise Edition
Expand all | Collapse all
-
- Getting started
- System Requirements
- Cluster Context
-
- Defender Types
- Manage your Defenders
- Redeploy Defenders
- Uninstall Defenders
-
- Deploy Orchestrator Defenders on Amazon ECS
- Automatically Install Container Defender in a Cluster
- Deploy Prisma Cloud Defender from the GCP Marketplace
- Deploy Defenders as DaemonSets
- VMware Tanzu Application Service (TAS) Defender
- Deploy Defender on Google Kubernetes Engine (GKE)
- Google Kubernetes Engine (GKE) Autopilot
- Deploy Defender on OpenShift v4
- Deploy Defender with Declarative Object Management
-
- Agentless Scanning Modes
-
- Onboard AWS Accounts for Agentless Scanning
- Configure Agentless Scanning for AWS
- Onboard Azure Accounts for Agentless Scanning
- Configure Agentless Scanning for Azure
- Onboard GCP Accounts for Agentless Scanning
- Configure Agentless Scanning for GCP
- Onboard Oracle Cloud Infrastructure (OCI) Accounts for Agentless Scanning
- Configure Agentless Scanning for Oracle Cloud Infrastructure (OCI)
- Agentless Scanning Results
-
- Rule ordering and pattern matching
- Backup and Restore
- Custom feeds
- Configuring Prisma Cloud proxy settings
- Prisma Cloud Compute certificates
- Configure scanning
- User certificate validity period
- Enable HTTP access to Console
- Set different paths for Defender and Console (with DaemonSets)
- Authenticate to Console with Certificates
- Customize terminal output
- Collections
- Tags
- WildFire Settings
- Log Scrubbing
- Permissions by feature
-
- Prisma Cloud Vulnerability Feed
- Scanning Procedure
- Vulnerability Management Policies
- Vulnerability Scan Reports
- Scan Images for Custom Vulnerabilities
- Base images
- Vulnerability Explorer
- CVSS scoring
- CVE Viewer
-
- Configure Registry Scans
- Scan Images in Alibaba Cloud Container Registry
- Scan Images in Amazon Elastic Container Registry (ECR)
- Scan images in Azure Container Registry (ACR)
- Scan Images in Docker Registry v2 (including Docker Hub)
- Scan Images in GitLab Container Registry
- Scan images in Google Artifact Registry
- Scan Images in Google Container Registry (GCR)
- Scan Images in Harbor Registry
- Scan Images in IBM Cloud Container Registry
- Scan Images in JFrog Artifactory Docker Registry
- Scan Images in Sonatype Nexus Registry
- Scan images in OpenShift integrated Docker registry
- Scan Images in CoreOS Quay Registry
- Trigger Registry Scans with Webhooks
- Configure VM image scanning
- Configure code repository scanning
- Malware scanning
- Windows container image scanning
- Serverless Functions Scanning
- VMware Tanzu Blobstore Scanning
- Scan App-Embedded workloads
- Troubleshoot Vulnerability Detection
-
- Compliance Explorer
- Enforce compliance checks
- CIS Benchmarks
- Prisma Cloud Labs compliance checks
- Malware Scanning
- Serverless functions compliance checks
- Windows compliance checks
- DISA STIG compliance checks
- Custom compliance checks
- Trusted images
- Host scanning
- VM image scanning
- App-Embedded scanning
- Detect secrets
- OSS license management
-
- Alert Mechanism
- AWS Security Hub
- Cortex XDR alerts
- Cortex XSOAR alerts
- Email alerts
- Google Cloud Pub/Sub
- Google Cloud Security Command Center
- IBM Cloud Security Advisor
- JIRA Alerts
- PagerDuty alerts
- ServiceNow alerts for Security Incident Response
- ServiceNow alerts for Vulnerability Response
- Slack Alerts
- Splunk Alerts
- Webhook alerts
- API
Jenkins Maven project
Create a Maven project that builds a Docker image and then scans it for vulnerability and compliance issues.
Configuring Maven
Configure Maven.
- Go to the Jenkins top page.
- Click Manage Jenkins.
- Select Global Tool Configuration.
- Scroll down to the Maven section (Not Maven Configuration), and click Add Maven.
Setting up a Maven project for container images
Set up a Jenkins Maven project.
- Go to the Jenkins top page.
- Create a new project.
- ClickNew Item.
- InItemname, enter a name for your project.
- SelectMaven project.
- ClickOK.
- Add a build step.
- Scroll down to thePre stepssection.
- In theAdd pre-build stepdrop-down list, selectExecute shell.
- In theCommandtext box, enter the following:echo "Creating Dockerfile..." echo "FROM imiell/bad-dockerfile:latest" > Dockerfile echo 'docker build --no-cache -t test/test-image:0.1 .' > build_image.sh chmod +x build_image.sh echo "Creating POM file..." cat > pom.xml << EOF <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>groupId</groupId> <artifactId>artifactid</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>projectName</name> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <build> <plugins> <plugin> <artifactId>exec-maven-plugin</artifactId> <groupId>org.codehaus.mojo</groupId> <executions> <execution> <id>Build Image</id> <phase>generate-sources</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>build_image.sh</executable> </configuration> </execution> </executions> </plugin> </plugins> </build> </project> EOF
- Add a build step that scans the container image(s) for vulnerabilities.
- In theAdd build stepdrop-down list, selectScan Prisma Cloud Images.
- In theImagefield, select the image to scan by specifying the repository and tag.Use pattern matching expressions. For example, enter test/test-image*.If the image you want to scan is created outside of this build, or if you want to scan the image every build, even if the build might not generate an new image, then clickAdvanced, and selectIgnore image creation time.
- Add a post-build action so that image scan results in Jenkins directly.This post-build step depends on a file generated by the previous scan build step, which holds the scan results. This step specifically makes the results available for review in the Jenkins build tool. Note that the previous scan step already published the results in Console, and they’re ready to be reviewed there.
- Scroll down toPost-build Actions.
- In theAdd post-build actiondrop-down menu, selectPublish Prisma Cloud analysis results.
- In theScan Result Filesfield, accept the default.Scan result files aren’t deleted by the publish step. They stay in the workspace.
- ClickSave.
- ClickBuild Now.
- After the build completes, examine the results. Scan reports are available in the following locations:
- Prisma Cloud Console: Log into Console, and go toMonitor > Vulnerabilities > Images > CI.
- Jenkins: Drill down into the build job, then clickImage Vulnerabilitiesto see a detailed report.
Setting up a Maven project for serverless functions
The procedure for setting up Jenkins to scan serverless functions is similar to the procedure for container images, except you should use the
Scan Prisma Cloud Functions
build step.
Where:
- Function Path— Path to the ZIP archive of the function to scan.
- Function Name— (Optional) String identifier for matching policy rules in Console with the functions being scanned. When creating policy rules in Console, you can target specific rules to specific functions by function name. If this field is left unspecified, the plugin matches the function to the first rule where the function name is a wildcard.
- AWS CloudFormation template file— (Optional) Path to CloudFormation template file in either JSON or YAML format. Prisma Cloud scans the function source code for AWS service APIs being used, compares the APIs being used to the function permissions, and reports when functions have permissions for APIs they don’t need.
After a build completes, you can view the scan reports in the following locations:
- Prisma Cloud Console: Log into Console, and go toMonitor > Vulnerabilities > Functions > CI.
- Jenkins: Drill down into the build job, then clickVulnerabilitiesto see a detailed report.