CI/CD Image Security Scan Overview
The CI/CD image security scan function of HSS can be integrated into the CI/CD build pipeline of the Jenkins Pipeline project. It can implement security scan in the image build phase; identify system vulnerabilities, application vulnerabilities, abnormal system configurations, malicious files, and sensitive files in images; and shift security left to the DevOps phase, helping you eliminate security risks as early as possible and preventing unsafe images from being deployed in the production environment.
What Is CI/CD?
CI/CD is short for continuous integration and continuous delivery/deployment.
- Continuous Integration (CI) automatically and continuously integrates code into shared source code.
- CD consists of continuous delivery and continuous deployment. After continuous integration, continuous delivery verifies the code through automated building and testing to ensure that container images can be delivered at any time. Continuous deployment automatically updates and releases the images to the production environment.
What Is Jenkins Pipeline?
Jenkins is an open source CI tool that provides user-friendly GUIs. It originates from Hudson and is used to automate all sorts of tasks related to building, testing, and delivering or deploying software.
Jenkins is written in Java and can run in popular servlet containers such as Tomcat, or run independently. It is usually used together with the version control tools (or SCM tools) and build tools. Jenkins supports project building in diverse languages and is fully compatible with multiple third-party build tools, such as Maven, Ant, and Gradle. Jenkins is seamlessly integrated with common versioning tools, such as SVN and GIT, and can directly connect to source code hosting websites, such as GitHub.
Pipeline is a working mode that implements CI/CD in Jenkins.
CI/CD Image Security Scan Principles
To use the CI/CD image security scan function of HSS, you do not need to synchronize your image assets to HSS. You simply need to add two commands to the Jenkins pipeline (the command for pulling the image of the HSS image security scan tool and the command for starting the tool). When you use Jenkins Pipeline to build a project, an image security scan task is triggered to scan for image security risks in the project and display the scan results on the HSS console. You can handle security risks in images in a timely manner based on the scan results.
Figure 1 shows the image security scan phase in the Jenkins pipeline.
CI/CD Image Security Scan Items
Table 1 describes the CI/CD image security scan items checked by HSS.
Item |
Description |
---|---|
Vulnerabilities |
Detects system and application vulnerabilities in images.
|
Malicious Files |
Detects malicious files in images. |
Software Information |
Collects software information in an image. |
File Information |
Collects file information in an image. |
Unsafe Settings |
|
Sensitive Information |
Detects files that contain sensitive information in images.
|
Software Compliance |
Detects software and tools that are not allowed to be used. |
Base Images |
Detects service images that are not created using base images. |
Scenario
- Scanning a local image
After an image is built, a security scan is performed on it. If the image has security risks, the pipeline can be blocked, so that it will not be pushed to the production image repository.
- Scanning a remote image repository
A remote image repository is a remote test repository pushed after an image is built. A security scan is performed on the image in the remote test repository. If no risks are found, the image can be pushed to the production image repository. If risks are found, the pipeline can be blocked.
Constraints and Limitations
- Only the HSS container edition supports CI/CD image security scans.
- The CI/CD image scan function applies only to the Jenkins Pipeline mode.
Jenkins configuration restrictions are as follows:
- Hardware restrictions:
- Jenkins compilation and building server: Linux server, x86 or Arm 64-bit
- CPU: 1 or more cores
- Memory: 2 GB or more
- Disk space: 60 GB or higher
- Technical restrictions:
- Jenkins version: Jenkins 2.x
- JDK version: JDK 17 or later
- Docker version: Docker 18.09 or later
- Hardware restrictions:
- To perform a remote image scan, the image repository must support interaction through Docker Registry HTTP API v2.
CI/CD Image Security Scan Process
Operation |
Description |
---|---|
Generate an image security scan command for Pipeline based on image information and add the command to the Jenkins pipeline. |
|
View the CI/CD image security scan results. Check and eliminate security risks in a timely manner to prevent insecure images from being deployed in the production environment. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot