Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(integrations): add CircleCI integration example #3086

Merged
merged 2 commits into from
May 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/img/circleci-artifacts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/circleci-build.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/circleci-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Integrate KICS with:

- [Azure Pipelines](integrations_azurepipelines.md)
- [Bitbucket Pipelines](integrations_bitbucketpipelines.md)
- [CircleCI](integrations_circleci.md)
- [Github Actions](integrations_ghactions.md)
- [GitLab CI](integrations_gitlabci.md)
- [Jenkins](integrations_jenkins.md)
Expand Down
47 changes: 47 additions & 0 deletions docs/integrations_circleci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Running KICS in CircleCI

You can integrate KICS into your CircleCI workflows.

This document provides you with an example on how to run KICS scans in a pipeline.

## Example setup with GitHub:

Enable CircleCI to access your personal profile or GitHub organization.

Create a `.circleci` directory in your project's root and place a `config.yaml` inside:

```yaml
version: 2.1
jobs:
kics:
docker:
- image: checkmarx/kics:latest-alpine
steps:
- checkout
- run:
name: Run KICS
command: |
/app/bin/kics scan -p ${PWD} -o ~/results.json --ci
- store_artifacts:
path: ~/results.json

workflows:
version: 2
build:
jobs:
# etc...
- kics

```

After running a pipeline, you will be able to see "Run KICS" step inside workflow's details:

<img src="https://raw.githubusercontent.com/Checkmarx/kics/master/docs/img/circleci-build.png" width="850">

Go to the artifacts tab to inspect the results:

<img src="https://raw.githubusercontent.com/Checkmarx/kics/master/docs/img/circleci-artifacts.png" width="850">

Results will be displayed in plain text:

<img src="https://raw.githubusercontent.com/Checkmarx/kics/master/docs/img/circleci-results.png" width="850">
2 changes: 1 addition & 1 deletion docs/integrations_jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

You can integrate KICS into your Jenkins CI/CD pipelines.

This provides you the ability to run KICS scans in as a stage in your pipeline.
This provides you the ability to run KICS scans as a stage in your pipeline.

## Declarative pipelines:

Expand Down
20 changes: 20 additions & 0 deletions examples/circleci/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2.1
jobs:
kics:
docker:
- image: checkmarx/kics:latest-alpine
steps:
- checkout
- run:
name: Run KICS
command: |
/app/bin/kics scan -p ${PWD} -o ~/results.json --ci
- store_artifacts:
path: ~/results.json

workflows:
version: 2
build:
jobs:
# etc...
- kics