Skip to content

Commit

Permalink
doc changes related to exit codes
Browse files Browse the repository at this point in the history
  • Loading branch information
patilpankaj212 committed Aug 19, 2021
1 parent b0e1b2b commit 085038b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,16 @@ To scan your code for security issues you can run the following (defaults to sca
```sh
$ terrascan scan
```
**Note**: Terrascan will exit with an error code 3 if any issues are found during a scan.

**Note**: Terrascan will exit with an error code if any errors or violations are found during a scan.

#### List of possible Exit Codes
| Scenario | Exit Code |
| ----------- | ----------- |
| scan summary has errors and violations | 5 |
| scan summary has errors but no violations | 4 |
| scan summary has violations but no errors | 3 |
| scan summary has no violations or errors | 0 |
| scan command errors out due to invalid inputs | 1 |
### Step 3: Integrate with CI\CD

Terrascan can be integrated into CI/CD pipelines to enforce security best practices.
Expand Down
11 changes: 10 additions & 1 deletion docs/usage/command_line_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,16 @@ When scanning Terraform code, Terrascan checks for the availability of the file

By default, Terrascan output is displayed in a human friendly format. Use the `-o` flag to change this to **YAML**, **JSON**, **XML**, **JUNIT-XML** and **SARIF** formats.

> **Note**: Terrascan exits with error code 3 if any issues are found during a scan.
> **Note**: Terrascan will exit with an error code if any errors or violations are found during a scan.
> #### List of possible Exit Codes
> | Scenario | Exit Code |
> | ----------- | ----------- |
> | scan summary has errors and violations | 5 |
> | scan summary has errors but no violations | 4 |
> | scan summary has violations but no errors | 3 |
> | scan summary has no violations or errors | 0 |
> | scan command errors out due to invalid inputs | 1 |

Terrascan's output is a list of security violations present in the scanned IaC files. The example below is terrascan's output in YAML.
Expand Down

0 comments on commit 085038b

Please sign in to comment.