From 981bf80d5d862c981309012035a3bcabca2ee640 Mon Sep 17 00:00:00 2001 From: StepSecurity Bot Date: Fri, 26 Apr 2024 13:30:10 +0000 Subject: [PATCH 1/5] [StepSecurity] Apply security best practices Signed-off-by: StepSecurity Bot --- .github/dependabot.yml | 45 +++++++++++++++++ .github/workflows/cacert-publish.yml | 5 ++ .github/workflows/codeql.yml | 73 ++++++++++++++++++++++++++++ .github/workflows/linuxTriage.yml | 2 +- .github/workflows/scorecards.yml | 71 +++++++++++++++++++++++++++ .github/workflows/wix.yml | 3 ++ 6 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/scorecards.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index eeda7f145..5c5c8b3fe 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,3 +10,48 @@ updates: schedule: interval: "daily" open-pull-requests-limit: 10 + +- package-ecosystem: docker + directory: /linux/ca-certificates/debian/src/main/packaging + schedule: + interval: daily + +- package-ecosystem: docker + directory: /linux/jdk/alpine/src/main/packaging + schedule: + interval: daily + +- package-ecosystem: docker + directory: /linux/jdk/debian/src/main/packaging + schedule: + interval: daily + +- package-ecosystem: docker + directory: /linux/jdk/redhat/src/main/packaging + schedule: + interval: daily + +- package-ecosystem: docker + directory: /linux/jdk/suse/src/main/packaging + schedule: + interval: daily + +- package-ecosystem: docker + directory: /linux/jre/alpine/src/main/packaging + schedule: + interval: daily + +- package-ecosystem: docker + directory: /linux/jre/debian/src/main/packaging + schedule: + interval: daily + +- package-ecosystem: docker + directory: /linux/jre/redhat/src/main/packaging + schedule: + interval: daily + +- package-ecosystem: docker + directory: /linux/jre/suse/src/main/packaging + schedule: + interval: daily diff --git a/.github/workflows/cacert-publish.yml b/.github/workflows/cacert-publish.yml index 71b1add0d..c0182d02f 100644 --- a/.github/workflows/cacert-publish.yml +++ b/.github/workflows/cacert-publish.yml @@ -19,6 +19,11 @@ jobs: working-directory: ./linux steps: + - name: Harden Runner + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + with: + egress-policy: audit + - name: Checkout uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..dc242326b --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,73 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: ["master"] + pull_request: + # The branches below must be a subset of the branches above + branches: ["master"] + schedule: + - cron: "0 0 * * 1" + +permissions: + contents: read + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ["java"] + # CodeQL supports [ $supported-codeql-languages ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/linuxTriage.yml b/.github/workflows/linuxTriage.yml index 387093121..80d150d64 100644 --- a/.github/workflows/linuxTriage.yml +++ b/.github/workflows/linuxTriage.yml @@ -8,7 +8,7 @@ jobs: report: runs-on: ubuntu-latest steps: - - uses: dorny/test-reporter@v1 + - uses: dorny/test-reporter@e1a31eb7a0c78439a9eb245286815dfb7f24c132 # v1 with: artifact: test-results # artifact name name: JUnit Test Report # Name of the check run which will be created diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml new file mode 100644 index 000000000..75ca49424 --- /dev/null +++ b/.github/workflows/scorecards.yml @@ -0,0 +1,71 @@ +# This workflow uses actions that are not certified by GitHub. They are provided +# by a third-party and are governed by separate terms of service, privacy +# policy, and support documentation. + +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '20 7 * * 2' + push: + branches: ["master"] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + contents: read + actions: read + + steps: + - name: "Checkout code" + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # v2.0.6 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecards on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + publish_results: true + + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # format to the repository Actions tab. + - name: "Upload artifact" + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard. + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 + with: + sarif_file: results.sarif diff --git a/.github/workflows/wix.yml b/.github/workflows/wix.yml index 24558f57a..d1ad4716c 100644 --- a/.github/workflows/wix.yml +++ b/.github/workflows/wix.yml @@ -6,6 +6,9 @@ on: paths: - .github/workflows/wix.yml - wix/** +permissions: + contents: read + jobs: wix: strategy: From 256b9a537c1b38695635478a225ece64f3bdf5a7 Mon Sep 17 00:00:00 2001 From: George Adams Date: Fri, 26 Apr 2024 14:31:38 +0100 Subject: [PATCH 2/5] Update linuxTriage.yml --- .github/workflows/linuxTriage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linuxTriage.yml b/.github/workflows/linuxTriage.yml index 80d150d64..333a68170 100644 --- a/.github/workflows/linuxTriage.yml +++ b/.github/workflows/linuxTriage.yml @@ -8,7 +8,7 @@ jobs: report: runs-on: ubuntu-latest steps: - - uses: dorny/test-reporter@e1a31eb7a0c78439a9eb245286815dfb7f24c132 # v1 + - uses: dorny/test-reporter@c40d89d5e987cd80f3a32b3c233556e22bdca958 # v1.9.0 with: artifact: test-results # artifact name name: JUnit Test Report # Name of the check run which will be created From 784a80c1d54be22b4ec12c49dd88e416c41a7ba6 Mon Sep 17 00:00:00 2001 From: George Adams Date: Fri, 26 Apr 2024 14:33:49 +0100 Subject: [PATCH 3/5] Delete .github/workflows/codeql.yml --- .github/workflows/codeql.yml | 73 ------------------------------------ 1 file changed, 73 deletions(-) delete mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index dc242326b..000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,73 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: ["master"] - pull_request: - # The branches below must be a subset of the branches above - branches: ["master"] - schedule: - - cron: "0 0 * * 1" - -permissions: - contents: read - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: ["java"] - # CodeQL supports [ $supported-codeql-languages ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 - with: - category: "/language:${{matrix.language}}" From 42ce67db63c1b45095581f98637d33bfeeebd51d Mon Sep 17 00:00:00 2001 From: George Adams Date: Fri, 26 Apr 2024 14:35:07 +0100 Subject: [PATCH 4/5] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 38a223e85..a5d10f54f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Adoptium Installers +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/adoptium/adoptium.net/badge)](https://api.securityscorecards.dev/projects/github.com/adoptium/adoptium.net) + Repository for creating installable packages for Eclipse Adoptium based releases. The packages are created using: From bedca9feac1c14c758571fc362fea237ecd426a0 Mon Sep 17 00:00:00 2001 From: George Adams Date: Fri, 26 Apr 2024 14:39:48 +0100 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5d10f54f..a667ddc0a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Adoptium Installers -[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/adoptium/adoptium.net/badge)](https://api.securityscorecards.dev/projects/github.com/adoptium/adoptium.net) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/adoptium/installer/badge)](https://api.securityscorecards.dev/projects/github.com/adoptium/installer) Repository for creating installable packages for Eclipse Adoptium based releases.