Skip to content

Commit ddbe8aa

Browse files
committed
add wiz scan to the pipeline (SWG-14342)
1 parent d5c12e2 commit ddbe8aa

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/maven-master-pulls.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,37 @@ jobs:
5858
${{ runner.os }}-maven-
5959
- name: Build with Maven
6060
run: mvn -B -U clean verify -DskipTests -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true -Psamples-java8 --file pom.xml
61+
62+
scan-with-wiz:
63+
name: Trigger Wiz Scanning
64+
runs-on: ubuntu-latest
65+
66+
needs: [ build ]
67+
if: success()
68+
69+
steps:
70+
- name: Login to Docker Hub
71+
uses: docker/login-action@v2
72+
with:
73+
username: ${{ secrets.DOCKERHUB_SB_USERNAME }}
74+
password: ${{ secrets.DOCKERHUB_SB_PASSWORD }}
75+
76+
- name: Download Wiz CLI
77+
run: curl -o wizcli https://downloads.wiz.io/wizcli/latest/wizcli-linux-amd64 && chmod +x wizcli
78+
79+
- name: Authenticate to Wiz
80+
run: ./wizcli auth --id "$WIZ_CLIENT_ID" --secret "$WIZ_CLIENT_SECRET"
81+
env:
82+
WIZ_CLIENT_ID: ${{ secrets.WIZ_CLIENT_ID }}
83+
WIZ_CLIENT_SECRET: ${{ secrets.WIZ_CLIENT_SECRET }}
84+
85+
- name: Pull Docker image for scanning
86+
run: docker pull swaggerapi/swagger-codegen-cli:latest
87+
88+
- name: Run wiz-cli docker image scan
89+
run: |
90+
./wizcli docker scan --image $TAG --policy "$POLICY"
91+
./wizcli docker tag --image $TAG
92+
env:
93+
TAG: swaggerapi/swagger-codegen-cli:latest
94+
POLICY: "SmartBear default vulnerabilities policy"

0 commit comments

Comments
 (0)