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