Skip to content

Alertmanager: Wrong input can wipe config #3142

@s-h-a-d-o-w

Description

@s-h-a-d-o-w

These are two examples I've found of POSTing wrong input to /api/v1/alerts that results in Alertmanager returning 2XX and setting the config to an empty string:

  • Wrong indentation of content
alertmanager_config: |
global: 
  smtp_smarthost: 'localhost:25' 
  smtp_from: '[email protected]' 
route: 
  receiver: asdf
receivers: 
  - name: asdf
    email_configs: 
    - to: '[email protected]' 
  • Invalid field name (note the typo in aalertmanager_config)
aalertmanager_config: |
  global: 
    smtp_smarthost: 'localhost:25' 
    smtp_from: '[email protected]' 
  route: 
    receiver: asdf
  receivers: 
    - name: asdf
      email_configs: 
      - to: '[email protected]' 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions