Skip to content

Commit 03f6bee

Browse files
Add container scanning docs (#2640)
1 parent 2314448 commit 03f6bee

6 files changed

Lines changed: 110 additions & 0 deletions
70.3 KB
Loading
80.8 KB
Loading
61.8 KB
Loading
154 KB
Loading
80.7 KB
Loading

docs/organizations/managing-security-and-risk.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,3 +678,113 @@ Additionaly, you can click on a configured target to expand all of that target's
678678
![DAST target results](images/security-risk-management-app-scanning-see-results.png)
679679

680680
Follow our [roadmap](https://roadmap.codacy.com) for updates on this feature.
681+
682+
## Container scanning {: id="container-scanning"}
683+
684+
Container Scanning is a technique to scan your container image's dependencies for known vulnerabilities. The **Security and risk management > Container scanning** page allows you to set up scans that run automatically every night, and surface actionable security findings as new vulnerabilities get discovered.
685+
686+
### How our container image scanning Works
687+
688+
The security tool analyzes your uploaded SBOM (Software Bill of Materials) files to find vulnerabilities in your container images. An SBOM of a container lists all the dependencies included in the image, which in turn allows the scanner to search for known vulnerabilities (CVEs).
689+
690+
#### High-level flow
691+
692+
1. Image SBOMs are received either via CI/CD integration or manual upload
693+
2. The image dependencies are scanned against Trivy's vulnerability databases
694+
3. Results appear in the UI after processing
695+
696+
#### Scan frequency
697+
698+
1. Proactive scans run automatically once per day
699+
2. Scans are executed every night (UTC) and the findings are updated automatically
700+
701+
No manual action is required to trigger scans after the initial setup.
702+
703+
### Container scanning setup
704+
705+
You can set up container scanning in one of two ways: by connecting your CI/CD pipeline or by manually uploading your image SBOM. Once configured, your image dependencies are scanned daily and results will appear in the Image card list.
706+
707+
#### CI/CD integration
708+
You must authenticate the Codacy CLI so your pipeline can securely send your image SBOM to Codacy.
709+
710+
![Security and risk management import container SBOM in CICD](images/security-risk-management-container-upload-cicd.png)
711+
712+
In order to do that, you need to:
713+
714+
1. Get the API token and set up the environment variable as shown in the UI;
715+
2. Install and run Codacy CLI in your pipeline to upload results.
716+
717+
When CI/CD is configured:
718+
719+
- Images pushed through your pipeline are automatically detected
720+
- New tags are picked up as they are published
721+
- Scans are scheduled automatically
722+
723+
This is the recommended setup for continuous coverage.
724+
725+
#### Manual upload
726+
You can also manually upload your container's Software Bill of Materials (SBOM) in CycloneDX or SPDX format.
727+
728+
![Security and risk management manually import container SBOM](images/security-risk-management-container-upload-manually.png)
729+
730+
To manually upload an image SBOM, you need to:
731+
732+
1. Add the image name;
733+
2. Add the image tag;
734+
3. Upload your SBOM file (environment and repository fields are optional).
735+
736+
!!! note
737+
You can use the [Codacy CLI v2](https://github.com/codacy/codacy-cli-v2) to generate and upload your SBOM file to Codacy.
738+
739+
740+
741+
### Image card list
742+
743+
The Image card list provides an overview of all container images and the most recent tag pushed for each image.
744+
745+
![Security and risk management container images](images/security-risk-management-container-image-card-list.png)
746+
747+
For each image, you can see:
748+
749+
- Image name
750+
- The most recent tag pushed for this image
751+
- Options and entry point to check all image tags.
752+
753+
By clicking the card for a specific image, you will see a list of all tags for that image.
754+
755+
![Security and risk management container image tags](images/security-risk-management-container-tag-list.png)
756+
757+
For the image tags, the list is sorted by latest uploaded, and the information includes:
758+
759+
- Tag used
760+
- Environment (optional field)
761+
- Last analysis: Date of the last scan for that tag
762+
- Button to delete that image tag
763+
764+
Once a tag is scanned, you can click on the `check findings` link to access the findings page filtered by the respective results.
765+
766+
!!! important
767+
Findings are tied to specific image tags. To resolve a finding, "bump" the tag to a newer version if a fixed version exists (if not, a downgrade or an alternative image may be required).
768+
For dynamic tags such as `latest`, Codacy will automatically close findings that are no longer present in the current analysis. If you use static tags, you will need to delete tags that are no longer used, as we have a limit of 1000 tags per organization.
769+
770+
### Deleting container image files from Codacy
771+
772+
![Security and risk management delete container SBOM](images/security-risk-management-container-delete-image.png)
773+
774+
What happens when you delete an image:
775+
776+
- The image is permanently removed
777+
- All associated image tags are deleted
778+
- Scan history and results for that image are removed
779+
780+
!!! important
781+
This action cannot be undone.
782+
You can also delete a specific tag inside an image card.
783+
784+
### No results yet
785+
786+
If there is no last analysis date for an image tag, it means that the SBOM file was received but the scan has not been completed yet. The most likely scenario is that an analysis hasn't been executed yet.
787+
788+
!!! note
789+
Remember that scans run nightly (UTC). If you just uploaded the SBOM file, but need results immediately, consider using our [Codacy CLI v2](https://github.com/codacy/codacy-cli-v2) to run a local analysis to scan for any issues.
790+

0 commit comments

Comments
 (0)