11
szerkesztés
Módosítások
SSP2
,nincs szerkesztési összefoglaló
<code>composer create-project simplesamlphp/simplesamlphp:2.1.3</code>
Mappaszerkezet módosítása:
Alias /simplesaml /var/simplesamlphp-prod/public
<Directory /var/simplesamlphp-prod/public>
Require all granted
</Directory>
===Simplesamlphp Alapbeállítások=======Konfigurációs fájlok másolása====Mielőtt aktiváljuk valamelyik főszolgáltatását (IdPAmennyiben korábbi verziókat használtunk,SP...) jó megközelítés lehet diff segítségével ellenőrizni a telepített alkalmazásnak, néhány beállítást meg kell adnunk különbségeket a korábbi <code>config.php</code> fileunk és a <code>config.php.dist</code> és között. Ha ilyennel nem rendelkezünk akkor lehet rögtön alapul venni a <code>config/authsources.php.dist</code> konfigurációs fájlokban-et és hasonlóképp a metadata-templates mappát. ====Konfigurációs fájlok szerkesztése====
<span style="color:green"code>A 'baseurlpath'=> 'config.php''' és '''authsources.php''' fájlok másolása utána ellenőrizzük, hogy a SimpleSAMLphp működik-e, a https://exampleyour.orgcanonical.host.name/simplesaml oldalon./',</spancode>
=====Adminisztrációs adatok beállítása=====
* '''Az "admin" felhasználó jelszavát, mellyel webes felületen keresztül be tud lépni a települő SSP-be.'''
Ha fájlba akarunk naplózni, akkor a megfelelő könyvtárhoz biztosítsunk írás jogot a webszerver felhasználónak, és ne felejtsünk el gondoskodni a naplófájlok rotálásáról!
* Naplózási szint beállítása a '''config/config.php'''-ban
<span style="color:red">A "SimpleSAML\Logger::DEBUG" a legrészletesebb naplózási beállítás, éles rendszernél nem ajánlott csak hiba keresés esetén.</span>
=====Modulok engedélyezése=====
'module.enable' => [
'exampleauth' => true,
'saml' => false, //
'core' => null, // Alapértelmezett érték
'ldap' => true, // 2.x verzióban külön telepíteni és engedélyezni kell az ldap modult.
'admin' => true, // Ezt szükséges engedélyezni hogy elérhessük az adminisztrációs felületet
],
=====Tanúsítvány készítése=====
* A SimpleSAMLphp alapértelmezetten a tanúsítványt a '''cert''' mappában keresi.
* Az alábbi paranccsal egy 10 éves [[FedCerts | self-signed tanúsítvány]] generálunk a SimpleSMALphp számára.
openssl req -new -newkey rsa:2048 3072 -x509 -days 3652 -nodes -out cert/saml-example-org.crt -keyout cert/saml-example-org.key
A fingerprint az alábbi módon kérdezhető le a legegyszerűbben
===Telepítés kész===
Amennyiben elkészültünk a fenti lépésekkel, úgy a [https://service.example.org/simplesaml/ admin https://service.example.org/simplesaml/admin] címen elérjük a telepített SSP-nk webes adminfelületét, ahol megejthetjük a további beállítások nagy részét.
==Identity Provider (IdP) beállítás==
'enable.saml20-idp' => true,
===LDAP autentikációmetadata/saml20-idp-hosted.php===Meg kell adni, hogy az IdP milyen módon azonosítsa a felhasználót, amennyiben alapértelmezés szerint nem engedélyezett modult szeretnénk használni, úgy a megfelelő modult a <code>modules</code> könyvtár alatt engedélyezni kell. Az alábbi példában az LDAP alapú azonosítást mutatjuk be, amely külön modult nem igényel, alapértelmezés szerint része a telepített alkalmazásnak.
/*
* Which attributes should be retrieved The hostname for this IdP. This makes it possible to run multiple * IdPs from the LDAP serversame configuration.'__DEFAULT__' means that this one * This can should be an array of attribute names, or NULL, in which case * all attributes are fetchedused by default.
*/
'attributeshost' => NULL'__DEFAULT__',
/*
* The pattern which should be used private key and certificate to create the users DN given the usernameuse when signing responses. * %username% These can be stored as files in this pattern will be replaced with the users username.cert-directory or retrieved * * This option is not used if the search.enable option is set to TRUEfrom a database. 'dnpattern' => 'uid=%username%,ou=people,dc=example,dc=org',
*/
/*
* As an alternative The authentication source which should be used to specifying a pattern for authenticate the users DN, it is possible to * search for user. This must match one of the username entries in a set of attributesconfig/authsources. This is enabled by this optionphp.
*/
'searchauth' => 'example-ldap', ]; A fentebb hivatkozott certeket korábban létrehoztuk, de az example-ldap auth forrást még nem: ===LDAP autentikáció=== Javasolt az LDAP-ban egy olyan bejegyzést létrehozni az IdP számára, amely olvasni tudja a felhasználóknak a föderációban használt attribútumait. Az azonosítás alapértelmezett módon a felhasználó nevében történő újra bind-olással történik, így a jelszóhoz nem kell hozzáférést adni. Ahhoz, hogy megadhassuk az LDAP-hoz tartozó beállításokat, a <code>config/authsources.php</code> fájlt kell szerkesztenünk. Az alábbi kódrészletet elegendő beszúrni, és az egyes változóknak a helyi LDAP-nak megfelelő adatokat értékül adni.<source lang="php">'example-ldap' => [ 'ldap:Ldap', /** * The connection string for the LDAP-server. * You can add multiple by separating them with a space. */ 'connection_string' => 'ldap.example.org', /** * Whether SSL/TLS should be used when contacting the LDAP server. * Possible values are 'ssl', 'tls' or 'none' */ 'encryption' => 'ssl', /** * The LDAP version to use when interfacing the LDAP-server. * Defaults to 3 */ 'version' => 3, /** * Set to TRUE to enableLDAP debug level. Passed to the LDAP connector class. * * Default: FALSE * Required: No */ 'debug' => false, /** * The LDAP-options to pass when setting up a connection * See [Symfony documentation] */ 'options' => TRUE[ /** * Set whether to follow referrals. * AD Controllers may require 0x00 to function. * Possible values are 0x00 (NEVER), 0x01 (SEARCHING), * 0x02 (FINDING) or 0x03 (ALWAYS). */ 'referrals' => 0x00, 'network_timeout' => 3, ], /** * The DN which connector to use. * Defaults to '\SimpleSAML\Module\ldap\Connector\Ldap', but can be set * to '\SimpleSAML\Module\ldap\Connector\ActiveDirectory' when * authenticating against Microsoft Active Directory. This will * provide you with more specific error messages. */ 'connector' => '\SimpleSAML\Module\ldap\Connector\Ldap', /** * Which attributes should be used as a base for retrieved from the searchLDAP server. * This can be a single stringan array of attribute names, or NULL, in which case only that * all attributes are fetched. */ 'attributes' => null, /** * Which attributes should be base64 encoded after retrieval from * the LDAP server. */ 'attributes.binary' => [ 'jpegPhoto', 'objectGUID', 'objectSid', 'mS-DS-ConsistencyGuid' ], /** * The pattern which should be used to create the user's DN given * the username. %username% in this pattern will be replaced with * the user's username. * * This option is not used if the search.enable option is searchedset to TRUE. */ 'dnpattern' => 'uid=%username%,ou=people,dc=example,dc=org', or /** * As analternative to specifying a pattern for the users DN, it is * possible to search for the username in a set of attributes. This is * enabled by this option. */ 'search.enable' => false, /** * An array on DNs which will be used as a base for the search. In * case of multiple strings, in which case they will be searched in the order given. */ 'search.base' => [ 'ou=people,dc=example,dc=org', ], /** * The scope of the search. Valid values are 'sub' and 'one' and * 'base', first one being the default if no value is set. */ 'search.scope' => 'sub', /** * The attribute(s) the username should match against. * * This is an array with one or more attribute names. Any of the * attributes in * the array may match the value the username. */ 'search.attributes' => array(['uid', 'mail')], /** * The username & password Additional filters that must match for the simpleSAMLphp should bind entire LDAP search to before searching * be true. If * this is left as NULL, no bind will * This should be performed before searchinga single string conforming to [RFC 1960] * and [RFC 2544].The string is appended to the search attributes */ 'search.usernamefilter' => 'cn(&(objectClass=simplesamlphp,dcPerson)(|(sn=example,dcDoe)(cn=org', 'search.password' => 'servicepasswordJohn *)))',
</source>