Debian Codegraph @

doc/sources/admin/managerprotection.rst

raw
1 Manager protection
2 ==================
3
4 When installing LL::NG, the Manager can only be accessed with the demo
5 account ``dwho``. This 'How To' describes how change this default behavior
6 to protect Manager with other rules.
7
8 Web server based protection
9 ---------------------------
10
11
12 .. tip::
13
14 Web server based protection allows one to be independent from WebSSO,
15 so Manager will be always reachable even if WebSSO configuration is corrupted.
16
17 The configuration can be changed in ``etc/manager-apache2.conf`` or
18 ``etc/manager-nginx.conf``. For example to restrict the IP allowed to access the Manager:
19
20 .. code-block:: apache
21
22 <Directory /usr/local/lemonldap-ng/htdocs/manager/>
23 Require ip 127.0.0.0/8 192.168.100.0/32
24 Options +ExecCGI
25 </Directory>
26
27
28 But you will rather prefer to use an Apache authentication module, like
29 for example `LDAP authentication
30 module <http://httpd.apache.org/docs/current/mod/mod_authnz_ldap.html>`__:
31
32 .. code-block:: apache
33
34 <Directory /usr/local/lemonldap-ng/htdocs/manager/>
35 AuthzLDAPAuthoritative On
36 AuthName "LL::NG Manager"
37 AuthType Basic
38 AuthBasicProvider ldap
39 AuthLDAPBindDN "ou=websso,ou=applications,dc=example,dc=com"
40 AuthLDAPBindPassword "secret"
41 AuthLDAPURL ldap://localhost:389/ou=users,dc=example,dc=com???(objectClass=inetOrgPerson) TLS
42 Require ldap-user coudot xguimard tchemineau
43 Options +ExecCGI
44 </Directory>
45
46
47 .. code-block:: nginx
48
49 location /usr/local/lemonldap-ng/htdocs/manager/ {
50 allow 127.0.0.0/8;
51 allow 192.168.100.0/32;
52 deny all;
53 }
54
55 .. attention::
56
57 You have to disable default Manager protection in ``lemonldap-ng.ini`` file
58 to rely only on web server by commenting relative line:
59
60 .. code:: ini
61
62 [manager]
63 ;protection = manager
64
65
66
67 LL::NG based protection
68 -----------------------
69
70
71 .. danger::
72
73 Before enabling Manager protection by LL::NG, you must have configured
74 how users authenticate on Portal, and test that you can log in.
75 Else, you will lock access to Manager and will not be able to access it anymore.
76 In that case, you have to set protection to ``none`` in ``lemonldap-ng.ini`` file.
77
78 By default, you will have a manager virtual host define in configuration.
79 If not Go to Manager, and declare Manager as a new
80 :ref:`virtual host<configvhost-lemonldapng-configuration>`,
81 for example ``manager.example.com``. Then you can then set an access rule.
82 No headers are required.
83
84 Default rule is:
85
86 .. code-block:: perl
87
88 $uid eq "dwho"
89
90 You have to change it to match your admin user (or use other conditions
91 like group membership, or any other rule based on session variables).
92 Save the configuration and exit the Manager.
93 Further accesses to the Manager will be protected by LL::NG.
94
95 Manager protection mode can be modified by editing ``lemonldap-ng.ini``:
96
97 .. code-block:: ini
98
99 [manager]
100 protection = manager
101
102
103 You also have to adapt your web server access control:
104
105 .. code-block:: apache
106
107 <Directory /usr/local/lemonldap-ng/htdocs/manager/>
108 Require all granted
109 Options +ExecCGI
110 </Directory>
111
112 .. code-block:: nginx
113
114 location /usr/local/lemonldap-ng/htdocs/manager/ {
115 allow all;
116 }
117
118 Restart your web server and try to log in to the Manager. You should be redirected to
119 LL::NG Portal.
120
121 You can then add the Manager as
122 :ref:`an application in the menu<portalmenu-categories-and-applications>`.
123
124
125 .. tip::
126
127 If for an obscure reason, the WebSSO is not working and you
128 want to access the Manager, remove the protection in ``lemonldap-ng.ini`` file.
129 and set an access control to avoid other accesses.
130
131
132 Override Portal links in Manager drop-down menu
133 -----------------------------------------------
134
135 In some particular use cases, for example if an external Manager is protected by
136 an another internal LL::NG instance, you should have to override the 'Go to Portal'
137 or 'Logout' links proposed in the external Manager drop-down menu.
138 To do this, you can override external configuration by editing ``lemonldap-ng.ini`` file.
139
140 .. code-block:: ini
141
142 [manager]
143 customPortalUrl = http://external-portal.internal.com