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

Implement Scanner for GCP Artifact Registry Scanning #63

Draft
wants to merge 80 commits into
base: main
Choose a base branch
from

Conversation

Collinbrown95
Copy link
Contributor

@Collinbrown95 Collinbrown95 commented Nov 6, 2023

Closes #62

The Artifact Registry, if configured, will scan containers on push to the registry. We're going to use this, along with a cloud function/ pubsub to push these scan results from the various (registered) projects to the Observatory's GCS (as seen in this tutorial. When there's a change to the Observatory GCS, (or rather whenever there is an addition if we're putting time limits on storage, and auto-removing), it will trigger another google pubsub to push results to Observatory's scanner which parses the payload into the form (checkPasses, metadata) and saves into the database via API.

Issues encountered at the moment:
We can easily get the vulnerability Artifact Registry occurrence summary for the project with

curl -X GET -H "Content-Type: application/json" -H \
    "Authorization: Bearer $(gcloud auth print-access-token)" \
    https://containeranalysis.googleapis.com/v1/projects/phx-01h1yptgmche7jcy01wzzpw2rf/occurrences:vulnerabilitySummary

Or just one image with:

gcloud artifacts docker images list --show-occurrences \
--occurrence-filter='kind="VULNERABILITY"' --format=json \
northamerica-northeast1-docker.pkg.dev/phx-01h1yptgmche7jcy01wzzpw2rf/hello-world-app2/hello-world-three

, but using cloud function, so using google grafeas API which seems to be less flexible, and would like to somehow include the container image name in the cloud function, or have a simple summary. (or maybe just the most recent tag as it pulls all occurrences over)

  • Decide if going the security command centre or GCS route
  • Configure GCS to be deleted after a set time period
  • Get image name in cloud function
  • configure second cloud function/ pubsub on GCS
  • Process payload
  • Since this is just push, include a pull route as well triggered by NATs event.

LilaKelland and others added 30 commits November 1, 2023 18:40
- test rustworkx for in-memory graph creation
- misc. python boilerplate
Collinbrown95 and others added 24 commits November 6, 2023 21:01
- semantics are to get the unique vertices for all subgraphs associated with a list of endpoints
- pass json encoder to publishToNats function
…to see which iteration is resulting. Will retry tomorrow with fresh history. - next sub to gcp pub/sub and extract information - note not sure how to have a pass here as there's no push for no vulnerabilities... Also will need to isolate image to one registered with product.
@Collinbrown95 Collinbrown95 marked this pull request as draft November 7, 2023 15:33
…and viewing cloud function logs, will rename files to be image name rather than occurance_id in next iteration
…o get note, but not super useful - need to combine google doc references in artifact-registry-cloud-function-init.sh together to get to work - moving to git-leaks, will come back after a quick win.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Artifact Registry Container Scanner
2 participants