Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

feat(ci): Trigger security scanner from release pipeline#63280

Merged
Chickensoupwithrice merged 3 commits into
mainfrom
al/rel-100-security-automation
Jun 19, 2024
Merged

feat(ci): Trigger security scanner from release pipeline#63280
Chickensoupwithrice merged 3 commits into
mainfrom
al/rel-100-security-automation

Conversation

@Chickensoupwithrice

@Chickensoupwithrice Chickensoupwithrice commented Jun 14, 2024

Copy link
Copy Markdown
Contributor

Resolves REL-100 by calling the security scanner as part of the release pipeline, during the internal image creation time.

@willdollman kindly dropped me some notes on how to use this, notably in this PR I've removed dryRun=true given how this will only be run from the release process. I'm also using a tag with no images listed.

I've added the token will sent me to 1Password under image-scanner-webhook and added a check to ensure it exists when being called.

Will's Notes:

curl --location 'https://incoming.sgdev.org/new-image-scan?images=sourcegraph%2Fgitserver%2Csourcegraph%2Ffrontend&tag=5.3.0&scanType=release&dev=true&dryRun=true' \
--header 'X-Special-Header: <key-shared-in-1password>'

it’s not quite set up for releases yet, but you can play around - results are sent to elastic which you don’t have access to, and there’s no api to get the results

to scan everything at a specific tag, remove the images parameter and set tag to the image tag

dryRun=true will ensure it doesn’t actually run a scan, but will still return a json response - best to leave that enabled while you’re working on it otherwise you’ll trigger lots of scans 😛

Test plan

Ran sg release create --version=auto --pretend to ensure the script still works

Changelog

  • Added security scanner to the release pipeline

@cla-bot cla-bot Bot added the cla-signed label Jun 14, 2024
@Chickensoupwithrice Chickensoupwithrice requested review from a team, jdpleiness and willdollman and removed request for a team June 14, 2024 23:32

@craigfurman craigfurman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Sweet!

Is --pretend enough to truly test this? It doesn't trigger the pipeline that will run this step, if I understand correctly?

Could we create an internal release to kick the tires on this before the next real release, or is that too heavyweight?

@jdpleiness

Copy link
Copy Markdown
Contributor

🚀 Sweet!

Is --pretend enough to truly test this? It doesn't trigger the pipeline that will run this step, if I understand correctly?

Could we create an internal release to kick the tires on this before the next real release, or is that too heavyweight?

Kicking off an internal release to test this seems like a good idea to me 🚢

@Chickensoupwithrice

Copy link
Copy Markdown
Contributor Author

I'll kick off an internal release too, y'all right!

I also just remembered this step runs on Buildkite, so I'm gonna need to put the secret into secrets manager and import it in https://github.com/sourcegraph/infrastructure

@Chickensoupwithrice

Copy link
Copy Markdown
Contributor Author

Okay, infrastructure PR created

@willdollman willdollman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@Chickensoupwithrice

Copy link
Copy Markdown
Contributor Author

Triggered a development build with security scanning enabled: https://buildkite.com/sourcegraph/sourcegraph/builds/279073
The security step passed which satisfies my appetite to ensure this won't break the process tomorrow :)

@Chickensoupwithrice Chickensoupwithrice enabled auto-merge (squash) June 19, 2024 19:11
@Chickensoupwithrice Chickensoupwithrice merged commit c82fd5c into main Jun 19, 2024
@Chickensoupwithrice Chickensoupwithrice deleted the al/rel-100-security-automation branch June 19, 2024 19:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants