Skip to content

Commit dc188b7

Browse files
authored
Merge branch 'actions:main' into fortify-updates
2 parents 4dcbeda + ac9c407 commit dc188b7

32 files changed

+349
-88
lines changed

CODEOWNERS

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
* @actions/actions-workflow-development-reviewers
1+
* @actions/actions-workflow-development-reviewers @actions/starter-workflows
22

3-
/code-scanning/ @actions/advanced-security-code-scanning @actions/actions-workflow-development-reviewers @actions/advanced-security-dependency-graph
4-
/pages/ @actions/pages @actions/actions-workflow-development-reviewers
3+
/code-scanning/ @actions/advanced-security-code-scanning @actions/actions-workflow-development-reviewers @actions/advanced-security-dependency-graph @actions/starter-workflows
4+
/code-scanning/dependency-review.yml @actions/actions-workflow-development-reviewers @actions/advanced-security-dependency-graph @actions/starter-workflows
5+
/pages/ @actions/pages @actions/actions-workflow-development-reviewers @actions/starter-workflows

ci/dotnet-desktop.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@ jobs:
6363

6464
steps:
6565
- name: Checkout
66-
uses: actions/checkout@v3
66+
uses: actions/checkout@v4
6767
with:
6868
fetch-depth: 0
6969

7070
# Install the .NET Core workload
7171
- name: Install .NET Core
72-
uses: actions/setup-dotnet@v3
72+
uses: actions/setup-dotnet@v4
7373
with:
74-
dotnet-version: 6.0.x
74+
dotnet-version: 8.0.x
7575

7676
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
7777
- name: Setup MSBuild.exe
78-
uses: microsoft/setup-msbuild@v1.0.2
78+
uses: microsoft/setup-msbuild@v2
7979

8080
# Execute all unit tests in the solution
8181
- name: Execute unit tests

ci/dotnet.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
- name: Setup .NET
20-
uses: actions/setup-dotnet@v3
20+
uses: actions/setup-dotnet@v4
2121
with:
22-
dotnet-version: 6.0.x
22+
dotnet-version: 8.0.x
2323
- name: Restore dependencies
2424
run: dotnet restore
2525
- name: Build

ci/gradle-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
settings-path: ${{ github.workspace }} # location for the settings.xml file
3131

3232
- name: Setup Gradle
33-
uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0
33+
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
3434

3535
- name: Build with Gradle
3636
run: ./gradlew build

ci/gradle.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies.
3232
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
3333
- name: Setup Gradle
34-
uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0
34+
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
3535

3636
- name: Build with Gradle Wrapper
3737
run: ./gradlew build
@@ -40,7 +40,7 @@ jobs:
4040
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
4141
#
4242
# - name: Setup Gradle
43-
# uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0
43+
# uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
4444
# with:
4545
# gradle-version: '8.5'
4646
#
@@ -64,4 +64,4 @@ jobs:
6464
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
6565
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
6666
- name: Generate and submit dependency graph
67-
uses: gradle/actions/dependency-submission@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0
67+
uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

ci/laravel.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
run: |
2929
mkdir -p database
3030
touch database/database.sqlite
31-
- name: Execute tests (Unit and Feature tests) via PHPUnit
31+
- name: Execute tests (Unit and Feature tests) via PHPUnit/Pest
3232
env:
3333
DB_CONNECTION: sqlite
3434
DB_DATABASE: database/database.sqlite
35-
run: vendor/bin/phpunit
35+
run: php artisan test

code-scanning/codeql.yml

+28-22
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,37 @@ on:
2121

2222
jobs:
2323
analyze:
24-
name: Analyze
24+
name: Analyze (${{ matrix.language }})
2525
# Runner size impacts CodeQL analysis time. To learn more, please see:
2626
# - https://gh.io/recommended-hardware-resources-for-running-codeql
2727
# - https://gh.io/supported-runners-and-hardware-resources
28-
# - https://gh.io/using-larger-runners
29-
# Consider using larger runners for possible analysis time improvements.
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
3030
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
3131
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
3232
permissions:
3333
# required for all workflows
3434
security-events: write
3535

36+
# required to fetch internal or private CodeQL packs
37+
packages: read
38+
3639
# only required for workflows in private repositories
3740
actions: read
3841
contents: read
3942

4043
strategy:
4144
fail-fast: false
4245
matrix:
43-
language: [ $detected-codeql-languages ]
44-
# CodeQL supports [ $supported-codeql-languages ]
45-
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
46-
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
47-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
48-
46+
$codeql-languages-matrix
47+
# CodeQL supports the following values keywords for 'language': $supported-codeql-languages
48+
# Use `c-cpp` to analyze code written in C, C++ or both
49+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
50+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
51+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
52+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
53+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
54+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
4955
steps:
5056
- name: Checkout repository
5157
uses: actions/checkout@v4
@@ -55,28 +61,28 @@ jobs:
5561
uses: github/codeql-action/init@v3
5662
with:
5763
languages: ${{ matrix.language }}
64+
build-mode: ${{ matrix.build-mode }}
5865
# If you wish to specify custom queries, you can do so here or in a config file.
5966
# By default, queries listed here will override any specified in a config file.
6067
# Prefix the list here with "+" to use these queries and those in the config file.
6168

6269
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
6370
# queries: security-extended,security-and-quality
6471

65-
66-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
67-
# If this step fails, then you should remove it and run the build manually (see below)
68-
- name: Autobuild
69-
uses: github/codeql-action/autobuild@v3
70-
72+
# If the analyze step fails for one of the languages you are analyzing with
73+
# "We were unable to automatically build your code", modify the matrix above
74+
# to set the build mode to "manual" for that language. Then modify this step
75+
# to build your code.
7176
# ℹ️ Command-line programs to run using the OS shell.
7277
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
73-
74-
# If the Autobuild fails above, remove it and uncomment the following three lines.
75-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
76-
77-
# - run: |
78-
# echo "Run, Build Application using script"
79-
# ./location_of_script_within_repo/buildscript.sh
78+
- if: matrix.build-mode == 'manual'
79+
run: |
80+
echo 'If you are using a "manual" build mode for one or more of the' \
81+
'languages you are analyzing, replace this with the commands to build' \
82+
'your code, for example:'
83+
echo ' make bootstrap'
84+
echo ' make release'
85+
exit 1
8086
8187
- name: Perform CodeQL Analysis
8288
uses: github/codeql-action/analyze@v3

code-scanning/dependency-review.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ on:
2020
# https://docs.github.com/en/enterprise-cloud@latest/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api
2121
permissions:
2222
contents: read
23-
# Required if `comment-summary-in-pr: true` is uncommented below
24-
# pull-requests: write
23+
# Write permissions for pull-requests are required for using the `comment-summary-in-pr` option, comment out if you aren't using this option
24+
pull-requests: write
2525

2626
jobs:
2727
dependency-review:
@@ -32,8 +32,8 @@ jobs:
3232
- name: 'Dependency Review'
3333
uses: actions/dependency-review-action@v4
3434
# Commonly enabled options, see https://github.com/actions/dependency-review-action#configuration-options for all available options.
35-
# with:
35+
with:
36+
comment-summary-in-pr: always
3637
# fail-on-severity: moderate
3738
# deny-licenses: GPL-1.0-or-later, LGPL-2.0-or-later
38-
# comment-summary-in-pr: true
3939
# retry-on-snapshot-warnings: true

code-scanning/detekt.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# 4. Manually, on demand, via the "workflow_dispatch" event
1414
#
1515
# The workflow should work with no modifications, but you might like to use a
16-
# later version of the Detekt CLI by modifing the $DETEKT_RELEASE_TAG
16+
# later version of the Detekt CLI by modifying the $DETEKT_RELEASE_TAG
1717
# environment variable.
1818
name: Scan with Detekt
1919

code-scanning/endorlabs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/checkout@v3
2525
#### Package Build Instructions
2626
### Use this section to define the build steps used by your software package.
27-
### Endor Labs builds your software for you where possible but the required build tools must be made availible.
27+
### Endor Labs builds your software for you where possible but the required build tools must be made available.
2828
# - name: Setup Java
2929
# uses: actions/setup-java@v3
3030
# with:

code-scanning/osv-scanner.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# A sample workflow which sets up periodic OSV-Scanner scanning for vulnerabilities,
7+
# in addition to a PR check which fails if new vulnerabilities are introduced.
8+
#
9+
# For more examples and options, including how to ignore specific vulnerabilities,
10+
# see https://google.github.io/osv-scanner/github-action/
11+
12+
name: OSV-Scanner
13+
14+
on:
15+
pull_request:
16+
branches: [ $default-branch, $protected-branches ]
17+
merge_group:
18+
branches: [ $default-branch, $protected-branches ]
19+
schedule:
20+
- cron: $cron-weekly
21+
push:
22+
branches: [ $default-branch, $protected-branches ]
23+
24+
permissions:
25+
# Require writing security events to upload SARIF file to security tab
26+
security-events: write
27+
# Read commit contents
28+
contents: read
29+
30+
jobs:
31+
scan-scheduled:
32+
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
33+
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@1f1242919d8a60496dd1874b24b62b2370ed4c78" # v1.7.1
34+
with:
35+
# Example of specifying custom arguments
36+
scan-args: |-
37+
-r
38+
--skip-git
39+
./
40+
scan-pr:
41+
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
42+
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@1f1242919d8a60496dd1874b24b62b2370ed4c78" # v1.7.1
43+
with:
44+
# Example of specifying custom arguments
45+
scan-args: |-
46+
-r
47+
--skip-git
48+
./
+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# This workflow will validate the IAM policies in the CloudFormation (CFN) templates with using the standard and custom checks in AWS IAM Access Analyzer
7+
# To use this workflow, you will need to complete the following set up steps before start using it:
8+
# 1. Configure an AWS IAM role to use the Access Analyzer's ValidatePolicy, CheckNoNewAccess and CheckAccessNotGranted. This IAM role must be configured to call from the GitHub Actions, use the following [doc](https://aws.amazon.com/blogs/security/use-iam-roles-to-connect-github-actions-to-actions-in-aws/) for steps. In the below workflow, ARN of such role is stored in the GitHub secrets with name `POLICY_VALIDATOR_ROLE`
9+
# 2. If you're using CHECK_NO_NEW_ACCESS policy-check-type, you need to create a reference policy. Use the guide [here](https://github.com/aws-samples/iam-access-analyzer-custom-policy-check-samples?tab=readme-ov-file#how-do-i-write-my-own-reference-policies) and store it your GitHub repo.
10+
# 3. If you're using the CHECK_ACCESS_NOT_GRANTED policy-check-type, identify the list of critical actions that shouldn't be granted access by the policies in the given CFN templates.
11+
# 4. Start using the GitHub actions by generating the GitHub events matching the defined criteria in your workflow.
12+
name: Validate AWS IAM policies in CloudFormation templates using Policy Validator
13+
on:
14+
push:
15+
branches: [$default-branch, $protected-branches]
16+
pull_request:
17+
# The branches below must be a subset of the branches above
18+
branches: [$default-branch]
19+
env:
20+
AWS_ROLE: MY_ROLE # set this with the role ARN which has permissions to invoke access-analyzer:ValidatePolicy,access-analyzer:CheckNoNewAccess, access-analyzer:CheckAccessNotGranted and can be used in GitHub actions
21+
REGION: MY_AWS_REGION # set this to your preferred AWS region where you plan to deploy your policies, e.g. us-west-1
22+
TEMPLATE_PATH: FILE_PATH_TO_CFN_TEMPLATE # set to the file path to the CloudFormation template.
23+
ACTIONS: MY_LIST_OF_ACTIONS # set to pass list of actions in the format action1, action2,.. This is required if you are using `CHECK_ACCESS_NOT_GRANTED` policy-check-type.
24+
REFERENCE_POLICY: REFERENCE_POLICY # set to pass a JSON formatted file that specifies the path to the reference policy that is used for a permissions comparison. For example, if you stored such path in a GitHub secret with name REFERENCE_IDENTITY_POLICY , you can pass ${{ secrets.REFERENCE_IDENTITY_POLICY }}. If not you have the reference policy in the repository, you can directly pass it's file path. This is required if you are using `CHECK_NO_NEW_ACCESS_CHECK` policy-check-type.
25+
REFERENCE_POLICY_TYPE: TYPE_OF_REFERENCE_POLICY # set to pass the policy type associated with the IAM policy under analysis and the reference policy. This is required if you are using `CHECK_NO_NEW_ACCESS_CHECK` policy-check-type.
26+
jobs:
27+
policy-validator:
28+
runs-on: ubuntu-latest # Virtual machine to run the workflow (configurable)
29+
# https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services#updating-your-github-actions-workflow
30+
# https://aws.amazon.com/blogs/security/use-iam-roles-to-connect-github-actions-to-actions-in-aws/
31+
permissions:
32+
id-token: write # This is required for requesting the JWT
33+
contents: read # This is required for actions/checkout
34+
name: Policy Validator checks for AWS IAM policies
35+
steps:
36+
# checkout the repo for workflow to access the contents
37+
- name: Checkout
38+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
39+
# Configure AWS Credentials. More configuration details here - https://github.com/aws-actions/configure-aws-credentials
40+
- name: Configure AWS Credentials
41+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
42+
with:
43+
role-to-assume: ${{ env.AWS_ROLE }}
44+
aws-region: ${{ env.REGION }}
45+
# Run the VALIDATE_POLICY check. More configuration details here - https://github.com/aws-actions/cloudformation-aws-iam-policy-validator
46+
- name: Run AWS AccessAnalyzer ValidatePolicy check
47+
id: run-aws-validate-policy
48+
uses: aws-actions/cloudformation-aws-iam-policy-validator@10479bdc0c8322ffb6f5eaa75d096195f97b798a #v1.0.0
49+
with:
50+
policy-check-type: "VALIDATE_POLICY"
51+
template-path: ${{ env.TEMPLATE_PATH}}
52+
region: ${{ env.REGION }}
53+
# Print result from VALIDATE_POLICY check
54+
- name: Print the result for ValidatePolicy check
55+
if: success() || failure()
56+
run: echo "${{ steps.run-aws-validate-policy.outputs.result }}"
57+
# Run the CHECK_ACCESS_NOT_GRANTED check. More configuration details here - https://github.com/aws-actions/cloudformation-aws-iam-policy-validator
58+
- name: Run AWS AccessAnalyzer CheckAccessNotGranted check
59+
id: run-aws-check-access-not-granted
60+
uses: aws-actions/cloudformation-aws-iam-policy-validator@10479bdc0c8322ffb6f5eaa75d096195f97b798a #v1.0.0
61+
with:
62+
policy-check-type: "CHECK_ACCESS_NOT_GRANTED"
63+
template-path: ${{ env.TEMPLATE_PATH}}
64+
actions: ${{ env.ACTIONS }}
65+
region: ${{ env.REGION }}
66+
# Print result from CHECK_ACCESS_NOT_GRANTED check
67+
- name: Print the result for CheckAccessNotGranted check
68+
if: success() || failure()
69+
run: echo "${{ steps.run-aws-check-access-not-granted.outputs.result }}"
70+
# Run the CHECK_NO_NEW_ACCESS check. More configuration details here - https://github.com/aws-actions/cloudformation-aws-iam-policy-validator
71+
# reference-policy is stored in GitHub secrets
72+
- name: Run AWS AccessAnalyzer CheckNoNewAccess check
73+
id: run-aws-check-no-new-access
74+
uses: aws-actions/cloudformation-aws-iam-policy-validator@10479bdc0c8322ffb6f5eaa75d096195f97b798a #v1.0.0
75+
with:
76+
policy-check-type: "CHECK_NO_NEW_ACCESS"
77+
template-path: ${{ env.TEMPLATE_PATH}}
78+
reference-policy: ${{ env.REFERENCE }}
79+
reference-policy-type: ${{ env.REFERENCE_POLICY_TYPE }}
80+
region: ${{env.REGION }}
81+
# Print result from CHECK_NO_NEW_ACCESS check
82+
- name: Print the result for CheckNoNewAccess check
83+
if: success() || failure()
84+
run: echo "${{ steps.run-aws-check-no-new-access.outputs.result }}"

0 commit comments

Comments
 (0)