Skip to content

Commit dc9c225

Browse files
satterlyclaude
andcommitted
Replace all TBC/FIXME placeholders with real content
- configuration.rst: Add examples for OIDC, SAML2, Cognito, GitHub, GitLab, Google, Keycloak auth settings; fix OIDC_AUTH_URL and OIDC_LOGOUT_URL descriptions - integrations.rst: Document Zabbix, Graylog and Slack integrations - tutorial-4-alerts.rst: Write groups/types/origins, tags/attributes, and raw data sections - authentication.rst: Document Amazon Cognito setup and HMAC auth - server.rst: Document operator actions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fb8824b commit dc9c225

5 files changed

Lines changed: 192 additions & 18 deletions

File tree

source/authentication.rst

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,36 @@ the OpenID Connect authentication provider for Alerta follow the steps below.
409409
Amazon Cognito
410410
~~~~~~~~~~~~~~
411411

412-
.. note:: TBC
412+
To use `Amazon Cognito`_ as the OAuth2 provider for Alerta, set up
413+
a User Pool and App Client in the AWS Console:
414+
415+
#. Create a Cognito User Pool (or use an existing one) and note the
416+
**User Pool ID** (e.g. ``us-east-1_aBcDeFgHi``).
417+
418+
#. Under "App integration", create an App Client for Alerta:
419+
420+
- App client name: ``Alerta``
421+
- Callback URL: ``http://alerta.example.com``
422+
- Allowed OAuth Flows: Authorization code grant
423+
- Allowed OAuth Scopes: openid, email, profile
424+
425+
#. Configure a Cognito Domain (either a custom domain or the default
426+
Amazon Cognito domain prefix), for example: ``alerta-auth``.
427+
428+
#. Copy the generated **Client ID** and **Client Secret**.
429+
430+
#. Add the configuration to the ``alertad.conf`` server configuration:
431+
432+
.. code:: python
433+
434+
AUTH_PROVIDER = 'cognito'
435+
AWS_REGION = 'us-east-1'
436+
COGNITO_USER_POOL_ID = 'us-east-1_aBcDeFgHi'
437+
COGNITO_DOMAIN = 'alerta-auth'
438+
OAUTH2_CLIENT_ID = '1abc2def3ghi4jkl5mno6pqr7s'
439+
OAUTH2_CLIENT_SECRET = 'us1-abc123-def456-ghi789'
440+
441+
.. _Amazon Cognito: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools.html
413442

414443

415444
.. _gitlab_oauth2:
@@ -655,4 +684,25 @@ Use the ``api-key`` URL parameter::
655684
HMAC Auth
656685
---------
657686

658-
.. note:: TBC
687+
HMAC authentication provides a secure method for machine-to-machine
688+
communication with the Alerta API. Instead of using static API keys,
689+
HMAC uses a shared secret to sign each request, ensuring both
690+
authenticity and integrity.
691+
692+
To configure HMAC authentication, add one or more credentials to the
693+
``alertad.conf`` server configuration:
694+
695+
.. code:: python
696+
697+
HMAC_AUTH_CREDENTIALS = [
698+
{
699+
'key': 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', # access key ID
700+
'secret': 'MWYyZDdjMzg3ZjRjNTExZWM4NjNkYzYw', # secret key (base64)
701+
'algorithm': 'sha256' # valid: sha256, sha384, sha512
702+
}
703+
]
704+
705+
The ``key`` is sent as a header to identify the caller, while the
706+
``secret`` is used to compute the HMAC signature of the request. The
707+
server verifies the signature against the stored secret for the given
708+
key, rejecting requests with invalid or missing signatures.

source/configuration.rst

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,13 @@ OpenID Connect Auth Settings
378378

379379
.. code:: python
380380
381-
FIXME
381+
AUTH_PROVIDER = 'openid'
382+
OIDC_ISSUER_URL = 'https://accounts.example.com/.well-known/openid-configuration'
383+
OAUTH2_CLIENT_ID = '1234567890.apps.example.com'
384+
OAUTH2_CLIENT_SECRET = 'ABCDefgh1234'
385+
OIDC_VERIFY_TOKEN = False
386+
ALLOWED_OIDC_ROLES = ['admin', 'operator']
387+
ALLOWED_EMAIL_DOMAINS = ['example.com']
382388
383389
.. index:: OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRET, OIDC_ISSUER_URL, OIDC_AUTH_URL
384390
.. index:: OIDC_TOKEN_AUTH_METHODS, OIDC_LOGOUT_URL, OIDC_VERIFY_TOKEN
@@ -393,11 +399,11 @@ OpenID Connect Auth Settings
393399
issuer URL also known as Discovery Document is used to auto-discover
394400
all necessary auth endpoints for an OIDC client (required)
395401
``OIDC_AUTH_URL``
396-
FIXME check
402+
authorization endpoint URL, auto-discovered from OIDC issuer URL if not explicitly set (default is ``None``)
397403
``OIDC_TOKEN_AUTH_METHODS``
398404
list of token auth methods in order of preference (``client_secret_basic``, ``client_secret_post``, ``client_secret_jwt``)
399405
``OIDC_LOGOUT_URL``
400-
FIXME (no default)
406+
end session endpoint URL, auto-discovered from OIDC issuer URL if not explicitly set (default is ``None``)
401407
``OIDC_VERIFY_TOKEN``
402408
(default is ``False``)
403409
``OIDC_ROLE_CLAIM``
@@ -422,7 +428,13 @@ SAML 2.0 Auth Settings
422428

423429
.. code:: python
424430
425-
FIXME
431+
AUTH_PROVIDER = 'saml2'
432+
SAML2_ENTITY_ID = 'https://alerta.example.com'
433+
SAML2_METADATA_URL = 'https://idp.example.com/saml2/metadata'
434+
SAML2_USER_NAME_FORMAT = '{givenName} {surname}'
435+
SAML2_EMAIL_ATTRIBUTE = 'emailAddress'
436+
ALLOWED_SAML2_GROUPS = ['alerta-admins', 'alerta-operators']
437+
ALLOWED_EMAIL_DOMAINS = ['example.com']
426438
427439
.. index:: SAML2_ENTITY_ID, SAML2_METADATA_URL, SAML2_USER_NAME_FORMAT, SAML2_EMAIL_ATTRIBUTE
428440
.. index:: SAML2_CONFIG, ALLOWED_SAML2_GROUPS
@@ -473,7 +485,13 @@ Amazon Cognito Auth Settings
473485

474486
.. code:: python
475487
476-
FIXME
488+
AUTH_PROVIDER = 'cognito'
489+
AWS_REGION = 'us-east-1'
490+
COGNITO_USER_POOL_ID = 'us-east-1_AbCdEfGhI'
491+
COGNITO_DOMAIN = 'my-alerta-app'
492+
OAUTH2_CLIENT_ID = '1a2b3c4d5e6f7g8h9i0j'
493+
OAUTH2_CLIENT_SECRET = 'ABCDefgh1234'
494+
ALLOWED_EMAIL_DOMAINS = ['example.com']
477495
478496
.. index:: AWS_REGION, COGNITO_USER_POOL_ID, COGNITO_DOMAIN
479497

@@ -493,7 +511,12 @@ GitHub Auth Settings
493511

494512
.. code:: python
495513
496-
FIXME
514+
AUTH_PROVIDER = 'github'
515+
GITHUB_URL = 'https://github.com'
516+
OAUTH2_CLIENT_ID = 'f7b68efc0e8e0dde0e0a'
517+
OAUTH2_CLIENT_SECRET = 'ABCDefgh1234'
518+
ALLOWED_GITHUB_ORGS = ['my-org']
519+
ALLOWED_EMAIL_DOMAINS = ['example.com']
497520
498521
.. index:: GITHUB_URL, ALLOWED_GITHUB_ORGS
499522

@@ -515,7 +538,12 @@ GitLab Auth Settings
515538

516539
.. code:: python
517540
518-
FIXME
541+
AUTH_PROVIDER = 'gitlab'
542+
GITLAB_URL = 'https://gitlab.com'
543+
OAUTH2_CLIENT_ID = 'e52ef0a1abcdef1234567890'
544+
OAUTH2_CLIENT_SECRET = 'ABCDefgh1234'
545+
ALLOWED_GITLAB_GROUPS = ['my-group']
546+
ALLOWED_EMAIL_DOMAINS = ['example.com']
519547
520548
.. index:: GITLAB_URL, ALLOWED_GITLAB_GROUPS
521549

@@ -533,7 +561,10 @@ Google Auth Settings
533561

534562
.. code:: python
535563
536-
FIXME
564+
AUTH_PROVIDER = 'google'
565+
OAUTH2_CLIENT_ID = '123456789012-abc123def456ghi789.apps.googleusercontent.com'
566+
OAUTH2_CLIENT_SECRET = 'ABCDefgh1234'
567+
ALLOWED_EMAIL_DOMAINS = ['example.com']
537568
538569
.. index:: OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRET, ALLOWED_EMAIL_DOMAINS
539570

@@ -553,7 +584,12 @@ Keycloack Auth Settings
553584

554585
.. code:: python
555586
556-
FIXME
587+
AUTH_PROVIDER = 'keycloak'
588+
KEYCLOAK_URL = 'https://keycloak.example.com'
589+
KEYCLOAK_REALM = 'master'
590+
OAUTH2_CLIENT_ID = 'alerta-ui'
591+
OAUTH2_CLIENT_SECRET = 'ABCDefgh1234'
592+
ALLOWED_KEYCLOAK_ROLES = ['alerta-admin', 'alerta-operator']
557593
558594
.. index:: KEYCLOAK_URL, KEYCLOAK_REALM, ALLOWED_KEYCLOAK_ROLES
559595

source/gettingstarted/tutorial-4-alerts.rst

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,63 @@ The alert ``service`` is used to detail the list of effected services.
224224
Step 5: Groups, types and origins
225225
---------------------------------
226226

227-
TBC
227+
The ``group``, ``event_type``, and ``origin`` attributes provide additional
228+
context for alerts and can be used to organise and filter them.
229+
230+
The ``group`` attribute is used to group related alerts together. For example,
231+
all network-related alerts might be assigned to a "Network" group, while
232+
performance alerts could use "Performance".
233+
234+
The ``event_type`` defines the kind of alert, such as ``exceptionAlert``,
235+
``performanceAlert``, or ``availabilityAlert``. This can be useful for
236+
routing alerts to different handlers.
237+
238+
The ``origin`` identifies the source of the alert, such as a monitoring
239+
tool name or a specific host. It helps trace where the alert came from.
240+
241+
.. code-block:: console
242+
243+
$ alerta send -r user01 -e loginStatus -v loginError -s major -E Production \
244+
-S Security -t 'user01 login failed.' --group Security --origin auth-monitor \
245+
--type exceptionAlert
246+
9c11a5a8-2d8c-4e2f-bc6b-75e0e4c941fd (indeterminate -> major)
228247
229248
Step 6: Tags and Custom attributes
230249
----------------------------------
231250

232-
TBC
251+
Tags and custom attributes allow you to add arbitrary metadata to alerts.
252+
Tags are simple labels that can be used to categorise alerts, while custom
253+
attributes are key-value pairs for more structured data.
254+
255+
Tags are useful for filtering alerts in the web console and can be added
256+
using the ``-T`` option:
257+
258+
.. code-block:: console
259+
260+
$ alerta send -r user01 -e loginStatus -v loginError -s major -E Production \
261+
-S Security -t 'user01 login failed.' -T login -T security
262+
a3b5c7d9-1e2f-4a6b-8c0d-2e4f6a8b0c2d (indeterminate -> major)
263+
264+
Custom attributes are added using the ``-A`` option and take the form
265+
``key=value``:
266+
267+
.. code-block:: console
268+
269+
$ alerta send -r user01 -e loginStatus -v loginError -s major -E Production \
270+
-S Security -t 'user01 login failed.' -A ip=10.0.1.23 -A region=us-east-1
271+
a3b5c7d9-1e2f-4a6b-8c0d-2e4f6a8b0c2d (duplicate)
233272
234273
Step 7: Saving raw data
235274
-----------------------
236275

237-
TBC
276+
The ``rawData`` attribute can be used to store the original, unprocessed
277+
data that generated the alert. This is useful for debugging or auditing
278+
purposes as it preserves the complete source event.
279+
280+
When using the ``alerta`` command-line tool, raw data can be provided
281+
via standard input or the ``--raw-data`` option. When using webhooks,
282+
the raw data from the incoming request payload is automatically saved
283+
to the alert.
238284

239285
Next Steps
240286
----------

source/integrations.rst

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ The following is a list of integrations, webbhooks and plugins that highlight
148148
the use of bi-directional integration in different ways.
149149

150150
* AWS Cloudwatch webhook - includes the `SNS subscription confirmation`_ link in the text of the alert
151-
* Zabbix integration & plugin - TBC
151+
* Zabbix integration & plugin - uses the `zabbix-alerta`_ gateway to forward Zabbix triggers to Alerta and includes a link back to the Zabbix trigger page via the ``moreInfo`` alert attribute
152152
* Grafana webhook - includes `rule and image links`_ in Grafana alert attributes if available
153153
* NewRelic webhook - includes `incident and runbook links`_ in NewRelic alerts
154154
* PagerDuty webhook - includes the `incident URL`_ in alert history text when status changes
@@ -160,6 +160,7 @@ the use of bi-directional integration in different ways.
160160
.. _incident and runbook links: https://github.com/alerta/alerta/blob/master/alerta/webhooks/newrelic.py#L33-L37
161161
.. _incident URL: https://github.com/alerta/alerta/blob/master/alerta/webhooks/pagerduty.py#L18
162162
.. _external and generator URLs: https://github.com/alerta/alerta/blob/master/alerta/webhooks/prometheus.py#L62-L65
163+
.. _zabbix-alerta: https://github.com/alerta/zabbix-alerta
163164
.. _moreInfo: https://github.com/alerta/zabbix-alerta/blob/master/zabbix_alerta.py#L67
164165

165166
.. _webhooks:
@@ -226,7 +227,24 @@ For details on how to set this up see `Grafana webhook`_ page and in the
226227
Graylog
227228
~~~~~~~
228229

229-
TBC
230+
Alerta can be configured to receive Graylog alerts by adding a webhook
231+
endpoint as an HTTP alert notification.
232+
233+
For details on how to set this up see the `Graylog HTTP alert notification`_
234+
page and in the URL input box append :file:`/webhooks/graylog` to the Alerta API URL.
235+
236+
.. _Graylog HTTP alert notification: https://go2docs.graylog.org/current/interacting_with_your_log_data/notifications.html
237+
238+
**Example Graylog Webhook URL**
239+
240+
:file:`https://alerta.example.com/api/webhooks/graylog`
241+
242+
**Example Graylog Webhook URL with authentication**
243+
244+
:file:`https://alerta.example.com/api/webhooks/graylog?api-key=xxxxx`
245+
246+
**The following parameters can be set in the URL**
247+
environment, event, event_type, service, severity
230248

231249
New Relic
232250
~~~~~~~~~
@@ -333,7 +351,22 @@ For details on how to set this up see `SeverDensity webhook`_ page and in the
333351
Slack
334352
~~~~~
335353

336-
TBC
354+
Alerta can be configured to receive interactive messages from Slack using the
355+
Slack webhook. This enables operators to take actions on alerts (such as
356+
acknowledge, close, or watch) directly from Slack message buttons.
357+
358+
To set up the integration, create a `Slack app`_ with interactive components
359+
and configure the Request URL to point to the Alerta API webhook endpoint.
360+
361+
.. _Slack app: https://api.slack.com/slack-apps
362+
363+
**Example Slack Webhook URL**
364+
365+
:file:`https://alerta.example.com/api/webhooks/slack`
366+
367+
**Example Slack Webhook URL with authentication**
368+
369+
:file:`https://alerta.example.com/api/webhooks/slack?api-key=xxxxx`
337370

338371
Google Stackdriver
339372
~~~~~~~~~~~~~~~~~~

source/server.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,16 @@ Operator Actions
102102
Actions taken against alerts can be used as triggers for further integrations
103103
with external systems.
104104

105-
TBC
105+
Operators can perform actions such as ``ack``, ``close``, ``open``, or
106+
custom-defined actions on alerts via the web UI or API. Each action triggers
107+
the ``take_action()`` method on all configured plugins, allowing them to
108+
respond to the action. For example, a plugin could send a notification to
109+
a Slack channel when an alert is acknowledged, or update an external
110+
incident management system when an alert is closed.
111+
112+
Custom actions can be defined to extend the default set, enabling
113+
workflows specific to your organisation such as "escalate", "assign",
114+
or "create ticket".
106115

107116
.. _status_change:
108117

0 commit comments

Comments
 (0)