chore(deps): Update sscheib/ansible-role-file_deployment-jekyll to v24.12.13 #1302
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: 'Trivy' | |
on: # yamllint disable-line rule:truthy | |
schedule: | |
- cron: '43 17 * * 4' | |
pull_request: | |
branches: | |
- 'main' | |
push: | |
branches: | |
- 'main' | |
workflow_dispatch: {} | |
permissions: 'read-all' | |
env: | |
# gitleaks image to use to check files prior to uploading them to prevent sensitive data being leaked | |
# yamllint disable rule:line-length | |
# renovate image dep: | |
gitleaks-image: 'ghcr.io/gitleaks/gitleaks:v8.21.2@sha256:0e99e8821643ea5b235718642b93bb32486af9c8162c8b8731f7cbdc951a7f46' | |
# yamllint enable rule:line-length | |
jobs: | |
analysis: | |
name: 'Trivy' | |
runs-on: 'ubuntu-24.04' | |
permissions: | |
security-events: 'write' | |
steps: | |
- name: 'Harden Runner' | |
uses: 'step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f' # v2.10.2 | |
with: | |
disable-sudo: true | |
egress-policy: 'block' | |
allowed-endpoints: > | |
*.cloudfront.net | |
api.github.com:443 | |
ghcr.io:443 | |
github.com:443 | |
objects.githubusercontent.com:443 | |
pkg-containers.githubusercontent.com:443 | |
public.ecr.aws:443 | |
- name: 'Checkout the repository' | |
uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # v4.2.2 | |
with: | |
persist-credentials: false | |
- name: 'Scan repository with Trivy' | |
uses: 'aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0' # 0.29.0 | |
env: | |
TRIVY_DB_REPOSITORY: 'public.ecr.aws/aquasecurity/trivy-db' | |
TRIVY_JAVA_DB_REPOSITORY: 'public.ecr.aws/aquasecurity/trivy-java-db' | |
TRIVY_CHECKS_BUNDLE_REPOSITORY: 'public.ecr.aws/aquasecurity/trivy-checks' | |
with: | |
scan-type: 'fs' | |
format: 'sarif' | |
output: 'trivy-results.sarif' | |
trivy-config: 'trivy.yaml' | |
- name: 'Scan trivy-results.sarif to ensure it contains no secrets' | |
shell: 'bash' | |
run: | | |
# fail if: | |
# - a variable is unbound | |
# - any command fails | |
# - a command in a pipe fails | |
# - a command in a sub-shell fails | |
set -Eeuo pipefail | |
# enable debug if runner runs in debug | |
[[ "${{ runner.debug }}" -ne 1 ]] || { | |
echo "INFO: Enabling bash trace"; | |
set -x; | |
}; | |
docker run -v ./trivy-results.sarif:/scan "${{ env.gitleaks-image }}" detect --source "/scan" --no-git || { | |
echo "ERROR: Secret found, failing workflow"; | |
exit 1; | |
}; | |
- name: 'Upload artifact' | |
uses: 'actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882' # v4.4.3 | |
with: | |
name: 'Trivy SARIF file' | |
path: 'trivy-results.sarif' | |
retention-days: 5 | |
- name: 'Upload to code-scanning' | |
uses: 'github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae' # v3.27.9 | |
with: | |
sarif_file: 'trivy-results.sarif' | |
... |