-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a830b6
commit b13a044
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
|
||
# For use with pre-commit. | ||
# See usage instructions at http://pre-commit.com | ||
|
||
- id: kics | ||
name: Checkmarx Kics | ||
description: This hook runs kics. | ||
entry: kics scan -p . | ||
language: golang | ||
pass_filenames: false | ||
always_run: false | ||
types_or: | ||
- terraform | ||
- dockerfile | ||
- yaml | ||
- json | ||
exclude: '^.*\.terraform.*$' | ||
require_serial: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Running Kics with pre-commmit | ||
|
||
To use `kics` with [pre-commit](https://pre-commit.com) add the following hook to your local repo's `.pre-commit-config.yaml` file. | ||
|
||
```yaml | ||
- repo: https://github.com/Checkmarx/kics | ||
rev: '' # change to correct tag or sha | ||
hooks: | ||
- id: kics | ||
``` | ||
## How to pass extra arguments | ||
You can provide arguments to `kics` by providing the pre-commit `args` [property](https://pre-commit.com/#passing-arguments-to-hooks). The following example will print the `kics scan` output, but will not block regardless of success/failure. | ||
|
||
```yaml | ||
repos: | ||
- repo: https://github.com/Checkmarx/kics | ||
rev: '' # change to correct tag or sha | ||
hooks: | ||
- id: kics | ||
verbose: true | ||
args: [--ignore-on-exit, 'all'] | ||
``` |