Skip to content

Commit 6d861e8

Browse files
committed
add wiz scan on create PR to master (SWG-14342)
1 parent d5c12e2 commit 6d861e8

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,44 @@ 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@v3
72+
with:
73+
username: ${{ secrets.DOCKERHUB_SB_USERNAME }}
74+
password: ${{ secrets.DOCKERHUB_SB_PASSWORD }}
75+
76+
- name: Checkout code
77+
uses: actions/checkout@v3
78+
79+
- name: Set up Docker Buildx
80+
uses: docker/setup-buildx-action@v3
81+
82+
- name: Build Docker image
83+
run: |
84+
docker buildx build --load -t swaggerapi/swagger-codegen-cli:latest .
85+
86+
- name: Download Wiz CLI
87+
run: curl -o wizcli https://downloads.wiz.io/wizcli/latest/wizcli-linux-amd64 && chmod +x wizcli
88+
89+
- name: Authenticate to Wiz
90+
run: ./wizcli auth --id "$WIZ_CLIENT_ID" --secret "$WIZ_CLIENT_SECRET"
91+
env:
92+
WIZ_CLIENT_ID: ${{ secrets.WIZ_CLIENT_ID }}
93+
WIZ_CLIENT_SECRET: ${{ secrets.WIZ_CLIENT_SECRET }}
94+
95+
- name: Run wiz-cli docker image scan
96+
run: |
97+
./wizcli docker scan --image $TAG --policy "$POLICY" > /dev/null 2>&1
98+
./wizcli docker tag --image $TAG > /dev/null 2>&1
99+
env:
100+
TAG: swaggerapi/swagger-codegen-cli:latest
101+
POLICY: "SmartBear default vulnerabilities policy"

0 commit comments

Comments
 (0)