| 1 |
AWX (Ansible Tower) |
| 2 |
=================== |
| 3 |
|
| 4 |
|logo-awx.png| |logo-ansibletower.png| |
| 5 |
|
| 6 |
Presentation |
| 7 |
------------ |
| 8 |
|
| 9 |
`AWX <https://github.com/ansible/awx>`__ is the upstream version for |
| 10 |
Ansible Tower. |
| 11 |
|
| 12 |
This documentation explains how to interconnect LemonLDAP::NG and AWX |
| 13 |
using SAML 2.0 protocol. |
| 14 |
|
| 15 |
You can find the Official AWX documentation about this topic here : |
| 16 |
https://docs.ansible.com/ansible-tower/latest/html/administration/ent_auth.html#saml-authentication-settings |
| 17 |
Please read it before the LL::NG doc. |
| 18 |
|
| 19 |
Configuration |
| 20 |
------------- |
| 21 |
|
| 22 |
This page assumes you already have configured the SAML Service in |
| 23 |
LemonLDAP::NG, if not please follow : |
| 24 |
:doc:`SAML service configuration<../samlservice>` |
| 25 |
|
| 26 |
AWX SAML Key & Certificate |
| 27 |
~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 28 |
|
| 29 |
You'll need a private key and the corresponding certificate to setup |
| 30 |
saml in AWX, you can do it with your pki or with openssl on your machine |
| 31 |
: |
| 32 |
|
| 33 |
:: |
| 34 |
|
| 35 |
openssl req -x509 -newkey rsa:4096 -keyout saml-awx.key -out saml-awx.crt -days 3650 -nodes |
| 36 |
|
| 37 |
LL::NG SAML Certificate |
| 38 |
~~~~~~~~~~~~~~~~~~~~~~~ |
| 39 |
|
| 40 |
AWX need a certificate for the IDP signature, a public key won't work. |
| 41 |
You can either just generate a certificate from the private key and put |
| 42 |
it in AWX conf, or you can do it globally. |
| 43 |
|
| 44 |
Generate Certificate from Key |
| 45 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 46 |
|
| 47 |
You can find your private key in : SAML2 Service -> Security Parameters |
| 48 |
-> Signature -> Private Key |
| 49 |
|
| 50 |
Copy it somewhere secure as lemonldap.key, and then generate the |
| 51 |
certificate with this command : |
| 52 |
|
| 53 |
:: |
| 54 |
|
| 55 |
openssl req -new -x509 -days 3650 -key lemonldap.key > lemonldap.crt |
| 56 |
|
| 57 |
After that, if you want, you can replace your SAML public key with this |
| 58 |
certificate in LL::NG configuration, this is not mandatory. |
| 59 |
|
| 60 |
AWX |
| 61 |
~~~ |
| 62 |
|
| 63 |
You'll need an administrator account, then go to Settings -> |
| 64 |
Authentication -> SAML |
| 65 |
|
| 66 |
|image2| |
| 67 |
|
| 68 |
There is a few settings : |
| 69 |
|
| 70 |
SAML Service Provider Entity ID |
| 71 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 72 |
|
| 73 |
This is the entityID for awx, lets put the fqdn : ``awx.example.com`` |
| 74 |
|
| 75 |
SAML Service Provider Public Certificate |
| 76 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 77 |
|
| 78 |
Put the content of ``saml-awx.crt`` :: |
| 79 |
|
| 80 |
-----BEGIN CERTIFICATE----- |
| 81 |
cert |
| 82 |
-----END CERTIFICATE----- |
| 83 |
|
| 84 |
SAML Service Provider Private Key |
| 85 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 86 |
|
| 87 |
Put the content of ``saml-awx.key`` :: |
| 88 |
|
| 89 |
-----BEGIN RSA PRIVATE KEY----- |
| 90 |
key |
| 91 |
-----END RSA PRIVATE KEY----- |
| 92 |
|
| 93 |
It will be replaced with ``$encrypted$`` after you save the settings. |
| 94 |
|
| 95 |
SAML Service Provider Organization Info |
| 96 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 97 |
|
| 98 |
Organization Info for The SP, this is purely "for looks" |
| 99 |
|
| 100 |
:: |
| 101 |
|
| 102 |
{ |
| 103 |
"en-US": { |
| 104 |
"displayname": "AWX ACME", |
| 105 |
"url": "https://awx.example.com", |
| 106 |
"name": "awxacme" |
| 107 |
} |
| 108 |
} |
| 109 |
|
| 110 |
SAML Service Provider Technical Contact |
| 111 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 112 |
|
| 113 |
Technical Contact for the SP |
| 114 |
|
| 115 |
:: |
| 116 |
|
| 117 |
{ |
| 118 |
"emailAddress": "[email protected]", |
| 119 |
"givenName": "Support ACME" |
| 120 |
} |
| 121 |
|
| 122 |
SAML Service Provider Support Contact |
| 123 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 124 |
|
| 125 |
Support Contact for the SP |
| 126 |
|
| 127 |
:: |
| 128 |
|
| 129 |
{ |
| 130 |
"emailAddress": "[email protected]", |
| 131 |
"givenName": "Support ACME" |
| 132 |
} |
| 133 |
|
| 134 |
SAML Enabled Identity Providers |
| 135 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 136 |
|
| 137 |
This is the configuration of the IdP : |
| 138 |
|
| 139 |
:: |
| 140 |
|
| 141 |
{ |
| 142 |
"lemonldap": { |
| 143 |
"attr_last_name": "sn", |
| 144 |
"x509cert": "SOXGp.....", |
| 145 |
"attr_username": "uid", |
| 146 |
"entity_id": "https://auth.example.com/saml/metadata", |
| 147 |
"attr_first_name": "givenName", |
| 148 |
"attr_email": "mail", |
| 149 |
"attr_user_permanent_id": "uid", |
| 150 |
"url": "https://auth.example.com/saml/singleSignOn" |
| 151 |
} |
| 152 |
} |
| 153 |
|
| 154 |
- "attr_last_name": "sn" SAML Attribute for the user last name |
| 155 |
- "x509cert": "SOXGp....." the content of ``lemonldap.crt`` generated |
| 156 |
in the "LL::NG SAML Certificate" section |
| 157 |
- "attr_username": "uid" SAML Attribute for the user username |
| 158 |
- "entity_id": "https://auth.example.com/saml/metadata" entityID of the |
| 159 |
IdP |
| 160 |
- "attr_first_name": "givenName" SAML Attribute for the user first name |
| 161 |
- "attr_email": "mail" SAML Attribute user for the user email |
| 162 |
- "attr_user_permanent_id": "uid" SAML Attribute for the user unique id |
| 163 |
inside AWX |
| 164 |
- "url": "https://auth.example.com/saml/singleSignOn" SAML SSO Url |
| 165 |
|
| 166 |
SAML Security Config |
| 167 |
^^^^^^^^^^^^^^^^^^^^ |
| 168 |
|
| 169 |
:: |
| 170 |
|
| 171 |
{ |
| 172 |
"requestedAuthnContext": false, |
| 173 |
"authnRequestsSigned": true |
| 174 |
} |
| 175 |
|
| 176 |
Save your configuration. |
| 177 |
|
| 178 |
LemonLDAP:NG |
| 179 |
~~~~~~~~~~~~ |
| 180 |
|
| 181 |
We now have to define a service provider in LL:NG. |
| 182 |
|
| 183 |
Go to "SAML service providers", click on "Add SAML SP" and name it as |
| 184 |
you want (example : 'AWX') |
| 185 |
|
| 186 |
In the new subtree 'AWX', open 'Metadata' and paste the content of the |
| 187 |
AWX Metadata, wich can be found at the |
| 188 |
``SAML Service Provider Metadata URL`` in AWX : |
| 189 |
https://awx.example.com/sso/metadata/saml/ |
| 190 |
|
| 191 |
|image3| |
| 192 |
|
| 193 |
Now go in "Exported attributes" and add, the 'uid', 'sn', 'givenName', |
| 194 |
'mail'. |
| 195 |
|
| 196 |
All four attributes are mandatory for AWX. Make sure they match the |
| 197 |
names of the attributes available in your LemonLDAP sessions. |
| 198 |
|
| 199 |
|image4| |
| 200 |
|
| 201 |
Don't forget to save your configuration. |
| 202 |
|
| 203 |
You are now good to go, and you can add the application in |
| 204 |
:doc:`your menu<../portalmenu>` and |
| 205 |
:doc:`your virtual hosts<../configvhost>`. |
| 206 |
|
| 207 |
You should now have a SAML button on the login page : |
| 208 |
|
| 209 |
|image5| |
| 210 |
|
| 211 |
.. |logo-awx.png| image:: /applications/logo-awx.png |
| 212 |
:class: align-center |
| 213 |
.. |logo-ansibletower.png| image:: /applications/logo-ansibletower.png |
| 214 |
:class: align-center |
| 215 |
.. |image2| image:: /applications/saml-awx.png |
| 216 |
:class: align-center |
| 217 |
.. |image3| image:: /applications/awx-metadata.png |
| 218 |
:class: align-center |
| 219 |
.. |image4| image:: /applications/awx-attr.png |
| 220 |
:class: align-center |
| 221 |
.. |image5| image:: /applications/awx-saml-login.png |
| 222 |
:class: align-center |
| 223 |
|