-
Notifications
You must be signed in to change notification settings - Fork 8
Update to README and remove requirement that bucket names start with codeguru-reviewer #3
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
Changes from all commits
29b0da1
b65b0aa
9959fc4
d0d24a6
3f0e2cb
a87c09d
69f460f
b248dfb
afda619
95261b6
e414cef
a18e516
d943a34
6c54b31
dc82d8e
bc29f51
7242223
fbe710c
87e37af
e9c4d39
26d33e7
94735b7
9732a40
7416eef
5e1305a
9c43535
030823e
c71b9f4
4966c48
c974590
9b31d0a
6976f2d
de2f054
92500e1
2d6d824
12ca35b
4c414c4
bc7ed68
7751653
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,7 +72,53 @@ located under `./src`. The option `--output ./output` specifies where CodeGuru s | |
| CodeGuru produces a Json and Html report. | ||
|
|
||
| You can provide your own bucket name using the `--bucket-name` option. Note that, currently, CodeGuru Reviewer only | ||
| accepts bucket names that start with the prefix `codeguru-reviewer-`. | ||
| supports bucket names that start with the prefix `codeguru-reviewer-` out of the box. If you choose a different naming | ||
| pattern for your bucket you need to: | ||
| 1. Grant `S3:GetObject` permissions on their S3 bucket to `codeguru-reviewer.amazonaws.com` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/their/the/ ? |
||
| 2. If you are using SSE on the S3 bucket, Grant `KMS::Decrypt` permissions to `codeguru-reviewer.amazonaws.com` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: s/Grant/grant/ |
||
|
|
||
| ### Using Encryption | ||
|
|
||
| CodeGuru Reviewer allows you to use a customer managed key (CMCMK) to encrypt content of the S3 bucket that is used | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/to encrypt content of the/to encrypt the content of the/ |
||
| to store source and build artifacts, and all metadata and recommendations that are produced by CodeGuru Reviewer. | ||
| First, create a customer owned key in KMS. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/customer owned/customer managed/ ? https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk |
||
| You need to grant CodeGuru Reviewer permission to decrypt artifacts with this key by adding the | ||
| following Statement to your Key policy: | ||
|
|
||
| ```json | ||
| { | ||
| "Sid": "Allow CodeGuru to use the key to decrypt artifact", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: replace "artifact" with "artifacts" (or with "the artifact" if just one) |
||
| "Effect": "Allow", | ||
| "Principal": { | ||
| "AWS": "*" | ||
| }, | ||
| "Action": [ | ||
| "kms:Decrypt", | ||
| "kms:DescribeKey" | ||
| ], | ||
| "Resource": "*", | ||
| "Condition": { | ||
| "StringEquals": { | ||
| "kms:ViaService": "codeguru-reviewer.amazonaws.com", | ||
| "kms:CallerAccount": [Your AWS ACCOUNT ID] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
| Then, enable server-side for the bucket that you are using with CodeGuru Reviewer. The bucket name should be | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/enable server-side/enable server-side encryption/ |
||
| `codeguru-reviewer-cli-[YOUR ACCOUNT]-[YOUR REGION]`, unless you provided a custom name. For encryption, use the | ||
| KMS key that you created in the previous step. | ||
|
|
||
| Now you can analyze a repository by providing the KMS key ID (not the alias). For example: | ||
| ``` | ||
| codeguru-reviewer -r ./ -kms 12345678-abcd-abcd-1234-1234567890ab | ||
| ``` | ||
| The first time you analyze a repository with the CodeGuru Reviewer CLI, a new association will be created and | ||
| the provided key will be associated with this repository. Fur subsequent scans, you do not need to provide the | ||
| key again. Note that you can start using a key after the repository is already associated. If you want to switch | ||
| from not using a key to using a key, you need to delete the existing association first in the AWS Console and | ||
| then trigger a new scan with the CLI where you provide the key. | ||
|
|
||
|
|
||
| ### Running from CI/CD | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last time I had both of
pushandpull_requestenabled (unrestricted, like here, for both events in all branches), I quickly realized that doing so triggered a LOT of analyses. Everypushto a feature branch with an open PR also counts as apull_requestevent, so you end up running 2x Guru for each push to any PR.Have you considered unrestricted
pull_request, butpushonly formain?