Configure security scanning
Enable a built-in container scanner on a Docker or Helm registry, attach a policy set to quarantine violations, and validate Cargo metadata.
Harness Artifacts supports automatic security scanning on push for container registries and metadata validation for select package registries. Scanning happens at ingest time; every artifact is evaluated as it enters the registry.
What you will learn from this topic
Enable a container scanner (Aqua Trivy or Grype) on a Docker or Helm registry
Attach a policy set to quarantine artifacts that fail a security check
Enable metadata validation on a Cargo registry
Before you begin
Container scanning requires the Harness Supply Chain Security module. Contact your account administrator to confirm the module is enabled.
Your role must include Create/Edit permission on the registry. Go to RBAC and permissions for details.
Enable container scanning (Docker and Helm)
Container scanning is available for Docker and Helm OCI registries. When enabled, Harness creates a scan pipeline that runs automatically every time an artifact is pushed.
In the left navigation, select Registries.
Click the Docker or Helm registry you want to configure.
Select the Configuration tab.
In the Security section, click the edit icon to open the Security drawer.
Select the scanner you want to use:
ScannerBest forAqua Trivy
Broad OS and library vulnerability coverage
Grype
Fast, SBOM-aware scanning
Save the setting.
Scanning begins on the next push to the registry. Scan results appear on each artifact's version details page in the Vulnerabilities tab.
Attach a policy set
A policy set defines rules that evaluate scan results and take action, for example, quarantine any image with a Critical severity finding.
Policy sets attached to a registry must be of type Security Tests. Go to Dependency Firewall overview to understand how policy sets are configured.
To attach a policy set to a registry:
In the registry's Configuration tab, open the Security edit drawer.
Under Policy sets, click Add policy set and select the policy set from the list.
Save the setting.
You can attach multiple policy sets for layered enforcement.
What happens when an artifact fails a policy
When an artifact violates a policy with an Error and exit action, Harness quarantines it automatically. Quarantined artifacts cannot be pulled or downloaded until the quarantine is removed. Go to Quarantine to review and release quarantined artifacts.
Enable metadata validation (Cargo)
For Cargo registries, Harness can validate crate metadata on publish, checking that required fields are present and correctly formatted.
Open the Cargo registry.
Select the Configuration tab.
In the Security section, open the edit drawer.
Enable Metadata validation.
Save the setting.
When enabled, a publish request that contains invalid crate metadata is rejected with an error message identifying the missing or malformed field.
Troubleshooting
Next steps
Vulnerability scanning: view and triage CVE findings
Quarantine: manage quarantined artifacts
Last updated
Was this helpful?