Skip to content

Commit

Permalink
chore(ci): enforce top-level permission to minimum fail-safe permissi…
Browse files Browse the repository at this point in the history
…on as per openssf (#2638)
  • Loading branch information
step-security-bot authored Jul 4, 2023
1 parent b2e43b3 commit cdd28fe
Show file tree
Hide file tree
Showing 20 changed files with 79 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on:
branches:
- develop

permissions:
contents: read

jobs:
changelog:
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on:
branches:
- develop

permissions:
contents: read

jobs:
analyze:
name: Analyze
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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: 'Checkout Repository'
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: 'Dependency Review'
uses: actions/dependency-review-action@0efb1d1d84fc9633afcdaad14c485cbbc90ef46c # v2.5.1
3 changes: 3 additions & 0 deletions .github/workflows/label_pr_on_title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ on:
types:
- completed

permissions:
contents: read

jobs:
get_pr_details:
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/on_closed_issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ name: Closed Issue Message
on:
issues:
types: [closed]
permissions:
contents: read

jobs:
auto_comment:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/on_label_added.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ on:
types:
- completed

permissions:
contents: read

jobs:
get_pr_details:
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/on_merged_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ on:
types:
- completed

permissions:
contents: read

jobs:
get_pr_details:
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/on_opened_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ on:
types:
- completed

permissions:
contents: read

jobs:
get_pr_details:
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/on_push_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
- "examples/**"
- "CHANGELOG.md"

permissions:
contents: read

jobs:
release-docs:
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish_v2_layer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ on:
type: boolean
required: false

permissions:
contents: read

jobs:
build-layer:
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/quality_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ on:
branches:
- develop

permissions:
contents: read

jobs:
quality_check:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/rebuild_latest_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ on:
default: "2.16.3"
required: true

permissions:
contents: read

jobs:
release-docs:
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/record_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ on:
pull_request:
types: [opened, edited, closed, labeled]

permissions:
contents: read

jobs:
record_pr:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ on:
- develop
workflow_dispatch:

permissions:
contents: read

jobs:
update_release_draft:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ on:
type: boolean
required: false

permissions:
contents: read

jobs:

# This job bumps the package version to the release version
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/reusable_deploy_v2_layer_stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ on:
required: true
type: string

permissions:
contents: read

jobs:
deploy-cdk-stack:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/reusable_export_pr_details.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ on:
description: "Whether PR is merged"
value: ${{ jobs.export_pr_details.outputs.prIsMerged }}

permissions:
contents: read

jobs:
export_pr_details:
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/reusable_publish_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ env:
PULL_REQUEST_TITLE: "chore(ci): changelog rebuild"
FILES_TO_COMMIT: "CHANGELOG.md"

permissions:
contents: read

jobs:
publish_changelog:
# Force Github action to run only a single job at a time (based on the group name)
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ env:

concurrency: e2e

permissions:
contents: read

jobs:
run:
runs-on: aws-powertools_ubuntu-latest_8-core
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/secure_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ on:
paths:
- ".github/workflows/**"

permissions:
contents: read

jobs:
enforce_pinned_workflows:
name: Harden Security
Expand Down

0 comments on commit cdd28fe

Please sign in to comment.