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
1.[Secrets Result Example](#secrets-result-example)
38
+
2.[IaC Result Example](#iac-result-example)
39
+
3.[SCA Result Example](#sca-result-example)
40
+
4.[SAST Result Example](#sast-result-example)
41
+
3.[Ignoring Scan Results](#ignoring-scan-results)
42
+
1.[Ignoring a Secret Value](#ignoring-a-secret-value)
43
+
2.[Ignoring a Secret SHA Value](#ignoring-a-secret-sha-value)
44
+
3.[Ignoring a Path](#ignoring-a-path)
45
+
4.[Ignoring a Secret, IaC, or SCA Rule](#ignoring-a-secret-iac-sca-or-sast-rule)
46
+
5.[Ignoring a Package](#ignoring-a-package)
47
+
5.[Report command](#report-command)
48
+
1.[Generating Report](#generating-report)
49
+
2.[Report Result](#report-results)
50
+
6.[Syntax Help](#syntax-help)
47
51
48
52
# Prerequisites
49
53
@@ -226,9 +230,12 @@ The following are the options and commands available with the Cycode CLI applica
226
230
| [configure](#use-configure-command) | Initial command to authenticate your CLI client with Cycode using client ID and client secret. |
227
231
| [ignore](#ingoring-scan-results) | Ignore a specific value, path or rule ID. |
228
232
| [scan](#running-a-scan) | Scan content for secrets/IaC/SCA/SAST violations. You need to specify which scan type: `ci`/`commit_history`/`path`/`repository`/etc. |
233
+
| [report](#running-a-report) | Generate report for SCA SBOM. |
229
234
| version | Show the version and exit. |
230
235
231
-
# Running a Scan
236
+
# Scan Command
237
+
238
+
## Running a Scan
232
239
233
240
The Cycode CLI application offers several types of scans so that you can choose the option that best fits your case. The following are the current options and commands available:
234
241
@@ -253,7 +260,7 @@ The Cycode CLI application offers several types of scans so that you can choose
253
260
| [pre_commit](#pre-commit-scan) | Use this command to scan the content that was not committed yet |
254
261
| [repository](#repository-scan) | Scan git repository including its history |
255
262
256
-
## Repository Scan
263
+
### Repository Scan
257
264
258
265
A repository scan examines an entire local repository for any exposed secrets or insecure misconfigurations. This more holistic scan type looks at everything: the current state of your repository and its commit history. It will look not only for secrets that are currently exposed within the repository but previously deleted secrets as well.
259
266
@@ -271,7 +278,7 @@ The following option is available for use with this command:
271
278
|---------------------|-------------|
272
279
|`-b, --branch TEXT`| Branch to scan, if not set scanning the default branch |
273
280
274
-
### Branch Option
281
+
#### Branch Option
275
282
276
283
To scan a specific branch of your local repository, add the argument `-b` (alternatively, `--branch`) followed by the name of the branch you wish to scan.
A commit history scan is limited to a local repository’s previous commits, focused on finding any secrets within the commit history, instead of examining the repository’s current state.
459
466
@@ -471,7 +478,7 @@ The following options are available for use with this command:
471
478
|---------------------------|-------------|
472
479
| `-r, --commit_range TEXT` | Scan a commit range in this git repository, by default cycode scans all commit history (example: HEAD~1) |
473
480
474
-
### Commit Range Option
481
+
#### Commit Range Option
475
482
476
483
The commit history scan, by default, examines the repository’s entire commit history, all the way back to the initial commit. You can instead limit the scan to a specific commit range by adding the argument `--commit_range` followed by the name you specify.
A pre-commit scan automatically identifies any issues before you commit changes to your repository. There is no need to manually execute this scan; simply configure the pre-commit hook as detailed under the Installation section of this guide.
489
496
490
497
After your install the pre-commit hook and, you may, on occasion, wish to skip scanning during a specific commit. Simply add the following to your `git` command to skip scanning for a single commit:
491
498
492
499
`SKIP=cycode git commit -m <your commit message>`
493
500
494
-
# Scan Results
501
+
## Scan Results
495
502
496
503
Each scan will complete with a message stating if any issues were found or not.
In the event an issue is found, review the file in question for the specific line highlighted by the result message. Implement any changes required to resolve the issue, then execute the scan again.
513
520
514
-
## Show/Hide Secrets
521
+
### Show/Hide Secrets
515
522
516
523
In the above example, a secret was found in the file `secret_test`, located in the subfolder `cli`. The second part of the message shows the specific line the secret appears in, which in this case is a value assigned to `googleApiKey`.
Utilizing the soft fail feature will not fail the CI/CD step within the pipeline if the Cycode scan finds an issue. Additionally, incase an issue occurs from Cycode’s side, a soft fail will automatically execute to avoid interference.
539
546
540
547
Add the `--soft-fail` argument to any type of scan to configure this feature, then assign a value of `1`if you want found issues to result in a failure within the CI/CD tool or `0`forscan results to have no impact (resultin a `success` result).
541
548
542
-
## Example Scan Results
549
+
### Example Scan Results
543
550
544
-
### Secrets Result Example
551
+
#### Secrets Result Example
545
552
546
553
```bash
547
554
⛔ Found issue of type: generic-password (rule ID: ce3a4de0-9dfc-448b-a004-c538cf8b4710) in file: config/my_config.py
⛔ Found issue of type: Security vulnerability in package 'pyyaml' referenced in project 'Users/myuser/my-test-repo': Improper Input Validation in PyYAML (rule ID: d003b23a-a2eb-42f3-83c9-7a84505603e5) in file: Users/myuser/my-test-repo/requirements.txt ⛔
⛔ Found issue of type: Detected a request using 'http://'. This request will be unencrypted, and attackers could listen into traffic on the network and be able to obtain sensitive information. Use 'https://' instead. (rule ID: 3fbbd34b-b00d-4415-b9d9-f861c076b9f2) in file: ./requests.py ⛔
Ignore rules can be added to ignore specific secret values, specific SHA512 values, specific paths, and specific Cycode secret and IaC rule IDs. This will cause the scan to not alert these values. The ignore rules are written and saved locally in the `./.cycode/config.yaml` file.
If this is a value that is not a valid secret, then use the the `cycode ignore`command to ignore the secret by its value, SHA value, specific path, or rule ID. If this is an IaC scan, then you can ignore that result by its path or rule ID.
614
621
615
-
## Ignoring a Secret Value
622
+
### Ignoring a Secret Value
616
623
617
624
To ignore a specific secret value, you will need to use the `--by-value` flag. This will ignore the given secret value from all future scans. Use the following command to add a secret value to be ignored:
618
625
@@ -624,7 +631,7 @@ In the example at the top of this section, the command to ignore a specific secr
624
631
625
632
In the example above, replace the `h3110w0r1d!@#$350` value with your non-masked secret value. See the Cycode scan options fordetails on how to see secret valuesin the scan results.
626
633
627
-
## Ignoring a Secret SHA Value
634
+
### Ignoring a Secret SHA Value
628
635
629
636
To ignore a specific secret SHA value, you will need to use the `--by-sha` flag. This will ignore the given secret SHA value from all future scans. Use the following command to add a secret SHA value to be ignored:
630
637
@@ -636,7 +643,7 @@ In the example at the top of this section, the command to ignore a specific secr
636
643
637
644
In the example above, replace the `a44081db3296c84b82d12a35c446a3cba19411dddfa0380134c75f7b3973bff0` value with your secret SHA value.
638
645
639
-
## Ignoring a Path
646
+
### Ignoring a Path
640
647
641
648
To ignore a specific path foreither secret, IaC, or SCA scans, you will need to use the `--by-path` flagin conjunction with the `-t, --scan-type` flag (you must specify the scan type). This will ignore the given path from all future scans for the given scan type. Use the following command to add a path to be ignored:
642
649
@@ -664,7 +671,7 @@ In the example at the top of this section, the command to ignore a specific path
664
671
665
672
In the example above, replace the `~/home/my-repo/config` value with your path value.
666
673
667
-
## Ignoring a Secret, IaC, SCA, or SAST Rule
674
+
### Ignoring a Secret, IaC, SCA, or SAST Rule
668
675
669
676
To ignore a specific secret, IaC, SCA, or SAST rule, you will need to use the `--by-rule` flag in conjunction with the `-t, --scan-type` flag (you must specify the scan type). This will ignore the given rule ID value from all future scans. Use the following command to add a rule ID value to be ignored:
670
677
@@ -692,7 +699,7 @@ In the example at the top of this section, the command to ignore the specific SC
692
699
693
700
In the example above, replace the `dc21bc6b-9f4f-46fb-9f92-e4327ea03f6b` value with the rule ID you want to ignore.
694
701
695
-
## Ignoring a Package
702
+
### Ignoring a Package
696
703
697
704
> :memo: **Note**<br/>
698
705
> This option is only available to the SCA scans.
@@ -711,6 +718,44 @@ In the example below, the command to ignore a specific SCA package is as follows
711
718
712
719
In the example above, replace `pyyaml` with package name and `5.3.1` with the package version you want to ignore.
713
720
721
+
# Report Command
722
+
723
+
## Generating SBOM Report
724
+
725
+
A software bill of materials (SBOM) is an inventory of all constituent components and software dependencies involved in the development and delivery of an application.
726
+
Using this command you can create an SBOM report for your local project or for your repository URI.
727
+
728
+
The following options are available for use with this command:
0 commit comments