Skip to content

Commit

Permalink
[StepSecurity] Apply security best practices
Browse files Browse the repository at this point in the history
Signed-off-by: StepSecurity Bot <[email protected]>
  • Loading branch information
step-security-bot committed Apr 16, 2024
1 parent e48be80 commit 3379534
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/auto_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ on:
schedule:
- cron: '10 10 15 * *'

permissions:
contents: read

jobs:
precommit-update:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -42,6 +50,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3
with:
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ env:
BUILD_DIR: Dist
GCOVR_FLAGS: --gcov-ignore-parse-errors --exclude-throw-branches --filter Common --filter Pcap --filter Packet --xml

permissions:
contents: read

jobs:
pre-commit:
runs-on: ubuntu-latest
container: seladb/alpine317
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -72,6 +80,11 @@ jobs:
config-zstd: OFF

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -144,6 +157,11 @@ jobs:
additional-flags: -DPCAPPP_USE_DPDK_KNI=ON

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -189,6 +207,11 @@ jobs:
- configure: cmake -DPCAPPP_USE_PF_RING=ON -DPF_RING_ROOT="/PF_RING" -S . -B "$BUILD_DIR"

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -237,6 +260,11 @@ jobs:
config-zstd: ON

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -312,6 +340,11 @@ jobs:
os-version: [macos-14]

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -389,6 +422,11 @@ jobs:
sys: mingw64

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -481,6 +519,11 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -568,6 +611,11 @@ jobs:
runs-on: ${{ matrix.run-on-os }}

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -616,6 +664,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -659,6 +712,11 @@ jobs:
container:
image: gcr.io/oss-fuzz-base/base-builder
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- uses: actions/checkout@v4
- name: Install prerequisites
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/check_dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- uses: actions/checkout@v3
- uses: marocchino/validate-dependabot@v2
id: validate
8 changes: 8 additions & 0 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
pull_request:
branches: ["dev"]

permissions:
contents: read

jobs:
Fuzzing:
runs-on: ubuntu-latest
Expand All @@ -11,6 +14,11 @@ jobs:
matrix:
sanitizer: [address, undefined, memory]
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
schedule:
- cron: '15 14 * * 1'

permissions:
contents: read

jobs:
analyze:
name: Analyze
Expand All @@ -21,6 +24,11 @@ jobs:
language: [ 'cpp' ]

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@v3

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request,
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
# Once installed, if the workflow run is marked as required,
# PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: 'Dependency Review'
uses: actions/dependency-review-action@0efb1d1d84fc9633afcdaad14c485cbbc90ef46c # v2.5.1
35 changes: 35 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ jobs:
config-zstd: OFF

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -78,6 +83,11 @@ jobs:
- freebsd-version: "13.2"
- freebsd-version: "14.0"
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -111,6 +121,11 @@ jobs:
arch: [x86_64, arm64]

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "${{ matrix.xcode-version }}"
Expand Down Expand Up @@ -148,6 +163,11 @@ jobs:
sys: mingw64

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -207,6 +227,11 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -254,6 +279,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -299,6 +329,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- uses: actions/download-artifact@v4
with:
pattern: android-package-*
Expand Down
Loading

0 comments on commit 3379534

Please sign in to comment.