From 44efb0f7216edba95af829667084ffd2dacb1a8d Mon Sep 17 00:00:00 2001 From: StepSecurity Bot Date: Tue, 27 Oct 2026 07:55:25 +0000 Subject: [PATCH] [StepSecurity] Apply security best practices Signed-off-by: StepSecurity Bot --- .github/workflows/integrity-check.yml | 6 ++--- .../workflows/validate-community-plugins.yml | 25 +++++++++++++++---- .pre-commit-config.yaml | 14 +++++++++++ 3 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/integrity-check.yml b/.github/workflows/integrity-check.yml index 64241c3..7de9cfe 100644 --- a/.github/workflows/integrity-check.yml +++ b/.github/workflows/integrity-check.yml @@ -23,19 +23,19 @@ jobs: uses: step-security/harden-runner@ccd8616d44fd3846e67624a50d5aad6d37bf2d25 # v2.22.1 with: egress-policy: audit - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install package manager (from package.json) run: | corepack enable corepack install - - uses: actions/setup-node@v7 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: '24' - name: Resolve yarn cache folder id: yarn-config run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" - name: Restore yarn install cache (node_modules + cacheFolder + install-state) - uses: actions/cache@v6 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ${{ steps.yarn-config.outputs.cacheFolder }} diff --git a/.github/workflows/validate-community-plugins.yml b/.github/workflows/validate-community-plugins.yml index 94e280b..41c7288 100644 --- a/.github/workflows/validate-community-plugins.yml +++ b/.github/workflows/validate-community-plugins.yml @@ -23,11 +23,16 @@ jobs: matrix: ${{ steps.parse.outputs.matrix }} plugin_count: ${{ steps.parse.outputs.count }} steps: - - uses: actions/checkout@v7 + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@v2 + with: + egress-policy: audit + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Parse plugin registry id: parse - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const fs = require('fs'); @@ -73,7 +78,12 @@ jobs: fail-fast: false matrix: ${{ fromJson(needs.load-plugins.outputs.matrix) }} steps: - - uses: actions/checkout@v7 + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@v2 + with: + egress-policy: audit + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Create test project run: | @@ -142,10 +152,15 @@ jobs: if: always() runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@v2 + with: + egress-policy: audit + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Generate summary - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | const { data: run } = await github.rest.actions.listJobsForWorkflowRun({ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..44487bc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,14 @@ +repos: +- repo: https://github.com/gitleaks/gitleaks + rev: v8.30.1 + hooks: + - id: gitleaks +- repo: https://github.com/pre-commit/mirrors-eslint + rev: v10.8.0 + hooks: + - id: eslint +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace