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: update gitlab cloud example to do diffscan on mr #1461

Merged
merged 2 commits into from
Jan 24, 2024
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
7 changes: 6 additions & 1 deletion docs/_data/examples/ci/gitlab/cloud.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
bearer:
bearer_cloud:
image:
name: bearer/bearer
entrypoint: [""]
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
variables:
BEARER_DIFF: 1
script: bearer scan . --api-key=$BEARER_TOKEN
9 changes: 9 additions & 0 deletions docs/guides/bearer-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ Set up the [GitLab CI/CD configuration](/guides/gitlab), then adjust your settin

We recommend using [GitLab's CI/CD variables](https://docs.gitlab.com/ee/ci/variables/) to protect your token. In the example above, the variable is named `BEARER_TOKEN`.

#### Enhanced Integration

Once the above is configured and your first scan is complete, visit the integrations section to configure our direct GitLab integration. This gives developers the ability to ignore findings directly in the MR workflow, and for your Security team to review those in the Bearer Cloud Dashboard. Setup is done per project with the following steps:

- Create an access token with the ‘api’ scope and ‘maintainer’ role. We recommend using a [project access token](https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html).
- Enter the details for your desired project.
- Behind the scenes, we validate the token and automatically create and configure a webhook to capture MR events.
- Open an MR and see bearer findings directly in the comments!

### Local projects

Use the `--api-key` flag with the `scan` command:
Expand Down
Loading