Skip to content

Commit 62565e6

Browse files
Merge pull request #37 from veracode/issue/DXS-412
Sandbox scan should not show on the PR checks for static scan
2 parents 11d1ad9 + 9be4881 commit 62565e6

File tree

4 files changed

+55
-66
lines changed

4 files changed

+55
-66
lines changed

.github/workflows/veracode-code-analysis.yml

Lines changed: 22 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,27 @@ concurrency:
88

99
on:
1010
repository_dispatch:
11-
types: [java-maven-pipeline-scan,
12-
java-maven-policy-scan,
13-
java-maven-sandbox-scan,
14-
java-gradle-pipeline-scan,
15-
java-gradle-policy-scan,
16-
java-gradle-sandbox-scan,
17-
source-code-pipeline-scan,
18-
source-code-policy-scan,
19-
source-code-sandbox-scan,
20-
dot-net-pipeline-scan,
21-
dot-net-policy-scan,
22-
dot-net-sandbox-scan,
23-
go-pipeline-scan,
24-
go-policy-scan,
25-
go-sandbox-scan,
26-
tsql-pipeline-scan,
27-
tsql-policy-scan,
28-
tsql-sandbox-scan,
29-
plsql-pipeline-scan,
30-
plsql-policy-scan,
31-
plsql-sandbox-scan,
32-
php-pipeline-scan,
33-
php-policy-scan,
34-
php-sandbox-scan,
35-
scala-pipeline-scan,
36-
scala-policy-scan,
37-
scala-sandbox-scan,
38-
dart-pipeline-scan,
39-
dart-policy-scan,
40-
dart-sandbox-scan]
11+
types:
12+
- java-maven-pipeline-scan
13+
- java-maven-policy-scan
14+
- java-gradle-pipeline-scan
15+
- java-gradle-policy-scan
16+
- source-code-pipeline-scan
17+
- source-code-policy-scan
18+
- dot-net-pipeline-scan
19+
- dot-net-policy-scan
20+
- go-pipeline-scan
21+
- go-policy-scan
22+
- tsql-pipeline-scan
23+
- tsql-policy-scan
24+
- plsql-pipeline-scan
25+
- plsql-policy-scan
26+
- php-pipeline-scan
27+
- php-policy-scan
28+
- scala-pipeline-scan
29+
- scala-policy-scan
30+
- dart-pipeline-scan
31+
- dart-policy-sca
4132

4233
jobs:
4334
register:
@@ -141,16 +132,4 @@ jobs:
141132
break_build_on_error: ${{ github.event.client_payload.user_config.break_build_on_error }}
142133
filter_mitigated_flaws: ${{ github.event.client_payload.user_config.filter_mitigated_flaws }}
143134
language: ${{ github.event.client_payload.repository.language }}
144-
secrets: inherit
145-
146-
sandbox_scan:
147-
needs: build
148-
if: contains(github.event.action, 'sandbox')
149-
uses: ./.github/workflows/veracode-sandbox-scan.yml
150-
with:
151-
profile_name: ${{ github.event.client_payload.user_config.profile_name }}
152-
policy_name: ${{ github.event.client_payload.policy_name }}
153-
branch: ${{ github.event.client_payload.repository.branch }}
154-
modules_to_scan: ${{ github.event.client_payload.modules_to_scan }}
155-
break_build_policy_findings: ${{ github.event.client_payload.user_config.break_build_policy_findings }}
156-
secrets: inherit
135+
secrets: inherit

.github/workflows/veracode-iac-secrets-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ jobs:
6161
source: "./"
6262
format: "json"
6363
debug: false
64-
fail_build: true
64+
fail_build: ${{ github.event.client_payload.user_config.break_build_policy_findings }}
Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
11
name: Veracode Static Sandbox Scanner
2+
run-name: Veracode Sandbox scan - ${{ github.event.client_payload.repository.name }}
3+
4+
concurrency:
5+
group: ${{ github.event.client_payload.event_type }}-${{ github.event.client_payload.repository.name }}-${{ github.event.client_payload.repository.branch }}
6+
cancel-in-progress: true
27

38
on:
4-
workflow_call:
5-
inputs:
6-
profile_name:
7-
required: true
8-
type: string
9-
modules_to_scan:
10-
required: true
11-
type: string
12-
branch:
13-
required: false
14-
type: string
15-
policy_name:
16-
required: true
17-
type: string
18-
break_build_policy_findings:
19-
required: true
20-
type: string
9+
repository_dispatch:
10+
types:
11+
- java-maven-sandbox-scan
12+
- java-gradle-sandbox-scan
13+
- source-code-sandbox-scan
14+
- dot-net-sandbox-scan
15+
- go-sandbox-scan
16+
- tsql-sandbox-scan
17+
- plsql-sandbox-scan
18+
- php-sandbox-scan
19+
- scala-sandbox-scan
20+
- dart-sandbox-scan
2121

2222
jobs:
23+
build:
24+
uses: ./.github/workflows/veracode-build-artifact-for-scanning.yml
25+
with:
26+
repository: ${{ github.event.client_payload.repository.full_name }}
27+
ref: ${{ github.event.client_payload.sha }}
28+
token: ${{ github.event.client_payload.token }}
29+
event_name: ${{ github.event.action }}
30+
2331
sandbox_scan:
32+
needs: build
2433
runs-on: ubuntu-latest
2534
name: sandbox scan
2635

@@ -40,14 +49,13 @@ jobs:
4049
uses: veracode/[email protected]
4150
id: upload_and_scan
4251
with:
43-
appname: ${{ inputs.profile_name }}
52+
appname: ${{ github.event.client_payload.user_config.profile_name }}
4453
createprofile: true
45-
policy: ${{ inputs.policy_name }}
54+
policy: ${{ github.event.client_payload.policy_name }}
4655
version: '${{ github.run_id }}'
4756
filepath: ./veracode_artifact_directory/
4857
vid: '${{ secrets.VERACODE_API_ID }}'
4958
vkey: '${{ secrets.VERACODE_API_KEY }}'
5059
createsandbox: true
51-
sandboxname: GitHub App Scans-${{ inputs.branch }}
52-
# include: ${{ inputs.modules_to_scan }}
53-
failbuild: ${{ inputs.break_build_policy_findings }}
60+
sandboxname: GitHub App Scans-${{ github.event.client_payload.repository.branch }}
61+
failbuild: ${{ github.event.client_payload.user_config.break_build_policy_findings }}

veracode.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ veracode_iac_secrets_scan:
8181
- synchronize
8282
target_branch:
8383
- default_branch
84+
# If break_build_policy_findings is set to true, the build will break when findings violate the policy.
85+
break_build_policy_findings: true
8486
# If the break_build_on_error is set to true, the build will break if the scan failed to complete or with an error, no libraries were found,
8587
# or no build system was found and the error_message will be displayed.
8688
break_build_on_error: true

0 commit comments

Comments
 (0)