File: managerprotection.html

package info (click to toggle)
lemonldap-ng 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 13,084 kB
  • ctags: 2,440
  • sloc: perl: 25,708; makefile: 622; sh: 176; php: 6; sql: 5
file content (148 lines) | stat: -rw-r--r-- 6,546 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
 lang="en" dir="ltr">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<!-- metadata -->
<meta name="generator" content="Offline" />
<meta name="version" content="Offline 0.1" />
<!-- style sheet links -->
<link rel="stylesheet" media="all" type="text/css" href="../../../css/all.css" />
<link rel="stylesheet" media="screen" type="text/css" href="../../../css/screen.css" />
<link rel="stylesheet" media="print" type="text/css" href="../../../css/print.css" />

</head>
<body>
<div class="dokuwiki export">




<h1><a name="manager_protection" id="manager_protection">Manager protection</a></h1>
<div class="level1">

<p>

When installing <acronym title="LemonLDAP::NG">LL::NG</acronym>, the Manager can only be accessed with the demo account <code>dwho</code>. This How To explains how change this default behavior to protect Manager with other rules.
</p>

</div>
<!-- SECTION "Manager protection" [1-215] -->
<h2><a name="apache_based_protection" id="apache_based_protection">Apache based protection</a></h2>
<div class="level2">

<p>

<p><div class="notetip">Apache based protection allow to be independent from WebSSO, so Manager will always be reachable even if WebSSO configuration is corrupted.
</div></p>
</p>

<p>
The configuration can be changed in <code>etc/manager-apache2.conf</code>, for example to restrict the <acronym title="Internet Protocol">IP</acronym> allowed to access the Manager:
</p>
<pre class="code file apache">    &lt;<span class="kw3">Directory</span> /usr/local/lemonldap-ng/htdocs/manager/&gt;
        <span class="kw1">Order</span> <span class="kw1">deny</span>,<span class="kw1">allow</span>
        <span class="kw1">Deny</span> from <span class="kw2">all</span>
        <span class="kw1">Allow</span> from 127.0.0.0/8 192.168.100.0/32
        <span class="kw1">Options</span> +ExecCGI
    &lt;/<span class="kw3">Directory</span>&gt;</pre>

<p>
But you will rather prefer to use an Apache authentication module, like for example <a href="http://httpd.apache.org/docs/current/mod/mod_authnz_ldap.html" class="urlextern" title="http://httpd.apache.org/docs/current/mod/mod_authnz_ldap.html"  rel="nofollow">LDAP authentication module</a>:

</p>
<pre class="code file apache">    &lt;<span class="kw3">Directory</span> /usr/local/lemonldap-ng/htdocs/manager/&gt;
        <span class="kw1">AuthzLDAPAuthoritative</span> <span class="kw2">On</span>
        <span class="kw1">AuthName</span> <span class="st0">&quot;LL::NG Manager&quot;</span>
        <span class="kw1">AuthType</span> Basic
        <span class="kw1">AuthBasicProvider</span> ldap
        <span class="kw1">AuthLDAPBindDN</span> <span class="st0">&quot;ou=websso,ou=applications,dc=example,dc=com&quot;</span>
        <span class="kw1">AuthLDAPBindPassword</span> <span class="st0">&quot;secret&quot;</span>
        <span class="kw1">AuthLDAPURL</span> ldap://localhost:389/ou=users,dc=example,dc=com???(objectClass=inetOrgPerson) TLS
        <span class="kw1">Require</span> ldap-<span class="kw1">user</span> coudot xguimard tchemineau
        <span class="kw1">Options</span> +ExecCGI
    &lt;/<span class="kw3">Directory</span>&gt;</pre>

<p>
<p><div class="noteimportant">You need to disable default Manager protection in lemonldap-ng.ini to rely only on Apache:

</p>
<pre class="code file ini"><span class="re0"><span class="br0">&#91;</span>manager<span class="br0">&#93;</span></span>
<span class="co0">;protection = manager</span></pre>

<p>


</div></p>
</p>

</div>
<!-- SECTION "Apache based protection" [216-1605] -->
<h2><a name="llng_based_protection" id="llng_based_protection">LL::NG based protection</a></h2>
<div class="level2">

<p>

<p><div class="notewarning">Before enabling Manager protection by <acronym title="LemonLDAP::NG">LL::NG</acronym>, you must have configured how users authenticate on Portal, and test that you can log in without difficulties. Else, you will lock access to Manager and will never access it anymore.
</div></p>
</p>

<p>
By default, you will have a manager virtual host define in configuration. If not Go on Manager, and declare Manager as a new <a href="../../documentation/1.3/configvhost.html#lemonldapng_configuration" class="wikilink1" title="documentation:1.3:configvhost">virtual host</a>, for example <code>manager.example.com</code>. You can then set the access rule. No headers are needed.
</p>

<p>
The default rule is:

</p>
<pre class="code perl"><span class="re0">$uid</span> <span class="kw1">eq</span> <span class="st0">&quot;dwho&quot;</span></pre>

<p>
You have to change it to match your admin user (or use other conditions like group membership, or any other rule based on a session variable).
</p>

<p>
Save the configuration and exit the Manager.
</p>

<p>
<p><div class="notetip">The next time you will access Manager, it will be trough <acronym title="LemonLDAP::NG">LL::NG</acronym>.
</div></p>
</p>

<p>
Enable protection on Manager, by editing <code>lemonldap-ng.ini</code>:

</p>
<pre class="code file ini"><span class="re0"><span class="br0">&#91;</span>manager<span class="br0">&#93;</span></span>
<span class="re1">protection</span> <span class="sy0">=</span><span class="re2"> manager</span></pre>

<p>
You can also adapt Apache access control:

</p>
<pre class="code file apache">    &lt;<span class="kw3">Directory</span> /usr/local/lemonldap-ng/htdocs/manager/&gt;
        <span class="kw1">Order</span> <span class="kw1">deny</span>,<span class="kw1">allow</span>
        <span class="kw1">Allow</span> from <span class="kw2">all</span>
        <span class="kw1">Options</span> +ExecCGI
    &lt;/<span class="kw3">Directory</span>&gt;</pre>

<p>
Restart Apache and try to log on Manager. You should be redirected to <acronym title="LemonLDAP::NG">LL::NG</acronym> Portal.
</p>

<p>
You can then add the Manager as <a href="../../documentation/1.3/portalmenu.html#categories_and_applications" class="wikilink1" title="documentation:1.3:portalmenu">an application in the menu</a>.
</p>

<p>
<p><div class="notetip">If for an obscure reason, the WebSSO is not working and you want to access the Manager, remove the protection in <code>lemonldap-ng.ini</code>. Add an Apache access control to avoid other access.
</div></p>
</p>

</div>
<!-- SECTION "LL::NG based protection" [1606-] --></div><!-- closes <div class="dokuwiki export">-->