mirror of
https://github.com/safedep/vet.git
synced 2025-12-10 12:07:30 -06:00
ci/harden github actions (#412)
* ci: Pin github actions to its commit SHA * ci: Pin github actions to its commit SHA * chore: Pin docker base images * fix: Typo in vet-ci
This commit is contained in:
parent
35b0021569
commit
05e6fbebfd
13
.cursor/mcp.json
Normal file
13
.cursor/mcp.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"pinner-mcp-stdio-server": {
|
||||||
|
"command": "docker",
|
||||||
|
"args": [
|
||||||
|
"run",
|
||||||
|
"--rm",
|
||||||
|
"-i",
|
||||||
|
"ghcr.io/safedep/pinner-mcp:latest"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
@ -13,10 +13,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Source
|
- name: Checkout Source
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
|
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.24
|
go-version: 1.24
|
||||||
check-latest: true
|
check-latest: true
|
||||||
@ -38,10 +38,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Source
|
- name: Checkout Source
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
|
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.24
|
go-version: 1.24
|
||||||
check-latest: true
|
check-latest: true
|
||||||
@ -73,13 +73,13 @@ jobs:
|
|||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Source
|
- name: Checkout Source
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
|
|
||||||
- name: Setup QEMU
|
- name: Setup QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
|
||||||
|
|
||||||
- name: Build Container Image
|
- name: Build Container Image
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
6
.github/workflows/codeql.yml
vendored
6
.github/workflows/codeql.yml
vendored
@ -39,7 +39,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
|
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
|
||||||
@ -48,7 +48,7 @@ jobs:
|
|||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
@ -63,6 +63,6 @@ jobs:
|
|||||||
go build
|
go build
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2
|
||||||
with:
|
with:
|
||||||
category: "/language:${{matrix.language}}"
|
category: "/language:${{matrix.language}}"
|
||||||
|
|||||||
8
.github/workflows/container.yml
vendored
8
.github/workflows/container.yml
vendored
@ -27,23 +27,23 @@ jobs:
|
|||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Registry Login
|
- name: Registry Login
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Setup QEMU
|
- name: Setup QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55
|
||||||
|
|
||||||
- name: Build and Push Container Image
|
- name: Build and Push Container Image
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
4
.github/workflows/dependency-review.yml
vendored
4
.github/workflows/dependency-review.yml
vendored
@ -16,6 +16,6 @@ jobs:
|
|||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Repository'
|
- name: 'Checkout Repository'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
|
||||||
- name: 'Dependency Review'
|
- name: 'Dependency Review'
|
||||||
uses: actions/dependency-review-action@v3
|
uses: actions/dependency-review-action@cc4f6536e38d1126c5e3b0683d469a14f23bfea4 # v3
|
||||||
|
|||||||
4
.github/workflows/golangci-lint.yml
vendored
4
.github/workflows/golangci-lint.yml
vendored
@ -16,9 +16,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: 1.24
|
go-version: 1.24
|
||||||
cache: false
|
cache: false
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
|
||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: --issues-exit-code=1 --timeout=10m
|
args: --issues-exit-code=1 --timeout=10m
|
||||||
|
|||||||
4
.github/workflows/goreleaser.yml
vendored
4
.github/workflows/goreleaser.yml
vendored
@ -56,7 +56,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Cache for OSX Cross Compiler Tool Chain
|
- name: Setup Cache for OSX Cross Compiler Tool Chain
|
||||||
id: osxcross-cache
|
id: osxcross-cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3
|
||||||
with:
|
with:
|
||||||
key: ${{ runner.os }}-osxcross-${{ env.OSX_CROSS_MACOS_SDK_VERSION }}
|
key: ${{ runner.os }}-osxcross-${{ env.OSX_CROSS_MACOS_SDK_VERSION }}
|
||||||
path: |
|
path: |
|
||||||
@ -94,7 +94,7 @@ jobs:
|
|||||||
actions: read # To read the workflow path.
|
actions: read # To read the workflow path.
|
||||||
id-token: write # To sign the provenance.
|
id-token: write # To sign the provenance.
|
||||||
contents: write # To add assets to a release.
|
contents: write # To add assets to a release.
|
||||||
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@f7dd8c54c2067bafc12ca7a55595d5ee9b75204a # v2.1.0
|
||||||
with:
|
with:
|
||||||
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}"
|
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}"
|
||||||
upload-assets: true
|
upload-assets: true
|
||||||
|
|||||||
4
.github/workflows/secret_scan.yml
vendored
4
.github/workflows/secret_scan.yml
vendored
@ -13,11 +13,11 @@ jobs:
|
|||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Source
|
- name: Checkout Source
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5
|
||||||
with:
|
with:
|
||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
- name: TruffleHog OSS
|
- name: TruffleHog OSS
|
||||||
uses: trufflesecurity/trufflehog@main
|
uses: trufflesecurity/trufflehog@8b6f55b592e46ac44a42dc3e3dee0ebcc0f56df5
|
||||||
with:
|
with:
|
||||||
path: ./
|
path: ./
|
||||||
base: main
|
base: main
|
||||||
|
|||||||
6
.github/workflows/vet-ci.yml
vendored
6
.github/workflows/vet-ci.yml
vendored
@ -20,9 +20,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
id: checkout
|
id: checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
|
||||||
- name: Enable Cloud Cloud
|
- name: Enable Cloud Mode
|
||||||
run: echo "SAFEDEP_CLOUD_MODE=true" >> $GITHUB_ENV
|
run: echo "SAFEDEP_CLOUD_MODE=true" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Override Cloud Mode if Actor is Dependabot
|
- name: Override Cloud Mode if Actor is Dependabot
|
||||||
@ -34,7 +34,7 @@ jobs:
|
|||||||
run: echo "SAFEDEP_CLOUD_MODE=false" >> $GITHUB_ENV
|
run: echo "SAFEDEP_CLOUD_MODE=false" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Run vet
|
- name: Run vet
|
||||||
uses: safedep/vet-action@v1
|
uses: safedep/vet-action@01f547ee95dfd4f8f11fa64b399e5e00f22b0801
|
||||||
with:
|
with:
|
||||||
policy: .github/vet/policy.yml
|
policy: .github/vet/policy.yml
|
||||||
cloud: ${{ env.SAFEDEP_CLOUD_MODE }}
|
cloud: ${{ env.SAFEDEP_CLOUD_MODE }}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
FROM --platform=$BUILDPLATFORM golang:1.24-bullseye AS build
|
FROM --platform=$BUILDPLATFORM golang:1.24-bullseye@sha256:3c669c8fed069d80d199073b806243c4bf79ad117b797b96f18177ad9c521cff AS build
|
||||||
|
# Original: golang:1.24-bullseye
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
@ -12,7 +13,8 @@ ENV CGO_ENABLED=1
|
|||||||
|
|
||||||
RUN make quick-vet
|
RUN make quick-vet
|
||||||
|
|
||||||
FROM debian:bullseye-slim
|
FROM debian:11-slim@sha256:e4b93db6aad977a95aa103917f3de8a2b16ead91cf255c3ccdb300c5d20f3015
|
||||||
|
# Original: debian:11-slim
|
||||||
|
|
||||||
# Create nonroot user and group with specific IDs
|
# Create nonroot user and group with specific IDs
|
||||||
RUN groupadd -r nonroot --gid=65532 && \
|
RUN groupadd -r nonroot --gid=65532 && \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user