ECS: Omezení IP adresy klienta CAS
Shrnutí: Tento článek popisuje možnost omezit IP adresy klientů, které mají přístup k kbelíku CAS.
Pokyny
Úvod:
- Tuto funkci lze použít, když chce zákazník omezit přístup k kbelíku CAS IP adres klientů. K příslušnému uživateli mohou mít přístup pouze IP adresy nastavené v seznamu omezení.
- Ve výchozím nastavení nejsou pro uživatele nastavena žádná omezení.
- Omezení IP adresy uživatele CAS platí pro uživatele ve všech virtuálních datových serverech.
- Výchozí limit IP adresy pro uživatele je 10 a lze jej konfigurovat.
Poznámka: Chcete-li změnit výchozí hodnotu limitu IP adres, obraťte se na vzdálenou podporu Dell ECS .
Postup konfigurace omezení IP adresy klienta CAS:
- Vytvoření uživatele CAS
- Vytvořte soubor .xml se seznamem IP adres, ke kterému chcete uživateli poskytnout přístup. Jakákoli jiná IP adresa, která se pokouší o přístup k uživateli CAS, by měla selhat
FP_AUTHENTICATION_FAILED_ERR - Pomocí příkazu
PUTpříkaz k nastavení omezení IP adres pro konkrétního uživatele - Pomocí příkazu
GETpříkaz k získání nebo zobrazení omezení nastaveného pro uživatele - na
EDITomezení, které bylo dříve nastaveno pro uživatele, upravte soubor xml s IP adresami a proveďtePUT - na
DELETEomezení, které bylo dříve nastaveno, odstraňte<ip_restrictions>127.127.127.127</ip_restrictions>ze souboru xml a proveďtePUT
Ukázkový soubor xml, když je nastaveno omezení IP adresy: (pouze tyto dvě IP adresy mají přístup k uživatelskému access_user CAS)
cat new.xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions_param> <ip_restrictions>127.127.127.127</ip_restrictions> <ip_restrictions>127.128.128.128 </ip_restrictions> <user_name>access_user</user_name> </user_ip_restrictions_param>
Níže jsou uvedeny REST příkazy s PUT, GET, LISTa DELETE operací, musí být pro uživatele root použit přístupový token.
Příklad:
admin@ecsnode1:~> TOK=$(curl -iks https://localhost:4443/login -u root:*** | grep X-SDS-AUTH-TOKEN); echo $TOK X-SDS-AUTH-TOKEN: BAAcc1pZcEkxK3MyUU4xZy9ocEdnUXp0MHl2aTk0PQMAjAQASHVybjpzdG9yYWdlb3M6VmlydHVhbERhdGFDZW50ZXJEYXRhOjdlNWQ0YzFkLTkzNjEtNDBkNS1iMWE4LTUwNzE5NDEwODRiZQIADTE2ODQ4MjYzOTk5OTIDAC51cm46VG9rZW46ODYzMzEyZDEtYzA3NC00MWFjLThlMjAtZDUzZmQ3Njk2MjVhAgAC0A8= admin@ecsnode1:~>
Nastavení omezení IP adresy uživatele:
Použijte níže uvedený příkaz:PUT /object/user-cas/ip-restrictions/{namespace_name}/{user_name}
Příklad:
curl -ks -H 'Accept:application/xml' -H 'Content-Type:application/xml' -X PUT -d @new.xml -H "$TOK" https://10.245.xx.xx:4443/object/user-cas/ip-restrictions/cas_access/access_user
Příklad textu odpovědi 1: (ve výchozím nastavení, pokud pro uživatele není nastaveno žádné omezení IP adresy)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions> <user_name>access_user</user_name> </user_ip_restrictions>
Příklad textu odpovědi 2: (k uživateli má přístup pouze níže uvedená IP adresa klienta)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions_param> <ip_restrictions>128.128.128.128</ip_restrictions> <ip_restrictions>127.127.127.127</ip_restrictions> <user_name>access_user</user_name> </user_ip_restrictions_param>
Získání omezení IP adres uživatelů:
Použijte níže uvedený příkaz:GET /object/user-cas/ip-restrictions/{namespace_name}/{user_name}
Příklad:
curl -ks -H "$TOK" -H "Content-Type: application/json" https://10.245.xx.xx:4443/object/user-cas/ip-restrictions/cas_access/access_user | xmllint -format -
Příklad textu odpovědi: (k uživateli má přístup pouze níže uvedená IP adresa klienta)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions> <ip_restrictions>127.127.127.127</ip_restrictions> <user_name>access_user</user_name> </user_ip_restrictions>
Příklad textu odpovědi 2: (GET pro uživatele ve výchozím nastavení, pokud není nastaveno žádné omezení IP)
curl -ks -H "$TOK" -H "Content-Type: application/json" https://10.245.xx.xx:4443/object/user-cas/ip-restrictions/cas_access/access_user | xmllint -format - <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions> <user_name>access_user</user_name>
Seznam omezení IP adres u uživatelů:
Použijte níže uvedený příkaz:
GET /object/user-cas/ip-restrictions/
Příklad: (uvádí omezení IP pro každého uživatele)
curl -ks -H "$TOK" -H "Content-Type: application/json" https://10.245.xx.xx:4443/object/user-cas/ip-restrictions | xmllint -format - <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions_list> <userIpRestriction> <user_name>tsouser</user_name> </userIpRestriction> <userIpRestriction> <user_name>tsouser2</user_name> </userIpRestriction> <userIpRestriction> <ip_restrictions>10.245.xx.xx</ip_restrictions> <ip_restrictions>10.247.xx.xx</ip_restrictions> <ip_restrictions>10.245.xx.xx</ip_restrictions> <ip_restrictions>10.247.xx.xx</ip_restrictions> <ip_restrictions>10.243.xx.xx</ip_restrictions> <user_name>clientuser</user_name> >>>these are the restrictions set for this user </userIpRestriction> <userIpRestriction> <user_name>gctest</user_name> </userIpRestriction> <userIpRestriction> <user_name>casgcuser2</user_name> </userIpRestriction> <userIpRestriction> <user_name>user2</user_name> </userIpRestriction> <userIpRestriction> <user_name>gcu2</user_name> </userIpRestriction> <userIpRestriction> <user_name>casgcuser1</user_name> >>>all these users doesn't have any restrictions set </userIpRestriction> </user_ip_restrictions_list>
Odstranění omezení IP adres nastavených pro uživatele:
Odeberte z .xml položky omezení IP adres a proveďte PUT
cat new.xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions_param> <user_name>clientuser</user_name> </user_ip_restrictions_param>
Příkaz:
curl -ks -H 'Accept:application/xml' -H 'Content-Type:application/xml' -X PUT -d @new.xml -H "$TOK" https://10.245.130.65:4443/object/user-cas/ip-restrictions/clientns/clientuser
Příklad textu odpovědi:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions> <user_name>clientuser</user_name> </user_ip_restrictions>
Níže uvedený příklad ukazuje chování funkce během PUTa GETa přístup k uživateli s omezením i bez omezení:
cat new.xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions_param> <ip_restrictions>127.127.127.127</ip_restrictions> <user_name>access_user</user_name> </user_ip_restrictions_param>
PUT:
curl -ks -H 'Accept:application/xml' -H 'Content-Type:application/xml' -X PUT -d @new.xml -H "$TOK" https://10.245.xx.xx:4443/object/user-cas/ip-restrictions/cas_access/access_user
GET:
curl -ks -H "$TOK" -H "Content-Type: application/json" https://10.245.xx.xx:4443/object/user-cas/ip-restrictions/cas_access/access_user | xmllint -format - <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions> <ip_restrictions>127.127.127.127</ip_restrictions> <user_name>access_user</user_name> </user_ip_restrictions>
Pomocí JCASS jste se pokusili získat přístup k fondu z adresy 127.127.127.127 a získali jsme přístup:
CASScript>po 10.245.xx.xx?name=access_user,secret=centera@1234 Attempting to connect to: 10.245.xx.xx?name=access_user,secret=centera@1234 Connected to: 10.245.xx.xx?name=access_user,secret=centera@1234 CASPool Properties: Connection String: 10.245.xx.xx?name=access_user,secret=centera@1234 Cluster Time: 2020.07.07 06:32:24 GMT Buffer Size: 16384 Prefetch Buffer Size: 32768 Connection Timeout: 120000 Multi-Cluster Failover Enabled: True Collision Avoidance Enabled: False
Pokus o přístup k fondu z IP adresy, která není v seznamu povolených IP adres. Přístup k fondu by se měl nezdaří a zobrazí se následující chyba:
CASScript>po 10.245.xx.xx?name=access_user,secret=centera@1234
Attempting to connect to: 10.245.xx.xx?name=access_user,secret=centera@1234
SDK Error Occurred:
Error Number: -10153
System Error: 0
Error: FP_AUTHENTICATION_FAILED_ERR
Error Class: null
Trace: HPPAuthCRTransaction.run<FPConnection::authenticate<Cluster.authenticate<Cluster::updateClusterInfo()<ClusterCloud::updateClusterInfo(e9f1a3c9-5cb1-3a76-a589-f639de9ad2e4)<ClusterCloud::getClusterInfo(0,ClusterInformation&,2)<FPPool::Open(10.245.130.64?name=access_user,secret=centera@1234)<_FPPool_Open(10.245.130.64?name=access_user,secret=centera@1234)<FPPool_Open8(10.245.130.64?name=access_user,secret=centera@1234)Další informace
https://dl.dell.com/content/manual52394679-ecs-3-8-administration-guide.pdf?language=en-us
https://www.dell.com/support/manuals/en-us/ecs-appliance-software-with-encryption/ecs_p_adminguide_3_8/restrict-user-ip-addresses-that-can-access-a-cas-bucket?guid=guid-c4e67b45-46f8-46fa-93cf-f63795add0ad⟨=en-us