Skip to content

Commit

Permalink
Fix config references
Browse files Browse the repository at this point in the history
  • Loading branch information
satterly committed Mar 19, 2023
1 parent ea3ddd7 commit 22db926
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 149 deletions.
66 changes: 66 additions & 0 deletions auth/auditing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.. _audit log:

Audit Log
=========

An audit trail can be enabled to keep track of changes to Alerta.

Every audit event will have an audit ``id``, ``@timestamp``, ``event``,
``category``, ``message``, ``user``, ``resource``, ``request`` and
``extra`` elements. The ``extra`` element may include relevant data
depending on the type of event.

**Example Audit Event**

.. code:: json
{
"id": "c87210da-3cfb-4cbd-b8ec-4fe9ed39aeef",
"@timestamp": "2018-11-10T21:36:23.946Z",
"event": "apikey-deleted",
"category": "admin",
"message": "",
"user": {
"id": "satterly",
"customers": [],
"scopes": [
"admin",
"read",
"write"
]
},
"resource": {
"id": "dc0b5a62-015b-4ba3-965e-012ca2e4db9b",
"type": "apikey"
},
"request": {
"endpoint": "api.delete_key",
"method": "DELETE",
"url": "http://localhost:8080/key/dc0b5a62-015b-4ba3-965e-012ca2e4db9b",
"args": {},
"data": "",
"ipAddress": "127.0.0.1"
},
"extra": {}
}
Audit events can be logged locally to the standard application log
(which could also help with general debugging) or forwarded to a
HTTP endpoint using a POST.

**Example Loggly configuration**

The following example configuration can be used to log all ``admin``,
``write`` and ``auth`` requests to the Flask application log file and
forward the events to the Loggly_ "logging-as-a-service" endpoint,
replacing ``TOKEN`` in the Loggly URL with your customer token.

.. _Loggly: https://www.loggly.com/docs/http-endpoint/

.. code:: python
AUDIT_TRAIL = ['admin', 'write', 'auth']
AUDIT_LOG = True # log to Flask application logger
AUDIT_URL='http://logs-01.loggly.com/inputs/TOKEN/tag/http/'
.. image:: ../_static/images/loggly-screen-shot-2.png
5 changes: 5 additions & 0 deletions auth/auth-proxy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


Remote User & Auth Proxy
========================

5 changes: 5 additions & 0 deletions auth/customers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


Customer Lookups and Groups
===========================

22 changes: 22 additions & 0 deletions auth/introduction.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Getting Started
===============


Scenarios
---------

* :ref:`LDAP Authentication <ldap auth>`
* :ref:`Using Custom Scopes <ldap auth>`
* :ref:`Default Roles <ldap auth>`
* :ref:`Guest Roles <ldap auth>`
* :ref:`Readonly Logins <ldap auth>`
* :ref:`Role Mapping <ldap auth>`
* :ref:`Customer Lookups <ldap auth>`
* :ref:`Delete Scopes <ldap auth>`


AUTH_PROXY = False
AUTH_PROXY_USER_HEADER = 'X-Proxy-User' # header field containing the authenticated username
AUTH_PROXY_ROLES_HEADER = 'X-Proxy-Roles' # comma-separated list of authenticated role names
AUTH_PROXY_ROLES_SEPARATOR = ','
3 changes: 3 additions & 0 deletions auth/roles.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

Permissions & Role Mapping
==========================
65 changes: 0 additions & 65 deletions authorization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,68 +151,3 @@ Use these scopes to request access to API resources.
includes ``read`` and ``write``.

``delete:alerts`` only required to delete alerts if the `DELETE_SCOPES` setting is enabled.

Audit Log
---------

An audit trail can be enabled to keep track of changes to Alerta.

Every audit event will have an audit ``id``, ``@timestamp``, ``event``,
``category``, ``message``, ``user``, ``resource``, ``request`` and
``extra`` elements. The ``extra`` element may include relevant data
depending on the type of event.

**Example Audit Event**

.. code:: json
{
"id": "c87210da-3cfb-4cbd-b8ec-4fe9ed39aeef",
"@timestamp": "2018-11-10T21:36:23.946Z",
"event": "apikey-deleted",
"category": "admin",
"message": "",
"user": {
"id": "satterly",
"customers": [],
"scopes": [
"admin",
"read",
"write"
]
},
"resource": {
"id": "dc0b5a62-015b-4ba3-965e-012ca2e4db9b",
"type": "apikey"
},
"request": {
"endpoint": "api.delete_key",
"method": "DELETE",
"url": "http://localhost:8080/key/dc0b5a62-015b-4ba3-965e-012ca2e4db9b",
"args": {},
"data": "",
"ipAddress": "127.0.0.1"
},
"extra": {}
}
Audit events can be logged locally to the standard application log
(which could also help with general debugging) or forwarded to a
HTTP endpoint using a POST.

**Example Loggly configuration**

The following example configuration can be used to log all ``admin``,
``write`` and ``auth`` requests to the Flask application log file and
forward the events to the Loggly_ "logging-as-a-service" endpoint,
replacing ``TOKEN`` in the Loggly URL with your customer token.

.. _Loggly: https://www.loggly.com/docs/http-endpoint/

.. code:: python
AUDIT_TRAIL = ['admin', 'write', 'auth']
AUDIT_LOG = True # log to Flask application logger
AUDIT_URL='http://logs-01.loggly.com/inputs/TOKEN/tag/http/'
.. image:: _static/images/loggly-screen-shot-2.png
Loading

0 comments on commit 22db926

Please sign in to comment.