Skip to content

Receivers can be set in the webhook request's to override the default config from the environment #7

@alexanderadam

Description

@alexanderadam

This is actually just moved from #6 (because it's not really related to Slack anyway):

You wrote:

Yes, currently this is the only way the receivers are specified. But one of the changes i want to implement (i wanted to spend some time with it tomorrow actually) is, that the receivers can be set in the webhook request's to override the default config from the environment. Since we can't specify the URL/paramters for the slack integration freely (as far as i understood it correctly, i haven't checked the documentaion yet) this won't be possible in the same way as for Grafana/Prometheus...

I thought about this as well and my initial thought was that someone could just spin a second container with other credentials.

But you are absolutely right that it would be much nicer to have just one instance that listens with different configurations.
Not only for Slack but also for Prometheus and Grafana. Because if the container is exposed outside and an attacker knows that such service is running, he could easily flood your MUC with requests. So it would make sense to add a long non guessable path to the URL anyway.

So to have an example how Slack webhook urls look like:

3dd9f78-image02

You can't easily guess those and therefore not easily spam your channels.

Maybe the easiest thing would be to persist the hook-configuration (the auth stuff could still be set via environment variable) in some kind of config file. For example:

webhooks:
- type: prometheus
  - channel: '[email protected]'
  - url: '/foo/bar/baz/6486'
- type: grafana
  - channel: '[email protected]'
  - url: '/eene/meene/mu'

But it should be mentioned that it is recommended to use a random part in the URL (i.e. by calling openssl rand -hex 23).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions