elastic / cloudbeat

Analyzing Cloud Security Posture
Other
39 stars 43 forks source link

automate snyk branch monitoring #2258

Closed orouz closed 1 month ago

orouz commented 4 months ago

Motivation we always monitor main and latest release branch, so every release we need to add the new release branch to the monitored projects on snyk. we can automate this with a workflow whenever a new release branch is created

example of adding main as a monitored branch:

curl -X POST \
  https://api.snyk.io/v1/org/orgId/integrations/integrationId/import \
  -H 'Content-Type: application/json; charset=utf-8' \
  -H 'Authorization: token API_KEY' \
  -d '{
  "target": {
    "owner": "elastic",
    "name": "cloudbeat",
    "branch": "main"
  },
  "exclusionGlobs": "deploy, scripts, tests, security-policies"
}'

we also need to figure out one of the following:

  1. how to delete a branch (previous release), so we can just add the new release branch
  2. how to delete the entire repo, so we can re-add main and the new release branch

Definition of done

Related