Skip to content

Commit

Permalink
Workflows security updates (#1057) (#1835)
Browse files Browse the repository at this point in the history
Co-authored-by: Sourabh Mehta <[email protected]>
  • Loading branch information
spcaipers-arm and soumeh01 authored Oct 31, 2024
1 parent 2cd6fc0 commit 5c2025f
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 4 deletions.
51 changes: 47 additions & 4 deletions .github/workflows/buildmgr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ jobs:
fail-fast: true
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down Expand Up @@ -94,6 +100,12 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand All @@ -107,7 +119,6 @@ jobs:
wget -q http://security.ubuntu.com/ubuntu/pool/main//d/doxygen/doxygen_1.8.6-2_amd64.deb
sudo dpkg -i doxygen_1.8.6-2_amd64.deb
sudo pip install LinkChecker
- name: Create build folder
run: mkdir build

Expand Down Expand Up @@ -188,6 +199,12 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Install deps
run: |
sudo apt-get update
Expand Down Expand Up @@ -315,6 +332,12 @@ jobs:
#fail-fast: true
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Install macos deps
if: ${{ startsWith(matrix.runs_on, 'macos') }}
run: |
Expand Down Expand Up @@ -354,7 +377,6 @@ jobs:
run: |
test -f ${installer_name} || wget -q ${arm_gcc_install_base}/${installer_name}
tar -xvf ${installer_name}
- name: Setup ARM GCC for Windows
if: ${{ startsWith(matrix.runs_on, 'windows') }}
env:
Expand Down Expand Up @@ -469,6 +491,11 @@ jobs:
strategy:
fail-fast: true
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Install dependencies
run: |
sudo apt-get update
Expand Down Expand Up @@ -590,6 +617,12 @@ jobs:
fail-fast: true
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Download cbuild_install
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
Expand All @@ -609,12 +642,10 @@ jobs:
echo "$AC5_TOOLCHAIN_ROOT" >> config
echo "$GCC_TOOLCHAIN_ROOT" >> config
./cbuild_install.sh < config
- name: Test cbuildgen
shell: bash
run: |
${{ github.workspace }}/cbuild/bin/cbuildgen | grep "(cbuildgen): Build Process Manager"
sanity-check-docker:
needs: create_installer
timeout-minutes: 15
Expand All @@ -631,6 +662,12 @@ jobs:
matrix:
image: [ "debian:buster" ]
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Download cbuild_install
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
Expand Down Expand Up @@ -660,6 +697,12 @@ jobs:
needs: [ tests ]
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Event File
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/cpp-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,22 @@ concurrency:
env:
linter_report: "cppcheck_report.md"

permissions:
contents: read

jobs:

lint:
name: cppcheck
runs-on: ubuntu-22.04

steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/global.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@ on:
pull_request:
release:
types: [ published ]
permissions:
contents: read

jobs:
copyright:
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ jobs:
name: Lint markdown files
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: nightly

on:
Expand Down Expand Up @@ -33,6 +34,12 @@ jobs:
runs-on: ubuntu-22.04
needs: [ buildmgr, packchk, packgen, projmgr, svdconv, test_libs ]
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Install dependencies
run: |
sudo apt-get update
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/packchk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ jobs:
fail-fast: true
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down Expand Up @@ -100,6 +106,12 @@ jobs:
fail-fast: false
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down Expand Up @@ -164,6 +176,12 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Install dependencies
run: |
sudo apt-get update
Expand Down Expand Up @@ -302,6 +320,12 @@ jobs:
needs: [ test ]
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Event File
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/packgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ jobs:
fail-fast: true
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down Expand Up @@ -154,6 +160,12 @@ jobs:
fail-fast: true
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down Expand Up @@ -195,6 +207,12 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Install linux deps
run: |
sudo apt-get update
Expand Down Expand Up @@ -279,6 +297,12 @@ jobs:
needs: [ unittest ]
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Event File
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/projmgr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ jobs:
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}

steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down Expand Up @@ -91,6 +97,12 @@ jobs:
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}

steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout devtools
if: matrix.pyswig || matrix.goswig
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -299,6 +311,12 @@ jobs:
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}

steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout devtools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down Expand Up @@ -349,6 +367,12 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Install linux deps
run: |
sudo apt-get update
Expand Down Expand Up @@ -433,6 +457,12 @@ jobs:
needs: [ unittest ]
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Event File
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ jobs:
# actions: read

steps:
- name: Harden Runner
if: ${{ !github.event.repository.private }}
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: "Checkout code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down
Loading

0 comments on commit 5c2025f

Please sign in to comment.