Skip to content

Commit 72e5ffe

Browse files
authored
Included new engine Jenkins details (#33)
1 parent 4623141 commit 72e5ffe

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
stages {
2+
stage('Checkout') {
3+
steps {
4+
checkout scm
5+
}
6+
}
7+
stage('Build Image') {
8+
steps {
9+
sh "docker build -f Dockerfile -t ${params.DOCKER_REPOSITORY} ."
10+
}
11+
}
12+
stage('Scanning Image') {
13+
steps {
14+
sysdigImageScan engineCredentialsId: 'sysdig-secure-api-credentials', imageName: "${params.DOCKER_REPOSITORY}"
15+
}
16+
}
17+
}
File renamed without changes.

jenkins/new-scan-engine/README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1-
# Build and scan example
1+
# Jenkins image scanning
22

3-
This [example pipeline](Jenkinsfile) shows how to download and execute the new inline scanner to scan an image.
3+
There are two different approaches if using Jenkins to scan container images for vulnerabilities with Sysdig Secure:
4+
5+
* Using the `sysdig-cli-scanner` binary
6+
* Using the Sysdig Secure Jenkins Plugin
7+
8+
## Using sysdig-cli-scanner
9+
10+
This [example pipeline](Jenkinsfile-sysdig-cli-scanner) shows how to download and execute the new inline scanner to scan an image.
11+
12+
It requires to configure a Jenkins credential `sysdig-secure-api-credentials` to store the Sysdig Token (as password)
13+
14+
![Screenshot of Jenkins UI](https://github.com/jenkinsci/sysdig-secure-plugin/raw/main/docs/images/SysdigTokenConfiguration.png)
15+
16+
Then the scan is performed by downloading the `sysdig-cli-scanner` tool against the `mongo-express:0.54.0` example image.
17+
18+
For a more elaborated example, see the [GitHub](../../github/new-scan-engine/README.md) example.
19+
20+
## Sysdig Secure Jenkins plugin
21+
22+
The [Sysdig Secure Jenkins plugin](https://plugins.jenkins.io/sysdig-secure/) can be used in a Pipeline job, or added as a build step to a Freestyle job to automate the process of running an image analysis, evaluating custom policies against images, and performing security scans.
23+
24+
See more information at the plugin page: https://plugins.jenkins.io/sysdig-secure/
25+
26+
The [example pipeline](Jenkinsfile-jenkins-plugin) shows how to use it to build and scan a container image.
27+
28+
## Prerequisites
29+
30+
Both approaches require a couple of things:
31+
32+
* A valid Sysdig Secure API token
33+
* Have access to the image storage, either to the local storage where the image was created or to the registry where it is stored.

0 commit comments

Comments
 (0)