Skip to content

Commit c8e4f2f

Browse files
Whitespotsgitbook-bot
Whitespots
authored andcommitted
GITBOOK-476: No subject
1 parent 00b3320 commit c8e4f2f

File tree

1 file changed

+56
-0
lines changed
  • appsec-portal/scanners/scanner-description/secret-scanners

1 file changed

+56
-0
lines changed

appsec-portal/scanners/scanner-description/secret-scanners/gitleaks.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,62 @@ description: >-
66

77
# Gitleaks
88

9+
**Auditor Job Name**: GitLab Gitleaks\
10+
**Auditor image:** registry.gitlab.com/whitespots-public/security-images/secret-detection-gitlab:5\
11+
**AppSec Portal Importer Name**: GitLab Gitleaks
12+
13+
**Auditor Job Name**: Gitleaks Scan\
14+
**Auditor image:** registry.gitlab.com/whitespots-public/security-images/gitleaks:8.15.3\
15+
**AppSec Portal Importer Name**: Gitleaks Scan
16+
917
[Gitleaks](https://github.com/gitleaks/gitleaks) uses _regular expressions_ to search for **specific patterns** of sensitive information. By default, it comes with a list of regular expressions that cover **common secrets**, but it can also be customized to match specific patterns.
1018

1119
One of the unique features of Gitleaks is its ability to scan not only the repository itself but also its **entire commit history**, making it a powerful tool for detecting information leaks that may have been committed in the past.
20+
21+
#### Curl example
22+
23+
{% code overflow="wrap" %}
24+
```
25+
curl -X POST localhost/api/v1/scan/import/ -H "Authorization: Token a75bb26171cf391671e67b128bfc8ae1c779ff7b" -H "Content-Type: multipart/form-data" -F "file=@./gl-secret-detection-report.json" -F "product_name=Product1" -F "product_type=Application" -F "scanner_name=GitLab Gitleaks" -F "branch=dev" -F "repository=git@gitlab.com:whitespots-public/appsec-portal.git"
26+
```
27+
{% endcode %}
28+
29+
{% code overflow="wrap" %}
30+
```
31+
curl -X POST localhost/api/v1/scan/import/ -H "Authorization: Token a75bb26171cf391671e67b128bfc8ae1c779ff7b" -H "Content-Type: multipart/form-data" -F "file=@./gitleaks.json" -F "product_name=Product1" -F "product_type=Application" -F "scanner_name=Gitleaks Scan" -F "branch=dev" -F "repository=git@gitlab.com:whitespots-public/appsec-portal.git"
32+
```
33+
{% endcode %}
34+
35+
In this command, the following parameters are used:
36+
37+
1. `-X POST`: specifies the HTTP method to be used (in this case, POST)
38+
2. `-H "Authorization: Token <authorization_token>"`: specifies the [**authorization token**](../../importing-reports-from-scanners-to-appsec-portal/#authorization-token) obtained from AppSec Portal.
39+
3. `-H "Content-Type: multipart/form-data"`: specifies the content type of the request.
40+
4. `-F "file=@<report_file_path>"`: specifies the **path to the report file** generated by the scanner.
41+
5. `-F "product_name=<product_name>"`: specifies the **name of the product** being scanned.
42+
6. `-F "product_type=<product_type>"`: specifies the **type of the product** being scanned.
43+
7. `-F "scanner_name=<scanner_name>"`: specifies the **name of the scanner** used to generate the report (GitLab Gitleaks or Gitleaks Scan)
44+
8. `-F "branch=<branch_name>"`: (_optional_) specifies the name of the branch in the source code repository (if applicable) This parameter is particularly useful when you want to associate the scan results with a specific branch in your repository. If not provided, the scan will be associated with the default branch
45+
46+
Asset information, if an [auditor ](broken-reference)is used
47+
48+
9. `-F "repository=<repository SSH URL>"`: If your product is **code** in a repository enter the address of your **repository** in a specific format, for example: git@gitlab.com:whitespots-public/appsec-portal.git
49+
10. &#x20;\-F "docker\_image=\<registry address>": If your product is **image** enter the address of the **registry** where your product is located, for example: registry.gitlab.com/whitespots-public/appsec-portal/back/auto\_validator:latest
50+
11. \-F "domain=\<domain>": If your product is **web** enter the **domain name** of your product, for example: whitespots.io
51+
12. \-F "host=\<host>": If your product is **web** enter the **IP address** of your product, for example: 0.0.0.0
52+
53+
**Report example:**
54+
55+
```
56+
Finding: aws_secret="AKIAIMNOJVGFDXXXE4OA"
57+
RuleID: aws-access-token
58+
Secret AKIAIMNOJVGFDXXXE4OA
59+
Entropy: 3.65
60+
File: checks_test.go
61+
Line: 37
62+
Commit: ec2fc9d6cb0954fb3b57201cf6133c48d8ca0d29
63+
Author: Zachary Rice
64+
Email: z@email.com
65+
Date: 2018-01-28T17:39:00Z
66+
Fingerprint: ec2fc9d6cb0954fb3b57201cf6133c48d8ca0d29:checks_test.go:aws-access-token:37
67+
```

0 commit comments

Comments
 (0)