Skip to content

Commit d077d5c

Browse files
authored
More actions (#3)
* Create codeql.yml * Create checkov.yaml * Create scorecard.yaml
1 parent b4fb078 commit d077d5c

File tree

3 files changed

+151
-0
lines changed

3 files changed

+151
-0
lines changed

.github/workflows/checkov.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: checkov
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
11+
permissions: read-all
12+
13+
jobs:
14+
checkov:
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
statuses: none
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # @v4
24+
25+
- name: Run Checkov action
26+
id: checkov
27+
uses: bridgecrewio/checkov-action@f34885219720066007f948b843e747bb136aa223
28+
with:
29+
skip_check: CKV_DOCKER_2,CKV_DOCKER_3,CKV_SECRET_6
30+
quiet: true
31+
output_format: cli,sarif
32+
output_file_path: console,results.sarif
33+
download_external_modules: true
34+
35+
- name: Upload SARIF file
36+
uses: github/codeql-action/upload-sarif@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v3
37+
if: success() || failure()
38+
with:
39+
sarif_file: results.sarif

.github/workflows/codeql.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: "CodeQL"
2+
3+
permissions: read-all
4+
5+
on:
6+
push:
7+
branches: [ "main" ]
8+
pull_request:
9+
branches: [ "main" ]
10+
schedule:
11+
- cron: '27 17 * * 3'
12+
13+
jobs:
14+
analyze:
15+
name: Analyze (${{ matrix.language }})
16+
runs-on: 'ubuntu-latest'
17+
permissions:
18+
# required for all workflows
19+
security-events: write
20+
21+
# required to fetch internal or private CodeQL packs
22+
packages: read
23+
24+
# only required for workflows in private repositories
25+
actions: read
26+
contents: read
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
include:
32+
- language: actions
33+
build-mode: none
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
37+
38+
# Initializes the CodeQL tools for scanning.
39+
- name: Initialize CodeQL
40+
uses: github/codeql-action/init@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4
41+
with:
42+
languages: ${{ matrix.language }}
43+
build-mode: ${{ matrix.build-mode }}
44+
45+
- name: Perform CodeQL Analysis
46+
uses: github/codeql-action/analyze@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v4
47+
with:
48+
category: "/language:${{matrix.language}}"

.github/workflows/scorecard.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Scorecard supply-chain security
2+
on:
3+
# For Branch-Protection check. Only the default branch is supported. See
4+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
5+
branch_protection_rule:
6+
# To guarantee Maintained check is occasionally updated. See
7+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
8+
schedule:
9+
- cron: '32 18 * * 6'
10+
push:
11+
branches: [ "main" ]
12+
13+
# Declare default permissions as read only.
14+
permissions: read-all
15+
16+
jobs:
17+
analysis:
18+
name: Scorecard analysis
19+
runs-on: ubuntu-latest
20+
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
21+
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
22+
permissions:
23+
# Needed to upload the results to code-scanning dashboard.
24+
security-events: write
25+
# Needed to publish results and get a badge (see publish_results below).
26+
id-token: write
27+
28+
steps:
29+
- name: "Checkout code"
30+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31+
with:
32+
persist-credentials: false
33+
34+
- name: "Run analysis"
35+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
36+
with:
37+
results_file: results.sarif
38+
results_format: sarif
39+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
40+
# - you want to enable the Branch-Protection check on a *public* repository, or
41+
# - you are installing Scorecard on a *private* repository
42+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
43+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
44+
45+
# Public repositories:
46+
# - Publish results to OpenSSF REST API for easy access by consumers
47+
# - Allows the repository to include the Scorecard badge.
48+
# - See https://github.com/ossf/scorecard-action#publishing-results.
49+
publish_results: true
50+
51+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
52+
# format to the repository Actions tab.
53+
- name: "Upload artifact"
54+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
55+
with:
56+
name: SARIF file
57+
path: results.sarif
58+
retention-days: 5
59+
60+
# Upload the results to GitHub's code scanning dashboard (optional).
61+
- name: "Upload to code-scanning"
62+
uses: github/codeql-action/upload-sarif@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # v3
63+
with:
64+
sarif_file: results.sarif

0 commit comments

Comments
 (0)