-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[StepSecurity] Apply security best practices (#12783)
* [StepSecurity] Apply security best practices Signed-off-by: StepSecurity Bot <[email protected]> * Update codeql.yml Down with javascript * Delete .github/workflows/codeql.yml Because autobuild doesn't work --------- Signed-off-by: StepSecurity Bot <[email protected]> Co-authored-by: trilinos-autotester <[email protected]> Co-authored-by: Chris Siefert <[email protected]>
- Loading branch information
1 parent
2c85546
commit 9c80a45
Showing
11 changed files
with
145 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: daily | ||
|
||
- package-ecosystem: pip | ||
directory: /cmake/tribits/doc/sphinx | ||
schedule: | ||
interval: daily | ||
|
||
- package-ecosystem: pip | ||
directory: /packages/kokkos-kernels/docs | ||
schedule: | ||
interval: daily |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,14 @@ on: | |
- develop | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
trilogpu02-gcc: | ||
permissions: | ||
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows | ||
contents: read # for actions/checkout to fetch code | ||
runs-on: [self-hosted, trilogpu02] | ||
container: | ||
image: registry-ex.sandia.gov/trilinos-project/trilinos-containers/rhel8/trilinos-pr-env:gcc-8.5.0 | ||
|
@@ -29,7 +35,7 @@ jobs: | |
bash -l -c "module list" | ||
printenv PATH | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # 0.11.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
- name: make dirs | ||
|
@@ -38,7 +44,7 @@ jobs: | |
mkdir -p /home/Trilinos/src/Trilinos | ||
mkdir -p /home/Trilinos/build | ||
- name: Clone trilinos | ||
uses: actions/checkout@v4 | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 | ||
- name: Repo status | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: DoozyX/[email protected] | ||
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | ||
- uses: DoozyX/clang-format-lint-action@1566bcec081dcb246ab02e7c5f9786c0b629dd4d # v0.16.2 | ||
with: | ||
source: './packages/muelu ./packages/tempus ./packages/teko ./packages/xpetra' | ||
exclude: './packages/tempus/examples' | ||
|
@@ -18,7 +18,7 @@ jobs: | |
- run: git diff HEAD > format_patch.txt | ||
- run: if [ "$(cat format_patch.txt)" == "" ] ; then rm format_patch.txt ; else cat format_patch.txt; fi | ||
|
||
- uses: actions/upload-artifact@v4 | ||
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | ||
id: upload-artf | ||
if: ${{ hashFiles('format_patch.txt') != '' }} | ||
with: | ||
|
@@ -32,13 +32,13 @@ jobs: | |
# This does not work for PRs from forks. | ||
- name: Post artifact in issue comment | ||
uses: mshick/[email protected] | ||
uses: mshick/add-pr-comment@7c0890544fb33b0bdd2e59467fbacb62e028a096 # v2.8.1 | ||
if: ${{ (hashFiles('format_patch.txt') != '') && (github.event.pull_request.head.repo.full_name == github.repository) }} | ||
with: | ||
message: | | ||
Your PR updated files that did not respect package clang formatting settings. Please apply the patch found [here](${{ steps.upload-artf.outputs.artifact-url }}) | ||
- uses: actions/github-script@v3 | ||
- uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736 # v3.2.0 | ||
if: ${{ hashFiles('format_patch.txt') != '' }} | ||
with: | ||
script: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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@a56a03b370b87b26fde6d680755f818cfda0372b # v2.24.5 | ||
with: | ||
sarif_file: results.sarif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,13 +13,13 @@ permissions: | |
jobs: | ||
assign_one_project: | ||
permissions: | ||
issues: write # for actions/github-script@v6 | ||
issues: write # for actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 | ||
repository-projects: write # for srggrs/assign-one-project-github-action to assign issues and PRs to repo project | ||
name: Assign to MueLu or Tpetra Project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Add MueLu Label | ||
uses: actions/github-script@v6 | ||
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 | ||
if: contains(github.event.issue.title, 'MueLu') | ||
with: | ||
script: | | ||
|
@@ -30,7 +30,7 @@ jobs: | |
labels: ["pkg: MueLu"] | ||
}) | ||
- name: Add Tpetra Label | ||
uses: actions/github-script@v6 | ||
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 | ||
if: contains(github.event.issue.title, 'Tpetra') | ||
with: | ||
script: | | ||
|
@@ -41,13 +41,13 @@ jobs: | |
labels: ["pkg: Tpetra"] | ||
}) | ||
- name: Add to MueLu Project | ||
uses: srggrs/[email protected] | ||
uses: srggrs/assign-one-project-github-action@37de3321023f8c12ea85372d748ab2017b995bfd # 1.3.0 | ||
if: contains(github.event.label.name, 'MueLu') || contains(github.event.issue.title, 'MueLu') | ||
with: | ||
project: 'https://github.com/trilinos/Trilinos/projects/5' | ||
column_name: 'Backlog' | ||
- name: Add to Tpetra Project | ||
uses: srggrs/[email protected] | ||
uses: srggrs/assign-one-project-github-action@37de3321023f8c12ea85372d748ab2017b995bfd # 1.3.0 | ||
if: contains(github.event.label.name, 'Tpetra') || contains(github.event.issue.title, 'Tpetra') | ||
with: | ||
project: 'https://github.com/trilinos/Trilinos/projects/2' | ||
|