ECS: Ograniczenie adresu IP klienta CAS
Podsumowanie: W tym artykule opisano możliwość ograniczenia adresów IP klientów, którzy mogą uzyskiwać dostęp do zasobnika CAS.
Instrukcje
Wprowadzenie:
- Ta funkcja może być używana, gdy klient chce ograniczyć adresy IP klientów przed dostępem do zasobnika CAS. Tylko adresy IP ustawione na liście ograniczeń mogą mieć dostęp do odpowiedniego użytkownika.
- Domyślnie nie ma żadnych ograniczeń ustawionych dla użytkownika.
- Ograniczenie adresu IP użytkownika CAS ma zastosowanie do użytkownika we wszystkich VDC.
- Domyślny limit adresów IP dla użytkownika wynosi 10 i można go konfigurować.
Uwaga: Skontaktuj się ze zdalną pomocą techniczną ECS firmy Dell, aby zmienić domyślną wartość limitu IP.
Etapy konfigurowania ograniczenia adresu IP klienta CAS:
- Tworzenie użytkownika CAS
- Utwórz plik .xml z listą adresów IP, do których chcesz przyznać dostęp użytkownikowi, każdy inny adres IP próbujący uzyskać dostęp do użytkownika CAS powinien zakończyć się niepowodzeniem
FP_AUTHENTICATION_FAILED_ERR - Użyj polecenia
PUTpolecenie ustawiania ograniczenia adresu IP dla określonego użytkownika - Użyj polecenia
GET, aby pobrać lub wyświetlić ograniczenia ustawione dla użytkownika - do
EDITograniczenie, które zostało wcześniej ustawione dla użytkownika, edytuj plik xml z adresami IP i wykonajPUT - do
DELETEwcześniej ustawionego ograniczenia, usuń<ip_restrictions>127.127.127.127</ip_restrictions>z pliku xml i wykonajPUT
Przykładowy plik xml po ustawieniu ograniczenia IP: (tylko te dwa adresy IP mają dostęp do access_user użytkownika 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>
Poniżej znajdują się REST Polecenia z PUT, GET, LISTi DELETE operacje, token dostępu musi być używany dla użytkownika głównego.
Przykład:
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:~>
Aby ustawić ograniczenia dotyczące adresów IP użytkowników:
Użyj poniższego polecenia:PUT /object/user-cas/ip-restrictions/{namespace_name}/{user_name}
Przykład:
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
Przykład treści odpowiedzi 1: (domyślnie, jeśli nie ustawiono ograniczenia IP dla użytkownika)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions> <user_name>access_user</user_name> </user_ip_restrictions>
Przykład treści odpowiedzi 2: (tylko podany poniżej adres IP klienta ma dostęp do użytkownika)
<?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>
Aby uzyskać ograniczenia dotyczące adresów IP użytkowników:
Użyj poniższego polecenia:GET /object/user-cas/ip-restrictions/{namespace_name}/{user_name}
Przykład:
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 -
Przykład treści odpowiedzi: (tylko podany poniżej adres IP klienta ma dostęp do użytkownika)
<?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>
Przykład treści odpowiedzi 2: (GET dla użytkownika domyślnie, gdy nie ma ustawionego ograniczenia 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>
Aby wyświetlić listę ograniczeń IP dla użytkowników:
Użyj poniższego polecenia:
GET /object/user-cas/ip-restrictions/
Przykład: (wyświetla ograniczenia IP dla każdego użytkownika)
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>
Aby usunąć ograniczenia adresu IP ustawione dla użytkownika:
Usuń wpisy ograniczeń IP z .xml i wykonaj 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>
Polecenie:
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
Przykład treści odpowiedzi:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions> <user_name>clientuser</user_name> </user_ip_restrictions>
Poniższy przykład pokazuje zachowanie funkcji podczas PUTi GEToraz dostęp do użytkownika z ograniczeniami i bez ograniczeń:
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>
Korzystając z narzędzia JCASS, próbował uzyskać dostęp do puli z adresu 127.127.127.127 i uzyskał dostęp do:
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
Podjęto próbę uzyskania dostępu do puli z adresu IP, który nie znajduje się na liście ograniczeń adresów IP (która jest listą dozwolonych). Dostęp do puli powinien zakończyć się niepowodzeniem z poniższym błędem:
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)Dodatkowe informacje
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