Skip to content

Commit c4c57a3

Browse files
Change test setup and enable no-violations IT (#18)
<!-- Thank you for proposing a pull request! Please note that SOME TESTS WILL LIKELY FAIL due to how GitHub exposes secrets in Pull Requests from forks. Someone from the team will review your Pull Request and respond. Please describe your change and any implementation details below. --> Co-authored-by: Adish Agarwal <[email protected]>
1 parent 2a973f4 commit c4c57a3

File tree

3 files changed

+582
-881
lines changed

3 files changed

+582
-881
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ jobs:
5656

5757
- uses: 'google-github-actions/auth@v2'
5858
with:
59-
workload_identity_provider: 'projects/111685897256/locations/global/workloadIdentityPools/github/providers/my-repo'
60-
service_account: 'jenkins-plugin-v-16-nov@tf-deployer-2.iam.gserviceaccount.com'
59+
workload_identity_provider: 'projects/251902844862/locations/global/workloadIdentityPools/github/providers/my-repo'
60+
service_account: 'iac-scan-plugins@iac-scan-integration-test.iam.gserviceaccount.com'
6161

6262
- name: 'npm test'
6363
run: 'npm run test'
@@ -69,7 +69,7 @@ jobs:
6969
runs-on: 'ubuntu-latest'
7070

7171
env:
72-
ORGANIZATION_ID: '777838403257'
72+
ORGANIZATION_ID: '627849321070'
7373

7474
steps:
7575
- uses: 'actions/checkout@v4'
@@ -83,15 +83,15 @@ jobs:
8383

8484
- uses: 'google-github-actions/auth@v2'
8585
with:
86-
workload_identity_provider: 'projects/111685897256/locations/global/workloadIdentityPools/github/providers/my-repo'
87-
service_account: 'jenkins-plugin-v-16-nov@tf-deployer-2.iam.gserviceaccount.com'
86+
workload_identity_provider: 'projects/251902844862/locations/global/workloadIdentityPools/github/providers/my-repo'
87+
service_account: 'iac-scan-plugins@iac-scan-integration-test.iam.gserviceaccount.com'
8888

8989
- id: 'violations-found'
9090
name: 'Violations found in plan file'
9191
uses: './'
9292
with:
9393
organization_id: '${{ env.ORGANIZATION_ID }}'
94-
# plan file has 1 CRITICAL, 2 LOW severity vulnerabilites
94+
# plan file has 1 UNSPECIFIED, 1 HIGH severity vulnerabilites
9595
scan_file_ref: 'tests/resources/with-violations-tf_plan.json'
9696
iac_type: 'terraform'
9797
iac_version: '1.0.0'
@@ -110,35 +110,34 @@ jobs:
110110
exit 1
111111
fi
112112
113-
# TODO: Enable this test. See: https://github.com/google-github-actions/analyze-code-security-scc/issues/11
114-
# - id: 'no-violations-found'
115-
# name: 'No violations found in plan file'
116-
# uses: './'
117-
# with:
118-
# organization_id: '${{ env.ORGANIZATION_ID }}'
119-
# scan_file_ref: 'tests/resources/no-violations-tf_plan.json'
120-
# iac_type: 'terraform'
121-
# iac_version: '1.0.0'
122-
# failure_criteria: 'CRITICAL:2, Operator:OR'
123-
# - name: 'Check scan result and report not generated.'
124-
# run: |
125-
# if [ "${{ steps.no-violations-found.outputs.iac_scan_result_sarif_path }}" != "" ]; then
126-
# exit 1
127-
# fi
128-
# if [ "${{ steps.no-violations-found.outputs.iac_scan_result }}" != "passed" ]; then
129-
# exit 1
130-
# fi
113+
- id: 'no-violations-found'
114+
name: 'No violations found in plan file'
115+
uses: './'
116+
with:
117+
organization_id: '${{ env.ORGANIZATION_ID }}'
118+
scan_file_ref: 'tests/resources/no-violations-tf_plan.json'
119+
iac_type: 'terraform'
120+
iac_version: '1.0.0'
121+
failure_criteria: 'CRITICAL:2, Operator:OR'
122+
- name: 'Check scan result and report not generated.'
123+
run: |
124+
if [ "${{ steps.no-violations-found.outputs.iac_scan_result_sarif_path }}" != "" ]; then
125+
exit 1
126+
fi
127+
if [ "${{ steps.no-violations-found.outputs.iac_scan_result }}" != "passed" ]; then
128+
exit 1
129+
fi
131130
132131
- id: 'failure-criteria-satisfied'
133132
name: 'Failure criteria satisfied'
134133
uses: './'
135134
with:
136135
organization_id: '${{ env.ORGANIZATION_ID }}'
137-
# plan file has 1 CRITICAL, 2 LOW severity vulnerabilites
136+
# plan file has 1 UNSPECIFIED, 1 HIGH severity vulnerabilites
138137
scan_file_ref: 'tests/resources/with-violations-tf_plan.json'
139138
iac_type: 'terraform'
140139
iac_version: '1.0.0'
141-
failure_criteria: 'CRITICAL:1, Operator:OR'
140+
failure_criteria: 'HIGH:1, Operator:OR'
142141
continue-on-error: true
143142
- name: 'Check scan result and action build status'
144143
run: |
@@ -154,12 +153,12 @@ jobs:
154153
uses: './'
155154
with:
156155
organization_id: '${{ env.ORGANIZATION_ID }}'
157-
# plan file has 1 CRITICAL, 2 LOW severity vulnerabilites
156+
# plan file has 1 UNSPECIFIED, 1 HIGH severity vulnerabilites
158157
scan_file_ref: 'tests/resources/with-violations-tf_plan.json'
159158
iac_type: 'terraform'
160159
iac_version: '1.0.0'
161160
ignore_violations: 'true'
162-
failure_criteria: 'CRITICAL:1, Operator:OR'
161+
failure_criteria: 'HIGH:1, Operator:OR'
163162
- name: 'Check scan result'
164163
run: |
165164
if [ "${{ steps.failure-criteria-satisfied-ignore-violations-true.outputs.iac_scan_result }}" != "failed" ]; then

0 commit comments

Comments
 (0)