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

Detect permission problems #35

Open
cjyar opened this issue Jan 28, 2020 · 1 comment
Open

Detect permission problems #35

cjyar opened this issue Jan 28, 2020 · 1 comment
Labels

Comments

@cjyar
Copy link
Contributor

cjyar commented Jan 28, 2020

According to https://developer.github.com/v3/issues/#create-an-issue:

Only users with push access can set labels for new issues. Labels are silently dropped otherwise.

Scenario:

  • alertmanager-github-receiver is running as a user without permission to push to a repo.
  • An alert is generated, and the program creates an issue. It tries to add labels to the issue, but no labels are added.
  • Alertmanager periodically resends the alert. The next time alertmanager-github-receiver receives it, it checks to see if the issue already exists. It searches based on labels first, so it doesn't find the existing issue.
  • alertmanager-github-receiver creates a duplicate issue.
  • It does so again every time alertmanager resends the alert.

It seems like there are a few things we should/could do:

  1. Warn users that they need to have push permissions for the service account.
  2. Detect insufficient permissions and warn the user.
  3. Refuse to create duplicate issues.
@stephen-soltesz
Copy link
Contributor

re: 1) https://github.com/m-lab/alertmanager-github-receiver#create-github-access-token outlines what permissions are needed for the access token. Unfortunately, "push" is not mentioned on the token allocation page. A note in our readme that points to the link you put here would be welcome.

re: 2) yes, if the client doesn't have sufficient permissions it should not create any issues. That addresses 3) also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants