Skip to content

Commit 59245e3

Browse files
committed
CM-28234 Add SBOM report to the readme
1 parent b6c14c2 commit 59245e3

File tree

1 file changed

+110
-56
lines changed

1 file changed

+110
-56
lines changed

README.md

Lines changed: 110 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,39 @@ This guide will guide you through both installation and usage.
1515
1. [On Unix/Linux](#on-unixlinux)
1616
2. [On Windows](#on-windows)
1717
2. [Install Pre-Commit Hook](#install-pre-commit-hook)
18-
3. [Cycode Command](#cycode-command)
19-
4. [Running a Scan](#running-a-scan)
20-
1. [Repository Scan](#repository-scan)
21-
1. [Branch Option](#branch-option)
22-
2. [Monitor Option](#monitor-option)
23-
3. [Report Option](#report-option)
24-
4. [Package Vulnerabilities Scan](#package-vulnerabilities-option)
25-
1. [License Compliance Option](#license-compliance-option)
26-
2. [Severity Threshold](#severity-threshold)
27-
5. [Path Scan](#path-scan)
28-
1. [Terraform Plan Scan](#terraform-plan-scan)
29-
6. [Commit History Scan](#commit-history-scan)
30-
1. [Commit Range Option](#commit-range-option)
31-
7. [Pre-Commit Scan](#pre-commit-scan)
32-
5. [Scan Results](#scan-results)
33-
1. [Show/Hide Secrets](#showhide-secrets)
34-
2. [Soft Fail](#soft-fail)
35-
3. [Example Scan Results](#example-scan-results)
36-
1. [Secrets Result Example](#secrets-result-example)
37-
2. [IaC Result Example](#iac-result-example)
38-
3. [SCA Result Example](#sca-result-example)
39-
4. [SAST Result Example](#sast-result-example)
40-
6. [Ignoring Scan Results](#ignoring-scan-results)
41-
1. [Ignoring a Secret Value](#ignoring-a-secret-value)
42-
2. [Ignoring a Secret SHA Value](#ignoring-a-secret-sha-value)
43-
3. [Ignoring a Path](#ignoring-a-path)
44-
4. [Ignoring a Secret, IaC, or SCA Rule](#ignoring-a-secret-iac-sca-or-sast-rule)
45-
5. [Ignoring a Package](#ignoring-a-package)
46-
7. [Syntax Help](#syntax-help)
18+
3. [Cycode Command](#cycode-cli-commands)
19+
4. [Scan Command](#scan-command)
20+
1. [Running a Scan](#running-a-scan)
21+
1. [Repository Scan](#repository-scan)
22+
1. [Branch Option](#branch-option)
23+
2. [Monitor Option](#monitor-option)
24+
3. [Report Option](#report-option)
25+
4. [Package Vulnerabilities Scan](#package-vulnerabilities-option)
26+
1. [License Compliance Option](#license-compliance-option)
27+
2. [Severity Threshold](#severity-threshold)
28+
5. [Path Scan](#path-scan)
29+
1. [Terraform Plan Scan](#terraform-plan-scan)
30+
6. [Commit History Scan](#commit-history-scan)
31+
1. [Commit Range Option](#commit-range-option)
32+
7. [Pre-Commit Scan](#pre-commit-scan)
33+
2. [Scan Results](#scan-results)
34+
1. [Show/Hide Secrets](#showhide-secrets)
35+
2. [Soft Fail](#soft-fail)
36+
3. [Example Scan Results](#example-scan-results)
37+
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)
4751

4852
# Prerequisites
4953

@@ -226,9 +230,12 @@ The following are the options and commands available with the Cycode CLI applica
226230
| [configure](#use-configure-command) | Initial command to authenticate your CLI client with Cycode using client ID and client secret. |
227231
| [ignore](#ingoring-scan-results) | Ignore a specific value, path or rule ID. |
228232
| [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. |
229234
| version | Show the version and exit. |
230235

231-
# Running a Scan
236+
# Scan Command
237+
238+
## Running a Scan
232239

233240
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:
234241

@@ -253,7 +260,7 @@ The Cycode CLI application offers several types of scans so that you can choose
253260
| [pre_commit](#pre-commit-scan) | Use this command to scan the content that was not committed yet |
254261
| [repository](#repository-scan) | Scan git repository including its history |
255262

256-
## Repository Scan
263+
### Repository Scan
257264

258265
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.
259266

@@ -271,7 +278,7 @@ The following option is available for use with this command:
271278
|---------------------|-------------|
272279
| `-b, --branch TEXT` | Branch to scan, if not set scanning the default branch |
273280

274-
### Branch Option
281+
#### Branch Option
275282

276283
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.
277284

@@ -283,7 +290,7 @@ or:
283290

284291
`cycode scan repository ~/home/git/codebase --branch dev`
285292

286-
## Monitor Option
293+
### Monitor Option
287294

288295
> :memo: **Note**<br/>
289296
> This option is only available to SCA scans.
@@ -303,7 +310,7 @@ When using this option, the scan results from this scan will appear in the knowl
303310
> :warning: **NOTE**<br/>
304311
> You must be an `owner` or an `admin` in Cycode to view the knowledge graph page.
305312
306-
## Report Option
313+
### Report Option
307314
308315
> :memo: **Note**<br/>
309316
> This option is only available to SCA scans.
@@ -366,7 +373,7 @@ The report page will look something like below:
366373
367374
![](https://raw.githubusercontent.com/cycodehq-public/cycode-cli/main/images/scan_details.png)
368375
369-
## Package Vulnerabilities Option
376+
### Package Vulnerabilities Option
370377
371378
> :memo: **Note**<br/>
372379
> This option is only available to SCA scans.
@@ -381,7 +388,7 @@ or:
381388
382389
`cycode scan --scan-type sca --sca-scan package-vulnerabilities repository ~/home/git/codebase`
383390
384-
### License Compliance Option
391+
#### License Compliance Option
385392
386393
> :memo: **Note**<br/>
387394
> This option is only available to SCA scans.
@@ -396,7 +403,7 @@ or:
396403
397404
`cycode scan --scan-type sca --sca-scan license-compliance repository ~/home/git/codebase`
398405
399-
### Severity Threshold
406+
#### Severity Threshold
400407
401408
> :memo: **Note**<br/>
402409
> This option is only available to SCA scans.
@@ -411,7 +418,7 @@ or:
411418
412419
`cycode scan --scan-type sca --security-threshold MEDIUM repository ~/home/git/codebase`
413420
414-
## Path Scan
421+
### Path Scan
415422
416423
A path scan examines a specific local directory and all the contents within it, instead of focusing solely on a GIT repository.
417424
@@ -424,7 +431,7 @@ For example, consider a scenario in which you want to scan the directory located
424431
`cycode scan path ~/home/git/codebase`
425432
426433
427-
### Terraform Plan Scan
434+
#### Terraform Plan Scan
428435
429436
Cycode CLI supports Terraform plan scanning (supporting Terraform 0.12 and later)
430437
@@ -453,7 +460,7 @@ _How to generate a Terraform plan from Terraform configuration file?_
453460
`cycode scan -t iac path ~/PATH/TO/YOUR/{tfplan}.json`
454461
455462
456-
## Commit History Scan
463+
### Commit History Scan
457464
458465
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.
459466
@@ -471,7 +478,7 @@ The following options are available for use with this command:
471478
|---------------------------|-------------|
472479
| `-r, --commit_range TEXT` | Scan a commit range in this git repository, by default cycode scans all commit history (example: HEAD~1) |
473480
474-
### Commit Range Option
481+
#### Commit Range Option
475482
476483
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.
477484
@@ -483,15 +490,15 @@ OR
483490
484491
`cycode scan commit_history --commit_range {{from-commit-id}}...{{to-commit-id}} ~/home/git/codebase`
485492
486-
## Pre-Commit Scan
493+
### Pre-Commit Scan
487494
488495
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.
489496
490497
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:
491498
492499
`SKIP=cycode git commit -m <your commit message>`
493500
494-
# Scan Results
501+
## Scan Results
495502
496503
Each scan will complete with a message stating if any issues were found or not.
497504
@@ -511,7 +518,7 @@ Secret SHA: a44081db3296c84b82d12a35c446a3cba19411dddfa0380134c75f7b3973bff0
511518
512519
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.
513520
514-
## Show/Hide Secrets
521+
### Show/Hide Secrets
515522
516523
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`.
517524
@@ -533,15 +540,15 @@ Secret SHA: a44081db3296c84b82d12a35c446a3cba19411dddfa0380134c75f7b3973bff0
533540
2 | \ No newline at end of file
534541
```
535542
536-
## Soft Fail
543+
### Soft Fail
537544
538545
Utilizing the soft fail feature will not fail the CI/CD step within the pipeline if the Cycode scan finds an issue. Additionally, in case an issue occurs from Cycode’s side, a soft fail will automatically execute to avoid interference.
539546
540547
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` for scan results to have no impact (result in a `success` result).
541548
542-
## Example Scan Results
549+
### Example Scan Results
543550
544-
### Secrets Result Example
551+
#### Secrets Result Example
545552
546553
```bash
547554
⛔ Found issue of type: generic-password (rule ID: ce3a4de0-9dfc-448b-a004-c538cf8b4710) in file: config/my_config.py
@@ -551,7 +558,7 @@ Secret SHA: a44081db3296c84b82d12a35c446a3cba19411dddfa0380134c75f7b3973bff0
551558
2 | \ No newline at end of file
552559
```
553560
554-
### IaC Result Example
561+
#### IaC Result Example
555562
556563
```bash
557564
⛔ Found issue of type: Resource should use non-default namespace (rule ID: bdaa88e2-5e7c-46ff-ac2a-29721418c59c) in file: ./k8s/k8s.yaml ⛔
@@ -561,7 +568,7 @@ Secret SHA: a44081db3296c84b82d12a35c446a3cba19411dddfa0380134c75f7b3973bff0
561568
9 | resourceVersion: "4228"
562569
```
563570
564-
### SCA Result Example
571+
#### SCA Result Example
565572
566573
```bash
567574
⛔ 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 ⛔
@@ -571,7 +578,7 @@ Secret SHA: a44081db3296c84b82d12a35c446a3cba19411dddfa0380134c75f7b3973bff0
571578
3 | cleo==1.0.0a5
572579
```
573580
574-
### SAST Result Example
581+
#### SAST Result Example
575582
576583
```bash
577584
⛔ 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 ⛔
@@ -581,7 +588,7 @@ Secret SHA: a44081db3296c84b82d12a35c446a3cba19411dddfa0380134c75f7b3973bff0
581588
4 | print(res.content)
582589
```
583590
584-
# Ignoring Scan Results
591+
## Ignoring Scan Results
585592
586593
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.
587594
@@ -612,7 +619,7 @@ Secret SHA: a44081db3296c84b82d12a35c446a3cba19411dddfa0380134c75f7b3973bff0
612619
613620
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.
614621
615-
## Ignoring a Secret Value
622+
### Ignoring a Secret Value
616623
617624
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:
618625
@@ -624,7 +631,7 @@ In the example at the top of this section, the command to ignore a specific secr
624631
625632
In the example above, replace the `h3110w0r1d!@#$350` value with your non-masked secret value. See the Cycode scan options for details on how to see secret values in the scan results.
626633
627-
## Ignoring a Secret SHA Value
634+
### Ignoring a Secret SHA Value
628635
629636
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:
630637
@@ -636,7 +643,7 @@ In the example at the top of this section, the command to ignore a specific secr
636643
637644
In the example above, replace the `a44081db3296c84b82d12a35c446a3cba19411dddfa0380134c75f7b3973bff0` value with your secret SHA value.
638645
639-
## Ignoring a Path
646+
### Ignoring a Path
640647
641648
To ignore a specific path for either secret, IaC, or SCA scans, you will need to use the `--by-path` flag in 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:
642649
@@ -664,7 +671,7 @@ In the example at the top of this section, the command to ignore a specific path
664671
665672
In the example above, replace the `~/home/my-repo/config` value with your path value.
666673
667-
## Ignoring a Secret, IaC, SCA, or SAST Rule
674+
### Ignoring a Secret, IaC, SCA, or SAST Rule
668675
669676
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:
670677
@@ -692,7 +699,7 @@ In the example at the top of this section, the command to ignore the specific SC
692699
693700
In the example above, replace the `dc21bc6b-9f4f-46fb-9f92-e4327ea03f6b` value with the rule ID you want to ignore.
694701
695-
## Ignoring a Package
702+
### Ignoring a Package
696703
697704
> :memo: **Note**<br/>
698705
> 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
711718
712719
In the example above, replace `pyyaml` with package name and `5.3.1` with the package version you want to ignore.
713720
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:
729+
| Option | Description | Required | Default |
730+
|---------------------|-------------|----------|---------|
731+
| `-f, --format [spdx-2.2\|spdx-2.3\|cyclonedx-1.4]` | SBOM format | Yes | |
732+
| `-o, --output-format [JSON]` | Specify the output file format | No | json |
733+
| `--output-file PATH` | Output file | No | autogenerated filename saved to the current directory |
734+
| `--include-vulnerabilities` | Include vulnerabilities | No | False |
735+
| `--include-dev-dependencies` | Include dev dependencies | No | False |
736+
737+
The following commands are available for use with this command:
738+
| Command | Description |
739+
|---------------------|-------------|
740+
| `path` | Generate SBOM report for provided path in the command |
741+
| `repository_url` | Generate SBOM report for provided repository URI in the command |
742+
743+
### Repository
744+
745+
To create an SBOM report for a repository URI:\
746+
`cycode report sbom --format <sbom format> --include-vulnerabilities --include-dev-dependencies --output-file </path/to/file> repository_url <repository url>`
747+
748+
For example:\
749+
`cycode report sbom --format spdx-2.3 --include-vulnerabilities --include-dev-dependencies repository_url https://github.com/cycodehq-public/cycode-cli.git`
750+
751+
### Local Project
752+
753+
To create an SBOM report for a path:\
754+
`cycode report sbom --format <sbom format> --include-vulnerabilities --include-dev-dependencies --output-file </path/to/file> path </path/to/project>`
755+
756+
For example:\
757+
`cycode report sbom --format spdx-2.3 --include-vulnerabilities --include-dev-dependencies path /path/to/local/project`
758+
714759
# Syntax Help
715760
716761
You may add the `--help` argument to any command at any time to see a help message that will display available options and their syntax.
@@ -734,3 +779,12 @@ For example, to see options available for a Path Scan, you would simply enter:
734779
To see the options available for the ignore scan function, use this command:
735780
736781
`cycode ignore --help`
782+
783+
To see the options available for report, use this command:
784+
785+
`cycode report --help`
786+
787+
788+
To see the options available for a specific type of report, enter:
789+
790+
`cycode scan {{option}} --help`

0 commit comments

Comments
 (0)