Skip to content

Commit bfd475e

Browse files
authored
Merge branch 'master' into feature/TAROT-3191-add-change-to-sla-config-audit-logs
2 parents 7a1d30d + 439dd0c commit bfd475e

6 files changed

Lines changed: 121 additions & 5 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
description: Instructions on how to trigger DAST/App using the API.
3+
---
4+
5+
# Trigger Dynamic Application Security Testing (DAST) scans
6+
7+
Thanks to the new app scanning capabilities available on the Security and risk management dashboard, it's now possible to automate application scanning via Codacy's API. This means that, with little effort, you'll be able to trigger app scanning on demand every time you deploy a new version of your app.
8+
9+
!!! important
10+
App scanning is a business feature. If you are a Codacy Pro customer, contact our customer success team to access a short trial.
11+
Check your [permissions](../../organizations/roles-and-permissions-for-organizations.md). Only git provider admins and organization managers will be able to create new targets and trigger scans (in app and via the API).
12+
Get your API key. All the methods below require you to authenticate via your [account's API token](../api-tokens.md#account-api-tokens).
13+
14+
## Creating targets
15+
16+
Before the automation process itself, you need to create a target. Targets are single units that contain all the configurations of your scan, in this case the URL (and later on other configurations, like authentication details and OpenAPI definition).
17+
Targets only need to be defined once. The target's URL is immutable, so, if you need to change it, you'll need to delete the target and create a new one.
18+
19+
To create a target:
20+
21+
```bash
22+
curl -X POST https://app.codacy.com/api/v3/organizations/{GIT_PROVIDER}/{ORGANIZATION}/dast/targets \
23+
-H "Content-Type: application/json" \
24+
-H "Accept: application/json" \
25+
-H "api-token: {API_KEY}" \
26+
-d '{"url": "https://api.domain.com/v1"}'
27+
```
28+
29+
Replace the placeholders with your own values:
30+
31+
- **API_KEY:** [Account API token](../api-tokens.md#account-api-tokens) used to authenticate on the Codacy API.
32+
- **GIT_PROVIDER:** Git provider hosting of the organization, using one of the values in the table below. For example, `gh` for GitHub Cloud.
33+
34+
| Value | Git provider |
35+
|-------|-------------------|
36+
| `gh` | GitHub Cloud |
37+
| `ghe` | GitHub Enterprise |
38+
| `gl` | GitLab Cloud |
39+
| `gle` | GitLab Enterprise |
40+
| `bb` | Bitbucket Cloud |
41+
| `bbe` | Bitbucket Server |
42+
43+
- **ORGANIZATION:** Name of the organization on the Git provider. For example, `codacy`. You must have admin permissions over the organization on the Git provider.
44+
45+
Once you create the target you'll get the 'Target Id' as a response. That id will be used to trigger DAST scans in the next section.
46+
47+
## Trigger DAST analysis scans
48+
49+
Once your targets are created you can trigger an analysis by calling the '[Analyze DAST target](https://api.codacy.com/api/api-docs#analyzedasttarget)' endpoint.
50+
51+
```bash
52+
curl -X POST https://app.codacy.com/api/v3/organizations/{GIT_PROVIDER}/{ORGANIZATION}/dast/targets/{DAST_TARGET_ID}/analyze \
53+
-H "Accept: application/json" \
54+
-H "api-token: {API_KEY}"
55+
```
56+
57+
Replace the placeholders with your own values:
58+
59+
- **API_KEY:** [Account API token](../api-tokens.md#account-api-tokens) used to authenticate on the Codacy API.
60+
- **GIT_PROVIDER:** Git provider hosting of the organization, using one of the values in the table below. For example, `gh` for GitHub Cloud.
61+
62+
| Value | Git provider |
63+
|-------|-------------------|
64+
| `gh` | GitHub Cloud |
65+
| `ghe` | GitHub Enterprise |
66+
| `gl` | GitLab Cloud |
67+
| `gle` | GitLab Enterprise |
68+
| `bb` | Bitbucket Cloud |
69+
| `bbe` | Bitbucket Server |
70+
71+
- **ORGANIZATION:** Name of the organization on the Git provider. For example, `codacy`. You must have admin permissions over the organization on the Git provider.
72+
**DAST_TARGET_ID:** Identifier of a DAST target to analyze (obtained in the [previous section](./triggering-dast-scans.md#creating-targets). For example, `457`. You must have admin permissions over the organization on the Git provider.
73+
74+
Scans occur asynchronously. To monitor an ongoing scan you can use the [target management page in Codacy](../../organizations/managing-security-and-risk.md#app-scanning). Once completed, you can access all scan results by navigating to the **Security dashboard**, selecting the **Findings tab** and filtering by **Scan types > DAST/App scanning**.

docs/getting-started/configuring-your-repository.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To configure your repository, follow these steps:
2525

2626
## 2. Configuring code patterns {: id="configuring-code-patterns"}
2727

28-
[Configure the tools and code patterns](../repositories-configure/configuring-code-patterns.md) that Codacy uses to analyze your repository. If security is important for your team, review the [security and risk management dashboard](../organizations/managing-security-and-risk.md) to ensure that your configuration detects potential security issues.
28+
[Configure the tools and code patterns](../repositories-configure/configuring-code-patterns.md) that Codacy uses to analyze your repository. If security is important for your team, review the [Security and risk management dashboard](../organizations/managing-security-and-risk.md) to ensure that your configuration detects potential security issues.
2929

3030
!!! tip
3131
To ensure that multiple repositories consistently follow the same global tool and code pattern configurations, [use an organization coding standard](../organizations/using-coding-standards.md).
118 KB
Loading

docs/organizations/managing-security-and-risk.md

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,9 @@ Security and risk management supports checking the languages and infrastructure-
522522
The dependency tab is a business-tier feature. If you are a Codacy Pro customer interested in upgrading to gain access to this feature, contact our customer success team.
523523

524524

525-
The **Security and risk management dependencies** page displays a unified view of all dependencies used by your repositories.
525+
The **Security and risk management Dependencies** page displays a unified view of all dependencies used by your repositories.
526526

527-
To access the dependencies page, access the [overview page](#dashboard) and click the **Findings** tab.
527+
To access the dependencies page, access the [overview page](#dashboard) and click the **Dependencies** tab.
528528

529529
![Security and risk management dependencies page](images/security-risk-management-dependencies-list.png)
530530

@@ -534,12 +534,52 @@ You're also able to click any dependency to find out more information about it.
534534

535535
![Security and risk management dependency page](images/security-risk-management-dependencies-single.png)
536536

537-
The dependency overview page offers a quick birds-eye view of that particular dependency. You'll be able to see all different versions that are being used, including which repository is using them, the oldest and most recent versions you're leveraging, as well as the highest criticality of security issues and the license <a href="#license-scanning"><sup>6</sup></a> applied to any particular version of that dependency.
537+
The dependency overview page offers a quick bird's-eye view of that particular dependency. You'll be able to see all different versions that are being used, including which repository is using them, the oldest and most recent versions you're leveraging, as well as the highest criticality of security issues and the license <a href="#license-scanning"><sup>6</sup></a> applied to any particular version of that dependency.
538538

539539

540540
<sup><span id="semgrep">1</span></sup>: Semgrep supports additional security rules when signing up for [Semgrep Pro](https://semgrep.dev/pricing/).
541541
<sup><span id="yaml-only">2</span></sup>: Currently, Trivy only supports scanning YAML files on this platform.
542542
<sup><span id="client-side">3</span></sup>: Supported as a [client-side tool](../repositories-configure/local-analysis/client-side-tools.md).
543543
<sup><span id="spotbugs-plugin">4</span></sup>: Includes the plugin [Find Security Bugs](https://find-sec-bugs.github.io/).
544544
<sup><span id="eslint-plugin">5</span></sup>: Includes the plugins [no-unsanitized](https://www.npmjs.com/package/eslint-plugin-no-unsanitized), [security](https://www.npmjs.com/package/eslint-plugin-security), [security-node](https://www.npmjs.com/package/eslint-plugin-security-node), and [xss](https://www.npmjs.com/package/eslint-plugin-xss).
545-
<sup><span id="license-scanning">6</span></sup>: Visit the [supported languages and tools](../getting-started/supported-languages-and-tools.md#supported-languages-and-tools) page for a list of supported languages.
545+
<sup><span id="license-scanning">6</span></sup>: Visit the [supported languages and tools](../getting-started/supported-languages-and-tools.md#supported-languages-and-tools) page for a list of supported languages.
546+
547+
548+
## App scanning {: id="app-scanning"}
549+
550+
!!! important
551+
App scanning is a business feature. If you are a Codacy Pro customer, contact our customer success team to access a short trial.
552+
553+
The **Security and risk management app scanning** page allows organizations to scan APIs and Web Applications for security vulnerabilities. This is part of our DAST (Dynamic Application Security Testing) capabilities, powered by ZAP.
554+
555+
To access the app scanning page, access the [overview page](#dashboard) and click the **App scanning** tab.
556+
557+
![Security and risk management app scanning page](images/security-risk-management-app-scanning.png)
558+
559+
App scanning tests applications in real-world scenarios, making it possible to find configuration and authentication issues or other runtime vulnerabilities that may impact your application’s functionality and security. It’s also a good method for preventing regressions and doesn’t depend on a specific programming language. As long as the application can be accessed through a browser, a DAST tool can typically scan it for vulnerabilities.
560+
561+
!!! note
562+
Already using ZAP? [Upload your results via the API.](../codacy-api/examples/uploading-dast-results.md)
563+
564+
### How to scan a target
565+
To scan a target, you can either go to the Security and risk management dashboard and access the App Scanning tab, or set it up for automation using our API.
566+
567+
!!! important
568+
Only [admins and organization managers](../organizations/roles-and-permissions-for-organizations.md) will be able to create new targets and run scans (both in-app and via the API).
569+
570+
571+
<div>
572+
<iframe width="100%" height="472" src="https://www.youtube.com/embed/qPwHlIGJYXs?autoplay=1&mute=1&showinfo=0&loop=1" title="DAST targets" frameborder="0"
573+
allowfullscreen>
574+
</iframe>
575+
</div>
576+
577+
578+
From within the tab, you're able to configure a new target by inputting the URL of the app you'd like to scan. You can configure up to 6 targets within your organization (if you need more, talk to your customer success representative).
579+
Scans can be triggered manually via Codacy's UI. As you click to start a scan, it will be first added to a queue and eventually executed. You can also queue a scan for a target that is already being scanned, and it will eventually execute after the current scan finishes. There are no limits to how many scans an organization can run per target, so this should accommodate all your deployment needs.
580+
Once a scan is complete, its findings will be added to the findings tab, where you can review them using the filter **Scan types > DAST/App scanning**.
581+
582+
!!! note
583+
Currently, DAST issues are only visible to admin and organization admin roles.
584+
585+
Follow our [roadmap](https://roadmap.codacy.com) for the upcoming updates on this feature.

docs/organizations/roles-and-permissions-for-organizations.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ To change this, open your organization **Settings**, page **Roles and permission
3535
- [Configure languages](../repositories-configure/languages.md)
3636
- [Manage branches](../repositories-configure/managing-branches.md)
3737
- [Reanalyze branches and pull requests](../faq/repositories/how-do-i-reanalyze-my-repository.md)
38+
- [Create targets and run Dynamic Application Security Testing scans](../organizations/managing-security-and-risk.md#app-scanning)
3839

3940
![Configuring repository management permissions](images/roles-permissions-repo-management.png)
4041

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ nav:
630630
- codacy-api/examples/obtaining-current-issues-in-repositories.md
631631
- codacy-api/examples/identifying-commits-without-coverage-data.md
632632
- codacy-api/examples/uploading-dast-results.md
633+
- codacy-api/examples/triggering-dast-scans.md
633634
- Managing Codacy Self-hosted: "!include submodules/chart/mkdocs.yml"
634635
- Troubleshooting and FAQs:
635636
- General:

0 commit comments

Comments
 (0)