Skip to content

Commit

Permalink
add permissions to workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jgadsden authored Mar 5, 2024
2 parents 9903d1a + 8ad263d commit 6223384
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/housekeeping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
trivy:
name: Scan with trivy
runs-on: ubuntu-22.04
permissions:
contents: write
security-events: write

steps:
- name: Checkout repository
Expand All @@ -56,6 +59,8 @@ jobs:
codeql:
name: Analyze with codeql
runs-on: ubuntu-22.04
permissions:
security-events: write

strategy:
fail-fast: false
Expand Down Expand Up @@ -84,6 +89,7 @@ jobs:
link_checker:
name: Link checker
runs-on: ubuntu-22.04

steps:
- name: Checkout markdown
uses: actions/[email protected]
Expand All @@ -98,10 +104,14 @@ jobs:
stale:
name: Tidy pull requests
runs-on: ubuntu-22.04
permissions:
pull-requests: write

steps:
- name: Close stale PRs
uses: actions/stale@v9
with:
days-before-issue-stale: -1
stale-pr-message: 'This PR is stale because it has been open 21 days with no activity. Remove stale label, or add a comment, otherwise it will be closed in 7 days.'
close-pr-message: 'This PR was closed because it has been stalled for 28 days with no activity.'
days-before-pr-stale: 21
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,12 @@ jobs:
if: ${{ always() }}

scan_image_with_trivy:
name: Site trivy scan
name: Scan with trivy
runs-on: ubuntu-22.04
needs: [build_docker_image]
permissions:
contents: write

steps:
# Need .trivyignore
- name: Checkout
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
link_checker:
name: Link checker
runs-on: ubuntu-22.04

steps:
- name: Checkout markdown
uses: actions/[email protected]
Expand All @@ -30,6 +31,7 @@ jobs:
md_linter:
name: Lint markdown
runs-on: ubuntu-22.04

steps:
- name: Checkout markdown
uses: actions/[email protected]
Expand All @@ -44,6 +46,8 @@ jobs:
codeql:
name: Analyze with codeql
runs-on: ubuntu-22.04
permissions:
security-events: write

strategy:
fail-fast: false
Expand Down Expand Up @@ -73,6 +77,7 @@ jobs:
defaults:
run:
working-directory: td.server

steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -105,6 +110,7 @@ jobs:
defaults:
run:
working-directory: td.vue

steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -137,6 +143,7 @@ jobs:
defaults:
run:
working-directory: td.vue

steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -170,6 +177,7 @@ jobs:
defaults:
run:
working-directory: td.vue

steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -209,6 +217,7 @@ jobs:
runs-on: ubuntu-22.04
needs: [site_unit_tests, server_unit_tests]
if: github.repository == 'OWASP/threat-dragon'

steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -249,6 +258,7 @@ jobs:
name: Upload to Heroku
runs-on: ubuntu-22.04
needs: [build_docker_image]

steps:
- name: Pull docker image
run: docker pull ${{ env.IMAGE_NAME }}
Expand Down Expand Up @@ -278,6 +288,7 @@ jobs:
defaults:
run:
working-directory: td.vue

steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -322,6 +333,7 @@ jobs:
defaults:
run:
working-directory: td.vue

steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -372,6 +384,7 @@ jobs:
defaults:
run:
working-directory: td.vue

steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -419,6 +432,7 @@ jobs:
name: Site zap scan
runs-on: ubuntu-22.04
needs: [build_docker_image]

steps:
- name: Run Threat Dragon
run: |
Expand Down Expand Up @@ -463,9 +477,12 @@ jobs:
if: ${{ always() }}

scan_image_with_trivy:
name: Site trivy scan
name: Scan with trivy
runs-on: ubuntu-22.04
needs: [build_docker_image]
permissions:
contents: write

steps:
# Need .trivyignore
- name: Checkout
Expand All @@ -482,6 +499,7 @@ jobs:
name: SBOM web application
runs-on: ubuntu-22.04
needs: [e2e_smokes]

steps:
- name: Check out
uses: actions/[email protected]
Expand Down Expand Up @@ -542,6 +560,7 @@ jobs:
defaults:
run:
working-directory: td.vue

steps:
- name: Check out
uses: actions/[email protected]
Expand Down Expand Up @@ -584,6 +603,7 @@ jobs:
defaults:
run:
working-directory: td.vue

steps:
- name: Check out
uses: actions/[email protected]
Expand Down Expand Up @@ -636,6 +656,7 @@ jobs:
defaults:
run:
working-directory: td.vue

steps:
- name: Check out
uses: actions/[email protected]
Expand Down Expand Up @@ -673,6 +694,7 @@ jobs:
defaults:
run:
working-directory: td.vue

steps:
- name: Check out
uses: actions/[email protected]
Expand Down

0 comments on commit 6223384

Please sign in to comment.