Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(zap): Update runs-on to ubuntu-22.04, Add retry mechanism, Modify run-ci command, Remove --wait flag #88

Merged
merged 20 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/zap-scanner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,27 @@ name: ZAP Scan
on:
push:
branches:
- main
- feat/fix-zap-tests
permissions:
issues: write
jobs:
zap_scan:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: Scan the webapplication
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2
# This step builds the image and runs the web application in the background for the ZAP scan
- name: Run image
run: just run-ci
run: |
just run-ci
curl --retry 5 --retry-connrefused --retry-max-time 120 -k -s https://127.0.0.1/health

- name: ZAP Scan
uses: zaproxy/action-api-scan@v0.7.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
format: openapi
target: 'https://localhost:8443/openapi.json'
target: 'https://127.0.0.1/openapi.json'
# The '-a' option activates all active scanners. Use this for comprehensive scanning.
cmd_options: '-a'
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ run: build
docker run -it -p 5000:5000 -e ENVIRONMENT=development -v $pwd/data:/data test-actions

# Use this command to run the application in CI/CD pipeline
run-ci: build
docker-compose up -d --wait
run-ci:
docker-compose up -d
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Removal of '--wait' flag might cause race conditions

The '--wait' flag ensures that the services are fully started before proceeding. Removing this flag might cause race conditions where subsequent steps run before the services are ready. Consider re-adding the '--wait' flag or implementing an alternative waiting mechanism.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github's docker-compose doesn't support --wait flag.


# Use this command to run the application in development mode in your local machine,
# using your local source code, without the need to rebuild the image. Don't use it if you're
Expand Down