I'm also running the github action with a context because I only want to run the ZAP API SCAN against one environment for now. It looks like this:
- name: Start ZAP API Scan uses: github-organization/action-api-scan@9c5fc1684752c5b4877df896051ae4fe395cb049 with: target: "openapi.yaml" format: openapi allow_issue_writing: false #token: ${{ secrets.GITHUB_TOKEN }} # This is only needed if issues are to be created. cmd_options: '-d -n zap.context'
And the context essentially contains include and exclude regexps to limit what urls that it should run against, like this:
So what I'm expecting to happen is that the ZAP API SCAN should run against https://api-garden-dev.company.com/company/team/serviceand all subsequent paths and nothing else. But it seems like the target is actuallyhttps://api-garden-dev.company.combased on the github action logs.
And because of this I seem to get the following error:
[ZAP-IO-Server-1-1] WARN org.zaproxy.zap.extension.api.API - Bad request to API endpoint [/JSON/ascan/action/scan/] from [127.0.0.1]:
If I change the include regexp to <incregexes>https://api-garden-dev.company.com.*</incregexes> then it starts to work, but then it will also scan alot of unwanted urls.
What am I doing wrong, any help is much appreciated. Thanks in advance!
Best regards,
Christoffer
Simon Bennetts
unread,
Dec 19, 2024, 12:16:26 PM12/19/24
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ZAP User Group
Hiya,
The packaged scans are a bit restrictive. If you have simple use cases then they work fine, but if you need to do more complicated things then they struggle.