From 8681ee12cf16b3d7f40942312cd3efba9a815fb4 Mon Sep 17 00:00:00 2001 From: StepSecurity Bot Date: Thu, 9 Jan 2025 13:48:35 +0000 Subject: [PATCH] [StepSecurity] Apply security best practices Signed-off-by: StepSecurity Bot --- .github/dependabot.yml | 20 ++++++++++++++++++++ .github/workflows/bump-winget.yml | 3 +++ .github/workflows/codeql.yml | 11 +++++++---- .github/workflows/gh-pages.yml | 14 +++++++------- .github/workflows/stale.yml | 5 ++++- 5 files changed, 41 insertions(+), 12 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ac6621f1..5026a433 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,23 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + + - package-ecosystem: gomod + directory: /docs + schedule: + interval: daily + + - package-ecosystem: npm + directory: /docs + schedule: + interval: daily + + - package-ecosystem: gomod + directory: / + schedule: + interval: daily diff --git a/.github/workflows/bump-winget.yml b/.github/workflows/bump-winget.yml index e2a9fde7..ad17f090 100644 --- a/.github/workflows/bump-winget.yml +++ b/.github/workflows/bump-winget.yml @@ -9,6 +9,9 @@ on: repository_dispatch: types: [ bump-winget ] +permissions: + contents: read + jobs: winget-bump: name: Bump azqr winget diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ecbe46fb..227a654b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,6 +20,9 @@ on: schedule: - cron: '42 9 * * 0' +permissions: + contents: read + jobs: analyze: name: Analyze @@ -40,11 +43,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@673cceb2b4886e2dfff697ab64a1ecd1c0a14a05 # v2.28.0 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -58,7 +61,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@673cceb2b4886e2dfff697ab64a1ecd1c0a14a05 # v2.28.0 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -71,6 +74,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@673cceb2b4886e2dfff697ab64a1ecd1c0a14a05 # v2.28.0 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 8db8ffb5..13a27a7f 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -37,12 +37,12 @@ jobs: GOVER: '1.21' steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 with: submodules: recursive - name: Set up Go ${{ env.GOVER }} - uses: actions/setup-go@v4 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: go-version: ${{ env.GOVER }} @@ -55,12 +55,12 @@ jobs: { echo -n '\'; go run ./cmd/main.go types; } > ./docs/static/types.txt - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2 with: node-version: '18' - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@8492260343ad570701412c2f464a5877dc76bace # v2 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} @@ -74,7 +74,7 @@ jobs: - name: Setup Pages id: pages - uses: actions/configure-pages@v1 + uses: actions/configure-pages@9a141972ca62e4def3a31137a5a086ba5c58572a # v1.2.1 - name: Build with Hugo run: | @@ -86,7 +86,7 @@ jobs: working-directory: ./docs - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@84bb4cd4b733d5c320c9c9cfbc354937524f4d64 # v1.0.10 with: path: ./docs/public @@ -100,4 +100,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 \ No newline at end of file + uses: actions/deploy-pages@f27bcc15848fdcdcc02f01754eb838e44bcf389b # v1.2.9 \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 9fce1390..8e1af0fc 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -3,13 +3,16 @@ on: schedule: - cron: '30 1 * * *' +permissions: + contents: read + jobs: stale: runs-on: ubuntu-latest permissions: issues: write steps: - - uses: actions/stale@v8 + - uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8.0.0 with: stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' days-before-stale: 30