eschercloudai/Build, Scan and Sign image using Trivy and Cosign

Generates a Docker image locally which will then be SBOM'd and scanned. The SBOM will be scanned and then the image will be scanned to ensure as clean an image as possible.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stalelast commit Dec 1, 2023
License
Apache 2.0

Pinned Snippet

workflow.ymlSHA-pinned
uses: eschercloudai/container-security-action@21804e23d8da6793f7a592d074edf10d271ec08f # v0.0.4

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
use-dockerhubSet to true to use dockerhub.no
image-repoThe repo to push the image to.yes
repo-usernameThe username to log into the repo.yes
repo-passwordThe password to log into the repo.yes
image-nameThe name of the image to build.yes
add-latest-tagAdds the latest tag to the build.nofalse
image-tagThe tag to build the image with - provide a matrix to build against multiple tags as each will need to be SBOM'd, scanned and signed independently.yes
cosign-private-keyA private key with which to sign the image using cosign.yes
cosign-passwordThe password to unlock the private key.yes
cosign-tlogSet to true to upload to tlog for transparency.nofalse
publish-imageIf true the image will be published to the repo.nofalse
check-severityA comma deliminated (uppercase) list of severities to check for. If found the pipeline will fail. Support values: UNKNOWN,LOW,MEDIUM,HIGH,CRITICALnohigh
sbom-fail-on-detectionMust be 0 to succeed or any other number to fail if a severity is discovered at the `check-severity` level. This will be used as the exit code for the Trivy SBOM scan and 1 is recommended to differentiate it from the scan exit code.no1
scan-fail-on-detectionMust be 0 to succeed or any other number to fail if a severity is discovered at the `check-severity` level. This will be used as the exit code for the Trivy scan and 2 is recommended to differentiate it from the SBOM exit code.no2
trivyignore-fileSupply a Trivy ignore file to ignore specific CVEs and prevent a pipeline failure.notrivyignore
trivyignore-from-s3If disabled, the trivyignore can be supplied via the repo itself but actions/checkout@v4 must be used before calling this action.nofalse
aws-endpointIf the endpoint isn't a standard AWS one, pass it in here.nohttps://some-s3-endpoint.com
aws-regionThe AWS Region.nous-east-1
aws-access-keyThe S3 access key.no""
aws-secret-keyThe S3 secret key.no""
s3-bucketThe S3 bucket in which the trivyignore file is stored.notrivy
s3-pathThe path in the s3 bucket to the trivyignore file.notrivyignore
dockerfile-pathPath to the Dockerfile (default {context}/Dockerfile).no.
fail-buildFail the build if the CVE severity level is found.nofalse

no outputs