GitHub Action to build, scan and push Docker images. This is a thin wrapper around docker-build-push GitHub action.
This action does the following:
- Builds the docker image (with push set to
false). - Scans the built docker image for secrets with Trufflehog.
- GitHub action fails if secrets are found in the docker image
- Pushes the docker image to a docker repository if no secrets are found
(when push is set to
true).
Replace docker/build-push-action@vX with rudderlabs/[email protected]
in your GitHub Workflows.
For more info, refer the documentation of docker-build-push GitHub Action.
By default TruffleHog doesn't support excluding file paths when
scanning docker images. In our GitHub Action, we have added support
to exclude paths using a .truffleignore file.
Create a .truffleignore file at the root of your repository. Add paths
that you want to exclude in gitignore-style pattern
format. All paths that match these patterns are excluded in TruffleHog scans.
The action also ignores a built-in list of paths for OS package databases and
vendored binaries (see default.truffleignore). These defaults always apply and
are merged with your .truffleignore.
This GitHub Action only accepts the following inputs.
build-argscache-fromcache-tocontextfilelabelsloadplatformsprovenancepushsbomsecret-envssecretstagstarget
If you want to use an input which is not in the above mentioned list, feel free to contribute or reach out to infra team for support.
We have added support to exclude paths in v1.4 where we relied on
a common truffleignore file in this repository to filter findings.
We no longer do that in versions >=v1.5.x and instead rely on repo
specific .truffleignore file at the root of your repository.
If you were using truffleignore to exclude paths, you need to move
your paths to .truffleignore file at the root of your repository.
All your paths should follow gitignore pattern format
If you are not using exclude paths feature, you don't have to do anything.