Skip to content

Commit 05bfe94

Browse files
Merge branch 'master' of https://github.com/codacy/docs
2 parents 3c73b36 + effa638 commit 05bfe94

File tree

66 files changed

+1449
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1449
-74
lines changed

.github/styles/Microsoft/Terms.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ ignorecase: true
55
action:
66
name: replace
77
swap:
8-
'(?:agent|virtual assistant|intelligent personal assistant)': personal digital assistant
98
'(?:drive C:|drive C>|C: drive)': drive C
109
'(?:internet bot|web robot)s?': bot(s)
1110
'(?:microsoft cloud|the cloud)': cloud

.github/styles/Microsoft/Wordiness.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ swap:
7979
in lieu of: instead of
8080
in many cases: often
8181
in most cases: usually
82-
in order to: to
8382
in some cases: sometimes
8483
in spite of the fact that: although
8584
in spite of: despite

.github/styles/config/vocabularies/Codacy/accept.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
aligncheck
2+
autofix
3+
autoremediate
24
allowlist
35
Atlassian
46
autovacuum
@@ -41,6 +43,7 @@ Gradle
4143
Grafana
4244
Gravatar
4345
Hadolint
46+
Hardcoded
4447
hostname
4548
hotfix
4649
Jira
@@ -91,4 +94,6 @@ unassigns
9194
unfollow
9295
vacuumdb
9396
Visualforce
97+
VSCode
9498
Xcode
99+
webserver

.github/workflows/vale.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
with:
1919
filter_mode: added
2020
debug: true
21+
fail_on_error: false
2122
env:
2223
# Required
2324
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ site/
1717

1818
# Auxiliary tool outputs
1919
tools/*.csv
20+
21+
.codacy
22+
23+
#Ignore vscode AI rules
24+
.github/copilot-instructions.md
23.3 KB
Loading

docs/codacy-api/api-tokens.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,20 @@ You can create new account API tokens programmatically [using the Codacy API](ex
2929

3030
1. Click the button **Create API token** under **Account API tokens**.
3131

32-
!!! tip
33-
You can create multiple account API tokens. This can be useful to have a more flexible control by revoking only a specific token.
32+
1. Select an expiration date from the modal options. You can select between a range of 7 days to 90 days, create a custom expiration date, or create a token with no expiration.
33+
34+
![Creating an account API token](images/codacy-api-tokens-account.png)
35+
36+
![Creating an account API token modal](images/codacy-api-tokens-account-modal.png)
37+
38+
!!! tip
39+
You can create multiple account API tokens. This can be useful to have a more flexible control by revoking only a specific token.
40+
41+
When you have tokens created, you can view them inside the tokens table. By hovering a token, you are able to copy its value.
3442

35-
![Creating an account API token](images/codacy-api-tokens-account.png)
43+
![Creating an account API token modal](images/codacy-api-tokens-account-table.png)
3644

37-
To revoke an account API token, click the "X" next to the token. After this, all applications or services using that token to access the Codacy API will fail to authenticate and will receive the reply `{"error":"not found"}`.
45+
To delete an account API token, click the trash icon in the Actions column of the table. After this, all applications or services using that token to access the Codacy API will fail to authenticate and will receive the reply `{"error":"not found"}`.
3846

3947
## Generating and revoking repository API tokens {: id="repository-api-tokens"}
4048

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
12+
**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).
13+
14+
15+
## Creating targets
16+
17+
Before the automation process itself, you need to create a target. Targets are individual configurations that define what Codacy will scan, including the target URL, its type (API or web application), and other type-dependent fields like OpenAPI specification and optional authentication details for API targets.
18+
19+
Targets only need to be created once. Note that **targets are immutable** — if you need to change the URL, definition, or authentication, you'll need to delete the target and create a new one.
20+
21+
!!! important
22+
**Do not run API scans on production enviroments as our API scanners may cause potential downtime.**
23+
24+
Our DAST API scanner performs active security testing by sending a large number of requests to your application. When using authenticated API scanning, this activity can be even more intensive, as ZAP explores and probes more of your API surface.
25+
26+
Depending on how your target environment is configured, this may:
27+
28+
- Trigger rate limiting or throttling
29+
- Appear as a high volume of traffic, similar to a load test
30+
- Lead to incomplete scan results if key endpoints are blocked or limited
31+
32+
We recommend running scans in a **test or staging environment**, or coordinating with your infrastructure team to ensure that your environment can safely handle the load.
33+
34+
To create a target, use the following API request:
35+
36+
```bash
37+
curl -X POST https://app.codacy.com/api/v3/organizations/{GIT_PROVIDER}/{ORGANIZATION}/dast/targets \
38+
-H "Content-Type: application/json" \
39+
-H "Accept: application/json" \
40+
-H "api-token: {API_KEY}" \
41+
-d '{
42+
"url": {TARGET_URL},
43+
"targetType": {TARGET_TYPE},
44+
"apiDefinitionUrl": {API_DEFINITION_URL},
45+
"apiAuthHeaders": {
46+
"{HEADER_NAME}": "{HEADER_VALUE}"
47+
}
48+
}'
49+
```
50+
51+
Replace the placeholders with your own values:
52+
53+
| Field | Required | Description |
54+
|-------|----------|-------------|
55+
| **API_KEY** | true | [Account API token](../api-tokens.md#account-api-tokens) used to authenticate on the Codacy API |
56+
| **GIT_PROVIDER** | true | Git provider hosting of the organization, using one of the values in the table below. <br/>**Options:** `gh` (GitHub Cloud), `ghe`(GitHub Enterprise), `gl` (Gitlab Cloud), `gle` (Gitlab Enterprise), `bb` (Bitbucket Cloud), `bbe` (Bitbucket Server) |
57+
| **ORGANIZATION** | true | Name of the organization on the Git provider. You must have admin permissions over the organization on the Git provider.<br/>For example, `codacy` |
58+
| **TARGET_URL** | true | URL of the Web app or API that will be scanned. <br/>Must start with `http://` or `https://`<br/>For example, `https://api.codacy.com/v1`|
59+
| **TARGET_TYPE** | false | Type of target to be scanned <br/> **Options:** `webapp` (default), `openapi` or `graphql`|
60+
| **API_DEFINITION_URL** | false * | The URL to a publicly accessible OpenAPI specification.<br/>*** Required for OpenAPI targets**|
61+
| **HEADER_NAME** | false | Name of the authentication header. <br/>For example, `Authentication`|
62+
| **HEADER_VALUE** | false | Value of the authentication header. <br/>For example, a token or API key|
63+
64+
Once you create the target you'll get the target `id` as a response. You will use it to trigger DAST scans in the next section.
65+
66+
!!! important
67+
Currently we only support one authentication header. If you need more, please let us know via support or your account representative.
68+
69+
## Trigger DAST analysis scans
70+
71+
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.
72+
73+
```bash
74+
curl -X POST https://app.codacy.com/api/v3/organizations/{GIT_PROVIDER}/{ORGANIZATION}/dast/targets/{DAST_TARGET_ID}/analyze \
75+
-H "Accept: application/json" \
76+
-H "api-token: {API_KEY}"
77+
```
78+
79+
Replace the placeholders with your own values:
80+
81+
- **API_KEY:** [Account API token](../api-tokens.md#account-api-tokens) used to authenticate on the Codacy API.
82+
- **GIT_PROVIDER:** Git provider hosting of the organization (check the table on the example above). For example, `gh` for GitHub Cloud.
83+
- **ORGANIZATION:** Name of the organization on the Git provider. For example, `codacy`. You must have admin permissions over the organization on the Git provider.
84+
- **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.
85+
86+
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/codacy-api/examples/uploading-dast-results.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ To ensure the security of your web applications, Codacy allows you to upload DAS
1414

1515
1. Upload the report to Codacy using the API endpoint [<span class="skip-vale">uploadDASTReport</span>](https://app.codacy.com/api/api-docs#uploaddastreport):
1616

17-
!!! note
18-
The DAST report must be under 20MB in size.
17+
!!! important
18+
The DAST report must be under 20MB in size. Please also guarantee that @generated timestamps are in an English locale, and use the default ZAP format (EEE, d MMM yyyy HH:mm:ss), as otherwise the report won't be processed.
1919

2020
```bash
2121
curl -X POST https://app.codacy.com/api/v3/organizations/<GIT_PROVIDER>/<ORGANIZATION>/security/tools/dast/<TOOL_NAME>/reports \
73.6 KB
Loading

0 commit comments

Comments
 (0)