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

Add forwarder plugin for federated Alerta #1161

Merged
merged 2 commits into from
Apr 30, 2020
Merged

Conversation

satterly
Copy link
Member

@satterly satterly commented Feb 25, 2020

Add alert, action and delete forwarder plugin for federated Alerta environments

An example config for 2 x MoM (Manager-of-Managers) and 2 x MLMs (Mid-Level Managers) can be found in examples/plugins/forwarder

Minimal server config ...

BASE_URL='http://mlm1.local.alerta.io:10001'   # must match actual server name and port
PLUGINS=['forwarder']

Example forwarding config...

FWD_DESTINATIONS = [
    ('http://localhost:9000', {'username': 'user', 'password': 'pa55w0rd', 'timeout': 10}, ['alerts', 'actions']),  # BasicAuth
    # ('https://httpbin.org/anything', dict(username='foo', password='bar', ssl_verify=False), ['*']),
    ('http://localhost:9001', {
        'key': 'e3b8afc0-db18-4c51-865d-b95322742c5e',
        'secret': 'MDhjZGMyYTRkY2YyNjk1MTEyMWFlNmM3Y2UxZDU1ZjIK'
    }, ['actions']),  # Hawk HMAC
    ('http://localhost:9002', {'key': 'demo-key'}, ['delete']),  # API key
    ('http://localhost:9003', {'token': 'bearer-token'}, ['*']),  # Bearer token
]

Note: It is recommended to use HMAC Auth for federated Alerta as the credentials don't need to be associated with any users, and do not expire.

To generate HMAC key and secret, it is useful to use UUID for key and base64 encoded string for secret so that they are visibly different.

On macOs, run:

$ uuidgen | tr '[:upper:]' '[:lower:]'         <= create HMAC "key"
58e7c66f-b990-4610-9496-60eb3c63339b
$ date | md5 | base64                        <= create HMAC "secret"
MzVlMzQ5NWYzYWE2YTgxYTUyYmIyNDY0ZWE2ZWJlYTMK

Fixes #1147 #1153

@satterly satterly changed the title Add alert and action forwarder plugin for federated Alerta environments Add forwarder plugin for federated Alerta environments Feb 25, 2020
@satterly satterly changed the title Add forwarder plugin for federated Alerta environments Add forwarder plugin for federated Alerta Feb 25, 2020
@coveralls
Copy link

coveralls commented Feb 25, 2020

Coverage Status

Coverage decreased (-1.06%) to 73.01% when pulling f893b2c on alert-forwarder-plugin into 1c23c6a on master.

@satterly satterly force-pushed the master branch 2 times, most recently from ddbb421 to 33723c0 Compare April 28, 2020 05:38
@satterly satterly force-pushed the alert-forwarder-plugin branch 7 times, most recently from edc3a43 to 814b023 Compare April 30, 2020 09:00
@satterly satterly merged commit 1538a97 into master Apr 30, 2020
saivarunr pushed a commit to rudderlabs/alerta that referenced this pull request Nov 27, 2021
* Add alerts and action forwarder plugin for federated setups

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

Successfully merging this pull request may close these issues.

Verify a federated Alerta setup with bi-directional alert/action syncing
2 participants