Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/secrets-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Secret Scanning (gitleaks)

on:
pull_request:
push:
branches:
- master
workflow_dispatch:

permissions:
contents: read
security-events: write

jobs:
gitleaks:
runs-on: ubuntu-latest
env:
GITLEAKS_SARIF_OUTPUT: gitleaks.sarif

steps:
- name: Check out repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Install gitleaks
run: bash ci/setup-tools.sh --install-tool gitleaks

- name: Install and run gitleaks
run: >
gitleaks dir .
--config ci/suppress_gitleaks.toml
--redact
--report-format sarif
--report-path "$GITLEAKS_SARIF_OUTPUT"

- name: Upload SARIF to code scanning
if: always()
uses: github/codeql-action/upload-sarif@c35d1b164463ee62a100735382aaaa525c5d3496 #v2.25.6
with:
sarif_file: ${{ env.GITLEAKS_SARIF_OUTPUT }}
category: gitleaks
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: .bumpversion.cfg
- id: check-merge-conflict
exclude: LICENSE
- id: check-added-large-files
- id: check-yaml
- id: check-json
- id: pretty-format-json
args: ["--autofix"]
exclude: slack.json
- id: check-xml
- id: detect-private-key
- id: check-case-conflict
- id: mixed-line-ending

- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.0
hooks:
- id: gitleaks
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Step 1: Build the Angular app
FROM node:22-alpine AS build
FROM node:22-alpine@sha256:c610fcdfb1d5b4740dd70c284ed3cb16bb857e0f7166196e36a5501df7a3aa32 AS build
WORKDIR /app

# Install dependencies with cache mount for npm cache
Expand Down Expand Up @@ -28,7 +28,7 @@ RUN --mount=type=cache,target=/app/.angular/cache \
npm run build -- --configuration ${BUILD_CONFIGURATION}

# Step 2: Use Nginx to serve the Angular app
FROM nginx:alpine-slim
FROM nginx:alpine-slim@sha256:45b82ed5f285b90d63df07ba70430fdd8f25624b416617d9e6dc93412b2006dc
RUN apk upgrade --no-cache \
&& apk add --no-cache gettext-envsubst
ENV PLATFORM_BACKEND_SERVER=platform-backend-service:8080 \
Expand All @@ -50,4 +50,4 @@ RUN chown -R nginx:nginx /usr/share/nginx/html /etc/nginx/conf.d /var/cache/ngin

USER nginx
EXPOSE 80
CMD ["/docker-entrypoint.sh"]
CMD ["/docker-entrypoint.sh"]
17 changes: 17 additions & 0 deletions ci/setup-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ SEMGREP_RULES_DIR="semgrep-rules"
HADOLINT_VERSION="${HADOLINT_VERSION:-v2.14.0}"
HADOLINT_SHA256="${HADOLINT_SHA256:-6bf226944684f56c84dd014e8b979d27425c0148f61b3bd99bcc6f39e9dc5a47}"

# renovate: datasource=github-release-attachments depName=gitleaks/gitleaks
GITLEAKS_VERSION="${GITLEAKS_VERSION:-v8.30.1}"
GITLEAKS_SHA256="${GITLEAKS_SHA256:-551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb}"

# renovate: datasource=npm depName=@cyclonedx/cyclonedx-npm
CYCLONEDX_NPM_VERSION="${CYCLONEDX_NPM_VERSION:-6.0.0}"

Expand Down Expand Up @@ -128,6 +132,19 @@ if should_install "hadolint"; then
echo "Hadolint installed OK"
fi

# --- Gitleaks -----------------------------------------------------------
if should_install "gitleaks"; then
echo "[setup-tools] Installing Gitleaks ${GITLEAKS_VERSION}"
GITLEAKS_TARBALL="gitleaks_${GITLEAKS_VERSION#v}_linux_x64.tar.gz"
download_and_verify \
"https://github.com/gitleaks/gitleaks/releases/download/${GITLEAKS_VERSION}/${GITLEAKS_TARBALL}" \
"${TMP_DIR}/${GITLEAKS_TARBALL}" \
"${GITLEAKS_SHA256}"
sudo tar -xzf "${TMP_DIR}/${GITLEAKS_TARBALL}" -C /usr/local/bin gitleaks
gitleaks version
echo "Gitleaks installed OK"
fi

# --- SBOM generation ----------------------------------------------------
case "$SBOM_ECOSYSTEM" in
maven)
Expand Down
6 changes: 6 additions & 0 deletions ci/suppress_gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# No allowlist needed currently.
# Add an [allowlist] section here if false positives need excluding later:
# [allowlist]
# paths = [
# '''test/fixtures/.*''',
# ]
Loading