Github API to manage access to Security Alerts?
Asked Answered
H

1

6

After enabling the Dependabot Security Alerts you need to explicitly grant access to alerts in the Security & Analysis settings (https://github.com/[org]/[repository]/settings/security_analysis). By default collaborators don't see the Security "tab" unless they have admin rights to the repository (which we don't use).

Is there a way to do this with the GitHub API or another automated/scriptable way? This doesn't seem to be in the API, and it's not very practical to do manually with 100's of repositories.

Huysmans answered 24/3, 2021 at 13:40 Comment(2)
I see it's possible to get the alerts but can't seem to find a PUT/POST endpoint to activate it. This might not be possible.Westminster
Not through API but there is a way to do it for a single organization (looks like this is what you want to do and not a repo under a user) via one click. See answer belowWestminster
W
0

While this might not be possible via API, for organizations, it appears that you can enable this for all repositories in the organization. There are also settings for private repositories. Go to: https://github.com/organizations/[org]/settings/security_analysis

You should see "Enable all" buttons.

Westminster answered 24/3, 2021 at 14:19 Comment(2)
We have enabled this for all repositories. The issue I have is that there's no way to configure who gets access to the Security Alerts by default, and the configuration needs to be done on each repository, and there's no API currently to support this.Huysmans
.. and if you organized your teams in a nested / tree structure, GitHub does not find all the teamsWindpollinated

© 2022 - 2024 — McMap. All rights reserved.