You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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**.
[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.
29
29
30
30
!!! tip
31
31
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).
Copy file name to clipboardExpand all lines: docs/organizations/managing-security-and-risk.md
+44-4Lines changed: 44 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -522,9 +522,9 @@ Security and risk management supports checking the languages and infrastructure-
522
522
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.
523
523
524
524
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.
526
526
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.
528
528
529
529

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

536
536
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 <ahref="#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 <ahref="#license-scanning"><sup>6</sup></a> applied to any particular version of that dependency.
538
538
539
539
540
540
<sup><spanid="semgrep">1</span></sup>: Semgrep supports additional security rules when signing up for [Semgrep Pro](https://semgrep.dev/pricing/).
541
541
<sup><spanid="yaml-only">2</span></sup>: Currently, Trivy only supports scanning YAML files on this platform.
542
542
<sup><spanid="client-side">3</span></sup>: Supported as a [client-side tool](../repositories-configure/local-analysis/client-side-tools.md).
543
543
<sup><spanid="spotbugs-plugin">4</span></sup>: Includes the plugin [Find Security Bugs](https://find-sec-bugs.github.io/).
544
544
<sup><spanid="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><spanid="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><spanid="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
+

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).
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.
0 commit comments