Skip to content

Commit 3350047

Browse files
committed
cleanup and publishing
1 parent 767d820 commit 3350047

7 files changed

Lines changed: 46 additions & 23 deletions
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
# IP-RANGE-CONTROLLED no longer works... probably needs IP range refresh, cannot get throughto api.sonar
3+
# SonarQube:
4+
# runs-on: ip-range-controlled
5+
# steps:
6+
# - uses: actions/checkout@v4
7+
# with:
8+
# fetch-depth: 0
9+
10+
# - name: SonarQube Scan
11+
# uses: sonarsource/sonarqube-scan-action@v5.1.0
12+
# continue-on-error: true
13+
# env:
14+
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
15+
# SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

.github/workflows/ci-main-pull-request.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,14 @@ jobs:
475475
# #
476476
# ################################################################################################################
477477

478+
# TODO: comment this out until we check with security on org secrets usage in public repos
478479
Sonar-SAST-public:
479480
name: 'PUBLIC Sonar SAST scan'
480481
needs: ci-build
481482
if: ${{ inputs.perform-sonarqube-sca-scan == true && success() && inputs.visibility == 'public'}}
482483
uses: chef/common-github-actions/.github/workflows/sonarqube-public-repo.yml@main
483484
secrets: inherit
484-
permissions: # Must change the job token permissions to use JWT auth
485+
permissions:
485486
id-token: write
486487
contents: read
487488
with:
@@ -507,6 +508,9 @@ jobs:
507508
needs: ci-build
508509
uses: chef/common-github-actions/.github/workflows/sonarqube-private-repo.yml@main
509510
secrets: inherit
511+
permissions:
512+
id-token: write
513+
contents: read
510514
with:
511515
perform-build: ${{ inputs.perform-sonar-build }}
512516
build-profile: ${{ inputs.build-profile }}
@@ -530,6 +534,9 @@ jobs:
530534
needs: ci-build
531535
uses: chef/common-github-actions/.github/workflows/sonarqube-internal-repo.yml@main
532536
secrets: inherit
537+
permissions:
538+
id-token: write
539+
contents: read
533540
with:
534541
perform-build: ${{ inputs.perform-sonar-build }}
535542
build-profile: ${{ inputs.build-profile }}

.github/workflows/sonarqube-internal-repo.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ jobs:
7878
7979
SonarQube:
8080
runs-on: ubuntu-latest-4-cores
81+
permissions:
82+
id-token: write
83+
contents: read
8184
steps:
8285
- name: checkout
8386
if: ${{ inputs.perform-build == true && inputs.visibility == 'internal' }}

.github/workflows/sonarqube-private-repo.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ jobs:
7575
7676
SonarQube:
7777
runs-on: ubuntu-latest-4-cores
78+
permissions:
79+
id-token: write
80+
contents: read
7881
steps:
7982
- name: Checkout
8083
if: ${{ inputs.visibility == 'private' }}

.github/workflows/sonarqube-public-repo.yml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
7979
SonarQube:
8080
runs-on: ubuntu-latest
81-
permissions: # Must change the job token permissions to use JWT auth
81+
permissions:
8282
id-token: write
8383
contents: read
8484

@@ -88,17 +88,15 @@ jobs:
8888
with:
8989
fetch-depth: 0
9090

91-
# from Confluence, with @latest version of the action
91+
# from Confluence, with @latest version of the action
9292
# - name: Prepare Secrets and Login into Azure
9393
# id: get-aad-secret
9494
# uses: 'prgs-community/githubactions-reusableworkflow-sonarqube/.github/actions/azure-login@latest'
9595
# with:
9696
# akeyless-access-id: '${{ secrets.AKEYLESS_JWT_ID }}'
9797

98-
# Use @{ver} to select the version of the action. "latest" tag is also available for latest version.
9998
- name: Prepare Secrets and Login into Azure
10099
id: get-aad-secret
101-
# uses: 'prgs-community/githubactions-reusableworkflow-sonarqube/.github/actions/azure-login@0.8'
102100
uses: 'chef/common-github-actions/.github/actions/azure-login@main'
103101
with:
104102
akeyless-access-id: '${{ secrets.AKEYLESS_JWT_ID }}'
@@ -117,7 +115,6 @@ jobs:
117115
- name: SonarQube Scan
118116
if: ${{ inputs.visibility == 'public' }}
119117
uses: sonarsource/sonarqube-scan-action@v5.1.0
120-
# Confluence uses old version: SonarSource/sonarqube-scan-action@v2.0.1
121118
continue-on-error: true
122119
env:
123120
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
@@ -135,7 +132,6 @@ jobs:
135132
run: |
136133
az logout
137134
138-
139135
#TODO: Test adding Irfan's quality reporting stage inline here after sonar run (https://github.com/Progress-I360/github-action-reporting)
140136
# PRODUCT_NAME = [Chef360 | Courier | Inspec] @main removed
141137
# - name: Run SonarQube report generation
@@ -156,19 +152,4 @@ jobs:
156152
# PRODUCT_NAME: ${{ inputs.quality-product-name }}
157153
# TESTING_TYPE: ${{ inputs.quality-testing-type }}
158154
# SERVICE_NAME: ${{ inputs.quality-service-name }}
159-
# JUNIT_REPORT: ${{ inputs.quality-junit-report }}
160-
161-
# IP-RANGE-CONTROLLED no longer works... probably needs IP range refresh, cannot get throughto api.sonar
162-
# SonarQube:
163-
# runs-on: ip-range-controlled
164-
# steps:
165-
# - uses: actions/checkout@v4
166-
# with:
167-
# fetch-depth: 0
168-
169-
# - name: SonarQube Scan
170-
# uses: sonarsource/sonarqube-scan-action@v5.1.0
171-
# continue-on-error: true
172-
# env:
173-
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
174-
# SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
155+
# JUNIT_REPORT: ${{ inputs.quality-junit-report }}

.github/workflows/stubs/ci-main-pull-request-stub-trufflehog-only.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313

1414
workflow_dispatch:
1515

16+
permissions:
17+
contents: read
18+
1619
env:
1720
STUB_VERSION: "1.0.0"
1821

@@ -28,6 +31,10 @@ jobs:
2831
call-ci-main-pr-check-pipeline:
2932
uses: chef/common-github-actions/.github/workflows/ci-main-pull-request.yml@main
3033
secrets: inherit
34+
permissions:
35+
id-token: write
36+
contents: read
37+
3138
with:
3239
visibility: ${{ github.event.repository.visibility }}
3340

.github/workflows/stubs/ci-main-pull-request-stub.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313

1414
workflow_dispatch:
1515

16+
permissions:
17+
contents: read
18+
1619
env:
1720
STUB_VERSION: "1.0.0"
1821

@@ -28,6 +31,10 @@ jobs:
2831
call-ci-main-pr-check-pipeline:
2932
uses: chef/common-github-actions/.github/workflows/ci-main-pull-request.yml@main
3033
secrets: inherit
34+
permissions:
35+
id-token: write
36+
contents: read
37+
3138
with:
3239
visibility: ${{ github.event.repository.visibility }}
3340

0 commit comments

Comments
 (0)