{"id":13620913,"url":"https://github.com/zaproxy/action-baseline","last_synced_at":"2025-04-10T23:27:59.981Z","repository":{"id":39885279,"uuid":"245374268","full_name":"zaproxy/action-baseline","owner":"zaproxy","description":"A GitHub Action for running the ZAP Baseline scan","archived":false,"fork":false,"pushed_at":"2024-11-21T13:27:56.000Z","size":2646,"stargazers_count":324,"open_issues_count":11,"forks_count":58,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-06T06:34:25.232Z","etag":null,"topics":["actions","dast","devsecops","github-actions","security"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zaproxy.png","metadata":{"funding":{"custom":["https://www.zaproxy.org/sponsor/"]},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-06T09:06:28.000Z","updated_at":"2025-03-31T04:22:35.000Z","dependencies_parsed_at":"2023-01-11T17:21:48.344Z","dependency_job_id":"31c6ca64-a7b1-489e-99db-c3b031476e3f","html_url":"https://github.com/zaproxy/action-baseline","commit_stats":{"total_commits":101,"total_committers":10,"mean_commits":10.1,"dds":0.6336633663366337,"last_synced_commit":"4e4e1706cd983b80f06d6107689d3bd3ffe6793c"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaproxy%2Faction-baseline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaproxy%2Faction-baseline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaproxy%2Faction-baseline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaproxy%2Faction-baseline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaproxy","download_url":"https://codeload.github.com/zaproxy/action-baseline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247671709,"owners_count":20976812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","dast","devsecops","github-actions","security"],"created_at":"2024-08-01T21:01:00.640Z","updated_at":"2025-04-10T23:27:59.960Z","avatar_url":"https://github.com/zaproxy.png","language":"JavaScript","funding_links":["https://www.zaproxy.org/sponsor/"],"categories":["JavaScript"],"sub_categories":[],"readme":"# Action Baseline\n\nA GitHub Action for running the ZAP [Baseline scan](https://www.zaproxy.org/docs/docker/baseline-scan/) to find vulnerabilities in your web application. \n \nThe ZAP baseline action scans a target URL for vulnerabilities and maintains an issue in GitHub repository for the\nidentified alerts. Read the following [blog post](https://www.zaproxy.org/blog/2020-04-09-automate-security-testing-with-zap-and-github-actions) \nfor additional information.\n\n## Inputs\n\n### `target`\n\n**Required** The URL of the web application to be scanned. This can be either a publicly available web application or a locally\naccessible URL.\n\n### `docker_name`\n\n**Optional** The name of the docker file to be executed. By default the action runs the stable version of ZAP. But you can \nconfigure the parameter to use the weekly builds.\n\n### `rules_file_name`\n\n**Optional** You can also specify a relative path to the rules file to ignore any alerts from the ZAP scan. Make sure to create\nthe rules file inside the relevant repository. The following shows a sample rules file configuration.\nMake sure to checkout the repository (actions/checkout@v2) to provide the ZAP rules to the scan action.\n\n```tsv\n10011\tIGNORE\t(Cookie Without Secure Flag)\n10015\tIGNORE\t(Incomplete or No Cache-control and Pragma HTTP Header Set)\n``` \n\n### `cmd_options`\n\n**Optional** Additional command lines options for the baseline script\n\n### `allow_issue_writing`\n\n**Optional** By default the baseline action will file the report to the GitHub issue using the `issue_title` input.\nSet this to false if you don't want the issue to be created or updated.\n\n### `issue_title`\n\n**Optional** The title for the GitHub issue to be created\n\n### `token`\n\n**Optional** ZAP action uses the default action token provided by GitHub to create and update the issue for the baseline scan.\nYou do not have to create a dedicated token. Make sure to use the GitHub's default action token when running the action(`secrets.GITHUB_TOKEN`).\n\n### `fail_action`\n\n**Optional** By default ZAP Docker container will fail with an [exit code](https://github.com/zaproxy/zaproxy/blob/efb404d38280dc9ecf8f88c9b0c658385861bdcf/docker/zap-baseline.py#L31), \nif it identifies any alerts. Set this option to `true` if you want to fail the status of the GitHub Scan if ZAP identifies any alerts during the scan.  \n\n### `artifact_name`\n\n**Optional** By default the baseline action will attach the report to the build with the name `zap_scan`. Set this to a different string to name it something else. Consult [GitHub's documentation](https://github.com/actions/toolkit/blob/main/packages/artifact/docs/additional-information.md#non-supported-characters) for which artifact names are allowed.\n\n## Environment variables\n\nIf set, the following [ZAP authentication environment variables](https://www.zaproxy.org/docs/authentication/handling-auth-yourself/#authentication-env-vars)\nwill be copied into the docker container:\n\n- `ZAP_AUTH_HEADER_VALUE`\n- `ZAP_AUTH_HEADER`\n- `ZAP_AUTH_HEADER_SITE`\n\n## Example usage\n\n** Basic **\n```\nsteps:\n  - name: ZAP Scan\n    uses: zaproxy/action-baseline@v0.14.0\n    with:\n      target: 'https://www.zaproxy.org'\n```\n\n** Advanced **\n\n```\non: [push]\n\njobs:\n  zap_scan:\n    runs-on: ubuntu-latest\n    name: Scan the webapplication\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n        with:\n          ref: master\n      - name: ZAP Scan\n        uses: zaproxy/action-baseline@v0.14.0\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          docker_name: 'ghcr.io/zaproxy/zaproxy:stable'\n          target: 'https://www.zaproxy.org'\n          rules_file_name: '.zap/rules.tsv'\n          cmd_options: '-a'\n```\n\n## Issue Description\n\nThe following [issue](https://github.com/zaproxy/zaproxy-website/issues/93) shows how the GitHub Baseline Action scans the \n[https://www.zaproxy.org/](https://www.zaproxy.org/) website and notifies the users via opening an issue in the ZAP website repository. \nThe issue will be created by the GitHub Actions bot and will list the alerts as issue comments.\n\n[![issue open](./images/zap-issue-1.png)](https://github.com/zaproxy/zaproxy-website/issues/93#issue-597219582)\n\nTo demonstrate the workflow of the action; we are ignoring the alerts as they are not relevant, but this has the same effect as fixing them.\nTherefore during the second scan we are ignoring few alerts via ZAP rules and the action bot updates the issue with the newly ignored/resolved alerts. \n[![comment with issues resolved](./images/zap-issue-2.png)](https://github.com/zaproxy/zaproxy-website/issues/93#issuecomment-611490632)\n\n\nDuring the last scan we are ignoring all the alerts, thus resulting in finding zero alerts. Based on the scan results \nthe actions bot will close the ongoing open issue.\n[![issue closed](./images/zap-issue-3.png)](https://github.com/zaproxy/zaproxy-website/issues/93#issuecomment-611496321)\n\n## Localised Alert Details\n\nZAP is internationalised and alert information is available in many languages.\n\nYou can change the language used by this action by changing the locale via the `cmd_options` e.g.: `-z \"-config view.locale=fr_FR\"`\n\nSee [https://github.com/zaproxy/zaproxy/tree/main/zap/src/main/dist/lang](https://github.com/zaproxy/zaproxy/tree/main/zap/src/main/dist/lang) for the full set of locales currently supported.\n\nYou can help improve ZAP translations via [https://crowdin.com/project/zaproxy](https://crowdin.com/project/zaproxy). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaproxy%2Faction-baseline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaproxy%2Faction-baseline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaproxy%2Faction-baseline/lists"}