Skip to content

Commit b9cbb68

Browse files
authored
Merge pull request #798 from secureCodeBox/feature/improve-scb-bot
Add Improvements to SCB Bot
2 parents d39435f + 9f33df7 commit b9cbb68

17 files changed

Lines changed: 82 additions & 20 deletions

File tree

.github/workflows/scb-bot.yaml

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Fetch scanner's version API
4040
uses: mikefarah/yq@v4.4.1
4141
with:
42-
cmd: echo versionApi=$(yq e .versionApi scanners/${{ matrix.scanner }}/Chart.yaml) >> $GITHUB_ENV
42+
cmd: echo versionApi=$(yq e .annotations.versionApi scanners/${{ matrix.scanner }}/Chart.yaml) >> $GITHUB_ENV
4343

4444
- name: Fetch latest release scanner version
4545
run: echo release=$((curl -sL ${{env.versionApi}} ) | jq -r ".tag_name") | tr -d "v" >> $GITHUB_ENV
@@ -60,13 +60,56 @@ jobs:
6060
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
6161
echo prExists=$(gh pr list --state open --limit 100 | grep -F "$pullRequestTitle" -c) >> $GITHUB_ENV
6262
63-
- name: Upgrade Scanner
63+
- name: Fetch new release changelog
64+
if: ${{ env.release != env.local }}
65+
run: echo releaseChangelog=$((curl -sL ${{env.versionApi}} ) | jq -r ".body") >> $GITHUB_ENV
66+
67+
- name: Upgrade Scanner Helm Chart
6468
if: ${{ env.release != env.local && env.prExists == 0 }}
6569
uses: mikefarah/yq@v4.4.1
6670
with:
6771
# appVersion value in chart is replaced with release value. Empty lines are deleted in the process
6872
cmd: yq e --inplace '.appVersion = "v${{env.release}}"' ./scanners/${{ matrix.scanner }}/Chart.yaml
6973

74+
# Updating Helm Docs
75+
- name: Download Helm Docs
76+
run: |
77+
mkdir helm-docs
78+
cd helm-docs
79+
80+
curl --output helm-docs.tar.gz --location https://github.com/norwoodj/helm-docs/releases/download/v1.5.0/helm-docs_1.5.0_Linux_x86_64.tar.gz
81+
# Checksum must be extracted from the checksum file every time helm-docs gets updated.
82+
echo "a352e13a8438045b8ed138b821cb757c177acd999c1af77345152d7a64b0ddb7 helm-docs.tar.gz" | shasum --check
83+
84+
tar -xvf helm-docs.tar.gz
85+
# Verify installation
86+
./helm-docs --version
87+
88+
sudo mv helm-docs /usr/local/bin/helm-docs
89+
90+
- name: Generate README
91+
run: |
92+
make readme
93+
- name: Generate Demo-Apps Docs
94+
run: make demo-apps-docs
95+
96+
- name: Generate Hooks Docs
97+
run: make hook-docs
98+
99+
- name: Generate Scanner Docs
100+
run: make scanner-docs
101+
102+
- name: Generate Operator Docs
103+
run: make operator-docs
104+
105+
- name: Generate AutoDiscovery Docs
106+
run: make auto-discovery-docs
107+
108+
- name: Remove Helm Docs Files
109+
run: |
110+
# Remove helm-docs download to ensure they don't get committed back
111+
rm -rf helm-docs
112+
70113
- name: Create Pull Request
71114
if: ${{ env.release != env.local && env.prExists == 0 }}
72115
uses: peter-evans/create-pull-request@v3
@@ -78,6 +121,9 @@ jobs:
78121
body: "This is an automated Pull Request by the SCB-Bot. It upgrades ${{ matrix.scanner }} from ${{env.local}} to ${{env.release}}"
79122
branch: "dependencies/upgrading-${{ matrix.scanner }}-to-${{env.release}}"
80123
labels: dependencies,scanner
81-
commit-message: "Upgrading ${{ matrix.scanner }} from ${{env.local}} to ${{env.release}}"
124+
commit-message: |
125+
Upgrading ${{ matrix.scanner }} from ${{env.local}} to ${{env.release}}
126+
## Release changes :
127+
${{env.releaseChangelog}}
82128
signoff: true
83-
base: main
129+
base: main

scanners/amass/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ type: application
1010
version: v3.1.0-alpha1
1111
appVersion: "v3.14.3"
1212
kubeVersion: ">=v1.11.0-0"
13-
versionApi: https://api.github.com/repos/OWASP/Amass/releases/latest
13+
annotations:
14+
versionApi: https://api.github.com/repos/OWASP/Amass/releases/latest
1415
keywords:
1516
- security
1617
- amass

scanners/angularjs-csti-scanner/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ version: v3.1.0-alpha1
1212
appVersion: "3.0.6"
1313
kubeVersion: ">=v1.11.0-0"
1414

15-
versionApi : https://api.github.com/repos/tijme/angularjs-csti-scanner/releases/latest
15+
annotations:
16+
versionApi : https://api.github.com/repos/tijme/angularjs-csti-scanner/releases/latest
1617

1718
keywords:
1819
- security

scanners/cmseek/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ version: v3.1.0-alpha1
1212
appVersion: "1.1.3"
1313
kubeVersion: ">=v1.11.0-0"
1414

15-
versionApi: https://api.github.com/repos/Tuhinshubhra/CMSeeK/releases/latest
15+
annotations:
16+
versionApi: https://api.github.com/repos/Tuhinshubhra/CMSeeK/releases/latest
1617

1718
keywords:
1819
- security

scanners/gitleaks/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ version: v3.1.0-alpha1
1212
appVersion: "v7.6.1"
1313
kubeVersion: ">=v1.11.0-0"
1414

15-
versionApi: https://api.github.com/repos/zricethezav/gitleaks/releases/latest
15+
annotations:
16+
versionApi: https://api.github.com/repos/zricethezav/gitleaks/releases/latest
1617

1718
keywords:
1819
- security

scanners/kube-hunter/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ type: application
1010
version: v3.1.0-alpha1
1111
appVersion: "0.6.3"
1212
kubeVersion: ">=v1.11.0-0"
13-
versionApi: https://api.github.com/repos/aquasecurity/kube-hunter/releases/latest
13+
annotations:
14+
versionApi: https://api.github.com/repos/aquasecurity/kube-hunter/releases/latest
1415
keywords:
1516
- security
1617
- kube-hunter

scanners/kubeaudit/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ version: v3.1.0-alpha1
1111
appVersion: "v0.14.2"
1212
kubeVersion: ">=v1.11.0-0"
1313

14-
versionApi: https://api.github.com/repos/Shopify/kubeaudit/releases/latest
14+
annotations:
15+
versionApi: https://api.github.com/repos/Shopify/kubeaudit/releases/latest
1516

1617
keywords:
1718
- security

scanners/ncrack/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ version: v3.1.0-alpha1
1212
appVersion: "0.7"
1313
kubeVersion: ">=v1.11.0-0"
1414

15-
versionApi: https://api.github.com/repos/nmap/ncrack/releases/latest
15+
annotations:
16+
versionApi: https://api.github.com/repos/nmap/ncrack/releases/latest
1617

1718
keywords:
1819
- security

scanners/nuclei/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ version: v3.1.0-alpha1
1212
appVersion: "v2.5.2"
1313
kubeVersion: ">=v1.11.0-0"
1414

15-
versionApi: https://api.github.com/repos/projectdiscovery/nuclei/releases/latest
15+
annotations:
16+
versionApi: https://api.github.com/repos/projectdiscovery/nuclei/releases/latest
1617

1718
keywords:
1819
- security

scanners/semgrep/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ version: "v3.1.0-alpha1"
1919
# follow Semantic Versioning. They should reflect the version the application is using.
2020
# It is recommended to use it with quotes.
2121
appVersion: "0.71.0"
22-
versionApi: https://api.github.com/repos/returntocorp/semgrep/releases/latest
22+
annotations:
23+
versionApi: https://api.github.com/repos/returntocorp/semgrep/releases/latest
2324
kubeVersion: ">=v1.11.0-0"
2425
home: https://docs.securecodebox.io/docs/scanners/semgrep
2526
icon: https://docs.securecodebox.io/img/integrationIcons/semgrep.svg # TODO: Add this

0 commit comments

Comments
 (0)