Skip to content

Commit

Permalink
Merge pull request #572 from DependencyTrack/add-strict-token-permiss…
Browse files Browse the repository at this point in the history
…ions

Add strict token permissions in GH workflows and update image to Java 21 JRE
  • Loading branch information
nscuro authored Feb 13, 2024
2 parents 4e413d9 + ad32352 commit 9498b4e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/_meta-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
registry-0-psw:
required: true

permissions: { }

jobs:
build-java:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -56,6 +58,8 @@ jobs:
build-container:
runs-on: ubuntu-latest
permissions:
security-events: write # Required to upload trivy's SARIF output
needs:
- build-java
steps:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ on:
- 'docs/**'
workflow_dispatch:

permissions: { }

jobs:
call-build:
uses: ./.github/workflows/_meta-build.yaml
with:
app-version: "snapshot"
publish-container: ${{ github.ref == 'refs/heads/main' }}
permissions:
security-events: write # Required to upload trivy's SARIF output
secrets:
registry-0-usr: ${{ github.repository_owner }}
registry-0-psw: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/ci-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- released
workflow_dispatch:

permissions: { }

jobs:
read-version:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -36,6 +38,8 @@ jobs:
with:
app-version: ${{ needs.read-version.outputs.version }}
publish-container: true
permissions:
security-events: write # Required to upload trivy's SARIF output
secrets:
registry-0-usr: ${{ github.repository_owner }}
registry-0-psw: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
description: 'Use this to overwrite the version number to release, otherwise uses the current SNAPSHOT version (expected format x.y.z)'
type: string

permissions: { }

jobs:
prepare-release:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions: { }

jobs:
test:
runs-on: ubuntu-latest
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Dependency Review
on:
pull_request:

permissions:
contents: read
permissions: { }

jobs:
dependency-review:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ on:
schedule:
- cron: '0 10 * * *'

permissions:
issues: write
pull-requests: write
permissions: { }

jobs:
action:
runs-on: ubuntu-latest
permissions:
issues: write # Required to lock issues
pull-requests: write # Required to lock PRs
# don't run on forks
if: ${{ contains(github.repository, 'DependencyTrack/') }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17.0.8.1_1-jre-focal@sha256:bed33979fe79ff4448686ca4074b43b87a8ea26f80cb3d6a9873634c4098ddfb AS jre-build
FROM eclipse-temurin:21_35-jre-jammy@sha256:82685ae01f788128caf3e0085e4fde21b9d1815dbbd3263082804d1de26f309c AS jre-build

FROM debian:stable-slim@sha256:4255c9f8a4d6e66488adc0c2084c99df44bda22849b21b3afc0e9746e9a0be18

Expand Down

0 comments on commit 9498b4e

Please sign in to comment.