Skip to content

Commit da4ab61

Browse files
committed
Update Release notes for version 4.9
1 parent 48dc9a6 commit da4ab61

14 files changed

+201
-22
lines changed
12.4 KB
Binary file not shown.

_build/doctrees/configuration.doctree

2.52 KB
Binary file not shown.

_build/doctrees/environment.pickle

587 Bytes
Binary file not shown.

_build/doctrees/release-notes.doctree

1.93 KB
Binary file not shown.

_build/html/_sources/authentication.txt

+63-5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Alerta supports two main authentication mechanisms for the web UI
1414
* `Google OAuth2`_
1515
* `GitHub OAuth2`_
1616
* `GitLab OAuth2`_
17+
* `Keycloak OAuth2`_
1718
* `API Keys`_
1819

1920
The most straight-forward of the two to implement is `Basic Auth`_.
@@ -63,8 +64,8 @@ required of the Alerta server to use Basic Auth::
6364
OAuth2 Authentication
6465
---------------------
6566

66-
OAuth authentication is provided by Google_ `OpenID Connect`_, GitHub_ or
67-
GitLab_ `OAuth 2.0`_ and configuration is more involved than the Basic
67+
OAuth authentication is provided by Google_ `OpenID Connect`_, GitHub_,
68+
GitLab_ `OAuth 2.0`_ or Keycloak_ `OAuth 2.0`_ and configuration is more involved than the Basic
6869
Auth setup.
6970

7071
.. note:: If alerta is deployed to a publicly accessible web server it
@@ -75,13 +76,14 @@ Auth setup.
7576
.. _Google: https://developers.google.com/accounts/docs/OpenIDConnect
7677
.. _GitHub: https://developer.github.com/v3/oauth/
7778
.. _GitLab: http://doc.gitlab.com/ce/integration/oauth_provider.html
79+
.. _Keycloak: https://www.keycloak.org/documentation.html
7880
.. _OAuth 2.0: http://tools.ietf.org/html/draft-ietf-oauth-v2-22
7981
.. _OpenID Connect: http://openid.net/connect/
8082

8183
.. _google oauth2:
8284

8385
To use OAuth2 set the ``provider`` configuration setting in the Web UI
84-
:file:`config.js` file to one of ``google``, ``github`` or ``gitlab``::
86+
:file:`config.js` file to one of ``google``, ``github``, ``gitlab`` or ``keycloak``::
8587

8688
'use strict';
8789

@@ -212,6 +214,60 @@ To restrict access to users who are members of particular `GitLab groups`_ use::
212214
find alerta in the list of applications and click the **Revoke**
213215
button.
214216

217+
Keycloak OAuth2
218+
~~~~~~~~~~~~~
219+
220+
To use Keycloak as the OAuth2 provider for Alerta, login to Keycloak admin interface, select the realm and go
221+
to *Clients -> Create*.
222+
223+
- Client ID: alerta-ui
224+
- Client protocol: openid-connect
225+
- Root URL: http://alerta.example.org
226+
227+
After the client is created, edit it and change the following properties:
228+
229+
- Access Type: confindential
230+
231+
Add the following mapper under the *Mappers* tab::
232+
233+
Name: role memberships
234+
Mapper type: User Realm Role
235+
Token Claim Name: roles
236+
Claim JSON type: String
237+
Add to userinfo: ON
238+
239+
Now go to *Installation* and generate it by selecting 'Keycloak OIDC JSON'. You should get something like this::
240+
241+
{
242+
"realm": "master",
243+
"auth-server-url": "https://keycloak.example.org/auth",
244+
"ssl-required": "external",
245+
"resource": "alerta-ui",
246+
"credentials": {
247+
"secret": "418bbf31-aef-33d1-a471-322a60276879"
248+
},
249+
"use-resource-role-mappings": true
250+
}
251+
252+
Take note of the realm, resource and secret. Then configuration settings for ``alerta`` server are as follows (replacing
253+
the values shown below with the values generated by Keycloak)::
254+
255+
KEYCLOAK_URL = 'https://keycloak.example.org'
256+
KEYCLOAK_REALM = 'master'
257+
OAUTH2_CLIENT_ID = 'alerta-ui'
258+
OAUTH2_CLIENT_SECRET = '418bbf31-aef-33d1-a471-322a60276879'
259+
260+
.. _allowed_keycloak_roles:
261+
262+
To restrict access to users who are associated with a particular `Keycloak role`_ use::
263+
264+
ALLOWED_KEYCLOAK_ROLES = ['role1', 'role2']
265+
266+
.. _`Keycloak roles`: https://keycloak.gitbooks.io/documentation/server_admin/topics/roles.html
267+
268+
.. note:: ``ALLOWED_KEYCLOAK_ROLES`` can be an asterisk (``*``) to force
269+
login but *not* restrict who can login.
270+
215271
.. _cross_origin:
216272

217273
Cross-Origin
@@ -263,7 +319,7 @@ or use the ``api-key`` GET parameter::
263319
User Authorisation
264320
------------------
265321

266-
Google, GitHub and GitLab OAuth are used for user authentication, not
322+
Google, GitHub, GitLab OAuth, Keycloak OAuth are used for user authentication, not
267323
user authorisation. Authentication proves that you are who you say you
268324
are. Authorization says that you are allowed to access what you have
269325
requested.
@@ -275,10 +331,12 @@ belong to a :ref:`particular GitHub organisation <allowed_github_orgs>`
275331
by setting ``ALLOWED_GITHUB_ORGS`` when using GitHub OAuth, or who
276332
belong to a :ref:`particular GitLab group <allowed_gitlab_groups>`
277333
by setting ``ALLOWED_GITLAB_GROUPS`` when using GitLab OAuth2.
334+
belong to a :ref:`particular Keycloak role <allowed_keycloak_roles>`
335+
by setting ``ALLOWED_KEYCLOAK_ROLES`` when using Keycloak OAuth2
278336

279337
For those situations where it is not possible to group users in this
280338
way it is possible to selectively allow access on a per-user basis. How
281-
this is done depends on whether you are using Google, GitHub or GitLab
339+
this is done depends on whether you are using Google, GitHub, GitLab or Keycloak
282340
as OAuth2 provider for user login.
283341

284342

_build/html/_sources/configuration.txt

+13-3
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,13 @@ such as auditing, and features like the ability to assign and watch alerts.
121121
GITLAB_URL = None
122122
ALLOWED_GITLAB_GROUPS = ['*']
123123

124+
KEYCLOAK_URL = None
125+
KEYCLOAK_REALM = None
126+
ALLOWED_KEYCLOAK_ROLES = ['*']
127+
124128
TOKEN_EXPIRE_DAYS = 14
125129

126-
.. index:: AUTH_REQUIRED, SECRET_KEY, ADMIN_USERS, OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRET, ALLOWED_EMAIL_DOMAINS, ALLOWED_GITHUB_ORGS, GITLAB_URL, ALLOWED_GITLAB_GROUPS
130+
.. index:: AUTH_REQUIRED, SECRET_KEY, ADMIN_USERS, OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRET, ALLOWED_EMAIL_DOMAINS, ALLOWED_GITHUB_ORGS, GITLAB_URL, ALLOWED_GITLAB_GROUPS, KEYCLOAK_URL, KEYCLOAK_REALM, ALLOWED_KEYCLOAK_ROLES
127131

128132
``SECRET_KEY``
129133
a unique, randomly generated sequence of ASCII characters.
@@ -134,9 +138,9 @@ such as auditing, and features like the ability to assign and watch alerts.
134138
``CUSTOMER_VIEWS``
135139
enable alert views partitioned by customer
136140
``OAUTH2_CLIENT_ID``
137-
client ID required by OAuth2 provider for Google, Github or GitLab.
141+
client ID required by OAuth2 provider for Google, Github, GitLab or Keycloak.
138142
``OAUTH2_CLIENT_SECRET``
139-
client secret required by OAuth2 provider for Google, Github or GitLab.
143+
client secret required by OAuth2 provider for Google, Github, GitLab or Keycloak.
140144
``ALLOWED_EMAIL_DOMAINS``
141145
list of authorised email domains when using Google as OAuth2 provider.
142146
``GITHUB_URL``
@@ -147,6 +151,12 @@ such as auditing, and features like the ability to assign and watch alerts.
147151
GitLab website URL for public or privately run GitLab server when using GitLab as OAuth2 provider.
148152
``ALLOWED_GITLAB_GROUPS``
149153
list of authorised GitLab groups a user must belong to when using GitLab as OAuth2 provider.
154+
``KEYCLOAK_URL``
155+
Keycloak website URL when using Keycloak as OAuth2 provider.
156+
``KEYCLOAK_REALM``
157+
Keycloak realm when using Keycloak as OAuth2 provider.
158+
``ALLOWED_KEYCLOAK_ROLES``
159+
list of authorised Keycloak roles a user must belong to when using Keycloak as OAuth2 provider.
150160

151161
.. _switch config:
152162

_build/html/_sources/release-notes.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Roadmap
77

88
* Custom alert filters and dashboard views
99
* Web UI redesign using `Google material design`_
10-
* GitHub enterprise for OAuth2 logins
1110

1211
.. _Google material design: https://www.google.com/design/spec/material-design/introduction.html
1312

@@ -16,9 +15,19 @@ Roadmap
1615
Release History
1716
+++++++++++++++
1817

18+
Release 4.9 (16-03-2017)
19+
------------------------
20+
21+
* LDAP authentication via Keycloak_ support
22+
* `MongoDB SSL`_ connection support
23+
24+
.. _Keycloak: https://www.keycloak.org/
25+
.. _MongoDB SSL: http://api.mongodb.com/python/current/examples/tls.html
26+
1927
Release 4.8 (05-09-2016)
2028
------------------------
2129

30+
* Use GitHub Enterprise for OAuth2 login
2231
* Riemann_ webhook integration
2332
* Telegram_ webhook and `related plugin`_ for bi-directional integration
2433
* Grafana_ webhook integration

_build/html/authentication.html

+61-6
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<li><a class="reference internal" href="#google-oauth2">Google OAuth2</a></li>
5757
<li><a class="reference internal" href="#id4">GitHub OAuth2</a></li>
5858
<li><a class="reference internal" href="#gitlab-oauth2">GitLab OAuth2</a></li>
59+
<li><a class="reference internal" href="#keycloak-oauth2">Keycloak OAuth2</a></li>
5960
<li><a class="reference internal" href="#api-keys">API Keys</a></li>
6061
</ul>
6162
<p>The most straight-forward of the two to implement is <a class="reference internal" href="#basic-auth">Basic Auth</a>.</p>
@@ -101,8 +102,8 @@
101102
</div>
102103
<div class="section" id="oauth2-authentication">
103104
<span id="oauth2"></span><h2>OAuth2 Authentication<a class="headerlink" href="#oauth2-authentication" title="Permalink to this headline"></a></h2>
104-
<p>OAuth authentication is provided by <a class="reference external" href="https://developers.google.com/accounts/docs/OpenIDConnect">Google</a> <a class="reference external" href="http://openid.net/connect/">OpenID Connect</a>, <a class="reference external" href="https://developer.github.com/v3/oauth/">GitHub</a> or
105-
<a class="reference external" href="http://doc.gitlab.com/ce/integration/oauth_provider.html">GitLab</a> <a class="reference external" href="http://tools.ietf.org/html/draft-ietf-oauth-v2-22">OAuth 2.0</a> and configuration is more involved than the Basic
105+
<p>OAuth authentication is provided by <a class="reference external" href="https://developers.google.com/accounts/docs/OpenIDConnect">Google</a> <a class="reference external" href="http://openid.net/connect/">OpenID Connect</a>, <a class="reference external" href="https://developer.github.com/v3/oauth/">GitHub</a>,
106+
<a class="reference external" href="http://doc.gitlab.com/ce/integration/oauth_provider.html">GitLab</a> <a class="reference external" href="http://tools.ietf.org/html/draft-ietf-oauth-v2-22">OAuth 2.0</a> or <a class="reference external" href="https://www.keycloak.org/documentation.html">Keycloak</a> <a class="reference external" href="http://tools.ietf.org/html/draft-ietf-oauth-v2-22">OAuth 2.0</a> and configuration is more involved than the Basic
106107
Auth setup.</p>
107108
<div class="admonition note">
108109
<p class="first admonition-title">Note</p>
@@ -112,7 +113,7 @@
112113
alerts.</p>
113114
</div>
114115
<p id="google-oauth2">To use OAuth2 set the <code class="docutils literal"><span class="pre">provider</span></code> configuration setting in the Web UI
115-
<code class="file docutils literal"><span class="pre">config.js</span></code> file to one of <code class="docutils literal"><span class="pre">google</span></code>, <code class="docutils literal"><span class="pre">github</span></code> or <code class="docutils literal"><span class="pre">gitlab</span></code>:</p>
116+
<code class="file docutils literal"><span class="pre">config.js</span></code> file to one of <code class="docutils literal"><span class="pre">google</span></code>, <code class="docutils literal"><span class="pre">github</span></code>, <code class="docutils literal"><span class="pre">gitlab</span></code> or <code class="docutils literal"><span class="pre">keycloak</span></code>:</p>
116117
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="s1">&#39;use strict&#39;</span><span class="p">;</span>
117118

118119
<span class="n">angular</span><span class="o">.</span><span class="n">module</span><span class="p">(</span><span class="s1">&#39;config&#39;</span><span class="p">,</span> <span class="p">[])</span>
@@ -240,6 +241,58 @@ <h3>GitLab OAuth2<a class="headerlink" href="#gitlab-oauth2" title="Permalink to
240241
button.</p>
241242
</div>
242243
</div>
244+
<div class="section" id="keycloak-oauth2">
245+
<h3>Keycloak OAuth2<a class="headerlink" href="#keycloak-oauth2" title="Permalink to this headline"></a></h3>
246+
<p>To use Keycloak as the OAuth2 provider for Alerta, login to Keycloak admin interface, select the realm and go
247+
to <em>Clients -&gt; Create</em>.</p>
248+
<ul class="simple">
249+
<li>Client ID: alerta-ui</li>
250+
<li>Client protocol: openid-connect</li>
251+
<li>Root URL: <a class="reference external" href="http://alerta.example.org">http://alerta.example.org</a></li>
252+
</ul>
253+
<p>After the client is created, edit it and change the following properties:</p>
254+
<ul class="simple">
255+
<li>Access Type: confindential</li>
256+
</ul>
257+
<p>Add the following mapper under the <em>Mappers</em> tab:</p>
258+
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">Name</span><span class="p">:</span> <span class="n">role</span> <span class="n">memberships</span>
259+
<span class="n">Mapper</span> <span class="nb">type</span><span class="p">:</span> <span class="n">User</span> <span class="n">Realm</span> <span class="n">Role</span>
260+
<span class="n">Token</span> <span class="n">Claim</span> <span class="n">Name</span><span class="p">:</span> <span class="n">roles</span>
261+
<span class="n">Claim</span> <span class="n">JSON</span> <span class="nb">type</span><span class="p">:</span> <span class="n">String</span>
262+
<span class="n">Add</span> <span class="n">to</span> <span class="n">userinfo</span><span class="p">:</span> <span class="n">ON</span>
263+
</pre></div>
264+
</div>
265+
<p>Now go to <em>Installation</em> and generate it by selecting &#8216;Keycloak OIDC JSON&#8217;. You should get something like this:</p>
266+
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">{</span>
267+
<span class="s2">&quot;realm&quot;</span><span class="p">:</span> <span class="s2">&quot;master&quot;</span><span class="p">,</span>
268+
<span class="s2">&quot;auth-server-url&quot;</span><span class="p">:</span> <span class="s2">&quot;https://keycloak.example.org/auth&quot;</span><span class="p">,</span>
269+
<span class="s2">&quot;ssl-required&quot;</span><span class="p">:</span> <span class="s2">&quot;external&quot;</span><span class="p">,</span>
270+
<span class="s2">&quot;resource&quot;</span><span class="p">:</span> <span class="s2">&quot;alerta-ui&quot;</span><span class="p">,</span>
271+
<span class="s2">&quot;credentials&quot;</span><span class="p">:</span> <span class="p">{</span>
272+
<span class="s2">&quot;secret&quot;</span><span class="p">:</span> <span class="s2">&quot;418bbf31-aef-33d1-a471-322a60276879&quot;</span>
273+
<span class="p">},</span>
274+
<span class="s2">&quot;use-resource-role-mappings&quot;</span><span class="p">:</span> <span class="n">true</span>
275+
<span class="p">}</span>
276+
</pre></div>
277+
</div>
278+
<p>Take note of the realm, resource and secret. Then configuration settings for <code class="docutils literal"><span class="pre">alerta</span></code> server are as follows (replacing
279+
the values shown below with the values generated by Keycloak):</p>
280+
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">KEYCLOAK_URL</span> <span class="o">=</span> <span class="s1">&#39;https://keycloak.example.org&#39;</span>
281+
<span class="n">KEYCLOAK_REALM</span> <span class="o">=</span> <span class="s1">&#39;master&#39;</span>
282+
<span class="n">OAUTH2_CLIENT_ID</span> <span class="o">=</span> <span class="s1">&#39;alerta-ui&#39;</span>
283+
<span class="n">OAUTH2_CLIENT_SECRET</span> <span class="o">=</span> <span class="s1">&#39;418bbf31-aef-33d1-a471-322a60276879&#39;</span>
284+
</pre></div>
285+
</div>
286+
<p id="allowed-keycloak-roles">To restrict access to users who are associated with a particular <a href="#id8"><span class="problematic" id="id9">`Keycloak role`_</span></a> use:</p>
287+
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">ALLOWED_KEYCLOAK_ROLES</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;role1&#39;</span><span class="p">,</span> <span class="s1">&#39;role2&#39;</span><span class="p">]</span>
288+
</pre></div>
289+
</div>
290+
<div class="admonition note">
291+
<p class="first admonition-title">Note</p>
292+
<p class="last"><code class="docutils literal"><span class="pre">ALLOWED_KEYCLOAK_ROLES</span></code> can be an asterisk (<code class="docutils literal"><span class="pre">*</span></code>) to force
293+
login but <em>not</em> restrict who can login.</p>
294+
</div>
295+
</div>
243296
<div class="section" id="cross-origin">
244297
<span id="id5"></span><h3>Cross-Origin<a class="headerlink" href="#cross-origin" title="Permalink to this headline"></a></h3>
245298
<p>If the Alerta API is not being served from the same domain as the Alerta
@@ -283,7 +336,7 @@ <h3>GitLab OAuth2<a class="headerlink" href="#gitlab-oauth2" title="Permalink to
283336
</div>
284337
<div class="section" id="user-authorisation">
285338
<span id="user-auth"></span><h2>User Authorisation<a class="headerlink" href="#user-authorisation" title="Permalink to this headline"></a></h2>
286-
<p>Google, GitHub and GitLab OAuth are used for user authentication, not
339+
<p>Google, GitHub, GitLab OAuth, Keycloak OAuth are used for user authentication, not
287340
user authorisation. Authentication proves that you are who you say you
288341
are. Authorization says that you are allowed to access what you have
289342
requested.</p>
@@ -293,10 +346,12 @@ <h3>GitLab OAuth2<a class="headerlink" href="#gitlab-oauth2" title="Permalink to
293346
belong to a <a class="reference internal" href="#allowed-github-orgs"><span class="std std-ref">particular GitHub organisation</span></a>
294347
by setting <code class="docutils literal"><span class="pre">ALLOWED_GITHUB_ORGS</span></code> when using GitHub OAuth, or who
295348
belong to a <a class="reference internal" href="#allowed-gitlab-groups"><span class="std std-ref">particular GitLab group</span></a>
296-
by setting <code class="docutils literal"><span class="pre">ALLOWED_GITLAB_GROUPS</span></code> when using GitLab OAuth2.</p>
349+
by setting <code class="docutils literal"><span class="pre">ALLOWED_GITLAB_GROUPS</span></code> when using GitLab OAuth2.
350+
belong to a <a class="reference internal" href="#allowed-keycloak-roles"><span class="std std-ref">particular Keycloak role</span></a>
351+
by setting <code class="docutils literal"><span class="pre">ALLOWED_KEYCLOAK_ROLES</span></code> when using Keycloak OAuth2</p>
297352
<p>For those situations where it is not possible to group users in this
298353
way it is possible to selectively allow access on a per-user basis. How
299-
this is done depends on whether you are using Google, GitHub or GitLab
354+
this is done depends on whether you are using Google, GitHub, GitLab or Keycloak
300355
as OAuth2 provider for user login.</p>
301356
</div>
302357
<div class="section" id="user-roles">

0 commit comments

Comments
 (0)