[StepSecurity] Apply security best practices (#3725)

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
Signed-off-by: Dong Ho <dong@vexxhost.com>
Signed-off-by: Dong Ma <dong.ma@vexxhost.com>
Co-authored-by: stepsecurity-app[bot] <188008098+stepsecurity-app[bot]@users.noreply.github.com>
Co-authored-by: Dong Ma <dong.ma@vexxhost.com>
This commit is contained in:
stepsecurity-app[bot]andDong Ma authored and GitHub committed 2026-03-12 21:04:25 -04:00
1 parent a58717479e
commit e359dc13ec
11 files changed
+106 -19

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ inputs:
runs:
using: composite
steps:
- uses: astral-sh/setup-uv@v5
- uses: step-security/setup-uv@ccf0a26ce9117d9e99292b0ce953ea5d9ffe778e # v7.3.0
- shell: bash
run: uvx reno report --output CHANGELOG.rst
+1 -1
View File
@@ -31,7 +31,7 @@ runs:
sudo mkdir -p /var/lib/etcd
sudo mount -t tmpfs -o nodev,nosuid,size=512M tmpfs /var/lib/etcd
- uses: astral-sh/setup-uv@v6
- uses: step-security/setup-uv@ccf0a26ce9117d9e99292b0ce953ea5d9ffe778e # v7.3.0
- shell: bash
run: |
+6 -1
View File
@@ -25,7 +25,12 @@ jobs:
startsWith(github.event.comment.body, '/backport')
)
steps:
- uses: actions/checkout@v4
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
token: ${{ secrets.VEXXHOST_BOT_PAT }}
- uses: korthout/backport-action@436145e922f9561fc5ea157ff406f21af2d6b363 # v3.2.0
+32 -2
View File
@@ -18,12 +18,22 @@ jobs:
chart-vendor:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: vexxhost/chart-vendor@3c91cecf08feb55ab66586b91b1a116b6cf0dbd9 # main
go-test:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
@@ -38,9 +48,14 @@ jobs:
vale:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- run: sudo apt-get install -y docutils
- uses: errata-ai/vale-action@v2.1.1
- uses: errata-ai/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1
with:
files: doc,releasenotes
separator: ","
@@ -49,6 +64,11 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
@@ -60,6 +80,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
@@ -72,6 +97,11 @@ jobs:
group: ${{ github.job }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/molecule
with:
+14 -4
View File
@@ -22,16 +22,21 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- name: Checkout project
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Install Earthly
uses: earthly/actions-setup@v1
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3
uses: step-security/docker-login-action@c3e677aae8393bc9c81cfdf9709648720ea4bd4d # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
@@ -50,15 +55,20 @@ jobs:
needs:
- build
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- name: Login to GitHub Container Registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3
uses: step-security/docker-login-action@c3e677aae8393bc9c81cfdf9709648720ea4bd4d # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Promote image
uses: akhilerm/tag-push-action@f35ff2cb99d407368b5c727adbcc14a2ed81d509 # v2.2.0
uses: step-security/tag-push-action@3816dac78b3f61b986acdf67bd01277d10f42a7c # v2.2.0
with:
src: ghcr.io/vexxhost/atmosphere:${{ github.sha }}
dst: ghcr.io/vexxhost/atmosphere:${{ github.event.release.tag_name }}
+9 -4
View File
@@ -31,8 +31,13 @@ jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- name: Checkout project
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0
@@ -43,7 +48,7 @@ jobs:
- name: Cache DIB_IMAGE_CACHE
id: cache-dib-image-cache
uses: actions/cache/restore@v4
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.cache/image-create
key: dib-image-cache
@@ -53,14 +58,14 @@ jobs:
- name: Save DIB_IMAGE_CACHE
id: dib-image-cache-save
uses: actions/cache/save@v4
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.cache/image-create
key: ${{ steps.cache-dib-image-cache.outputs.cache-primary-key }}
- name: Install uv
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'release'
uses: astral-sh/setup-uv@v5
uses: step-security/setup-uv@ccf0a26ce9117d9e99292b0ce953ea5d9ffe778e # v7.3.0
- name: Publish image
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'release'
+9 -1
View File
@@ -10,6 +10,9 @@ on:
concurrency:
group: docs
permissions:
contents: read
jobs:
pages:
runs-on: ubuntu-latest
@@ -20,12 +23,17 @@ jobs:
pages: write
id-token: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
ref: main
fetch-depth: 0
- id: deployment
uses: sphinx-notes/pages@v3
uses: sphinx-notes/pages@e9c8f79f285fb41a150ba6e08a3c2a29635e7ee1 # v3
with:
documentation_path: doc/source
requirements_path: doc/requirements.txt
+8 -3
View File
@@ -17,12 +17,17 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'skip-release-notes')"
steps:
- uses: actions/checkout@v4
- uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: step-security/changed-files@60967b822d3001fa82242f8d6b4ed46bc3600a68 # v47.0.1
id: changed-files
with:
dir_names: true
- uses: actions/github-script@v6
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
if: "!contains(steps.changed-files.outputs.added_files, 'releasenotes/notes')"
with:
script: |
+5
View File
@@ -10,6 +10,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
+2 -2
View File
@@ -1,4 +1,4 @@
FROM golang:1.22.2 as build
FROM golang:1.22.2@sha256:d5302d40dc5fbbf38ec472d1848a9d2391a13f93293a6a5b0b87c99dc0eaa6ae as build
# build via Makefile target helm-test-image in root
# Makefile. Building from this directory will not be
@@ -7,7 +7,7 @@ COPY . /src/loki
WORKDIR /src/loki
RUN make clean && make BUILD_IN_CONTAINER=false helm-test
FROM alpine:3.18.5
FROM alpine:3.18.5@sha256:34871e7290500828b39e22294660bee86d966bc0017544e848dd9a255cdf59e0
RUN apk add --update --no-cache ca-certificates=20230506-r0
COPY --from=build /src/loki/production/helm/loki/src/helm-test/helm-test /usr/bin/helm-test
ENTRYPOINT [ "/usr/bin/helm-test" ]
@@ -0,0 +1,19 @@
diff --git a/loki/src/helm-test/Dockerfile b/loki/src/helm-test/Dockerfile
index 48ff7e8a..645a828d 100644
--- a/loki/src/helm-test/Dockerfile
+++ b/loki/src/helm-test/Dockerfile
@@ -1,4 +1,4 @@
-FROM golang:1.22.2 as build
+FROM golang:1.22.2@sha256:d5302d40dc5fbbf38ec472d1848a9d2391a13f93293a6a5b0b87c99dc0eaa6ae as build
# build via Makefile target helm-test-image in root
# Makefile. Building from this directory will not be
@@ -7,7 +7,7 @@ COPY . /src/loki
WORKDIR /src/loki
RUN make clean && make BUILD_IN_CONTAINER=false helm-test
-FROM alpine:3.18.5
+FROM alpine:3.18.5@sha256:34871e7290500828b39e22294660bee86d966bc0017544e848dd9a255cdf59e0
RUN apk add --update --no-cache ca-certificates=20230506-r0
COPY --from=build /src/loki/production/helm/loki/src/helm-test/helm-test /usr/bin/helm-test
ENTRYPOINT [ "/usr/bin/helm-test" ]