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

silenceForm required labels #2001

Closed
itatabitovski opened this issue Jul 29, 2020 · 5 comments · Fixed by #2155
Closed

silenceForm required labels #2001

itatabitovski opened this issue Jul 29, 2020 · 5 comments · Fixed by #2155
Assignees
Labels
enhancement New feature or request

Comments

@itatabitovski
Copy link

I was not able to find something like this in the configuration.

It would be very useful to be able to select required labels that must be filled in when adding a silence (e.g. team).

Something like:

silenceForm:
  required:
    - name:
      value: 
      value_re:
@prymitive
Copy link
Owner

You could potentially use ACLs for that:

  - action: requireMatcher
    reason: db users must pass team=db
    scope:
      groups:
        - db
    matchers:
      required:
        - name: team
          value: db

@itatabitovski
Copy link
Author

I have the following ACL, but even if i specify the label team karma prevents adding the silence.

rules:
  - action: requireMatcher
    reason: must specify label team
    matchers:
      required:
        - name: team
          value: .+
          isRegex: true
DEBU[0028] [dev] Proxy request /proxy/alertmanager/dev/api/v2/silences
DEBU[0028] ACL 0: isAllowed=false err=silence blocked by ACL rule: must specify label team
WARN[0028] [dev] proxy request 'POST /proxy/alertmanager/dev/api/v2/silences' was blocked by ACL rule: silence blocked by ACL rule: must specify label team

@prymitive
Copy link
Owner

Right, that's because value is the exact value that's required in the matcher, not a regex rule to match value against.
I need look into it to refresh my memory, but might just add name_re and value_re to the matchers:required to allow regexes there.

@github-actions
Copy link

github-actions bot commented Dec 1, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants