ECS: Restrizione IP client CAS
Riepilogo: Questo articolo descrive la possibilità di limitare gli indirizzi IP del client che possono accedere a un bucket CAS.
Istruzioni
Introduzione:
- La funzione può essere utilizzata quando il cliente desidera impedire agli IP client di accedere a un bucket CAS. Solo gli IP impostati nell'elenco delle restrizioni possono accedere al relativo utente.
- Per impostazione predefinita, non sono impostate restrizioni per un utente.
- La restrizione degli IP per gli utenti CAS è applicabile per l'utente su tutti i VDC.
- Il limite predefinito di IP per utente è 10 ed è configurabile.
Nota: Contattare il supporto remoto Dell ECS per modificare il valore predefinito del limite IP.
Procedura per configurare la restrizione IP del client CAS:
- Creazione di un utente CAS
- Creare un file di .xml con l'elenco di indirizzi IP per cui si desidera fornire l'accesso all'utente; qualsiasi altro IP che tenta di accedere all'utente CAS ha esito negativo
FP_AUTHENTICATION_FAILED_ERR - Utilizzare il comando
PUTper impostare una restrizione IP per un particolare utente - Utilizzare il comando
GETComando per ottenere o visualizzare le restrizioni impostate per un utente - Per
EDITuna restrizione precedentemente impostata per un utente, modificare il file xml con gli IP ed eseguire unPUT - Per
DELETEuna restrizione impostata in precedenza, rimuovere il<ip_restrictions>127.127.127.127</ip_restrictions>dal file XML ed eseguire unPUT
File xml di esempio quando è impostata la restrizione IP: (solo questi due IP hanno accesso alla access_user utente 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>
Di seguito sono riportati i REST Comandi con PUT, GET, LISTe DELETE operazioni, è necessario utilizzare un token di accesso per l'utente root.
Esempio:
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:~>
Per impostare le restrizioni degli IP utente:
Utilizzare il comando riportato di seguito:PUT /object/user-cas/ip-restrictions/{namespace_name}/{user_name}
Esempio:
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
Esempio 1 del corpo della risposta: (per impostazione predefinita quando non sono impostate restrizioni IP per l'utente)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions> <user_name>access_user</user_name> </user_ip_restrictions>
Esempio 2 del corpo della risposta: (solo l'IP client fornito di seguito ha accesso per l'utente)
<?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>
Per ottenere le restrizioni degli IP utente:
Utilizzare il comando riportato di seguito:GET /object/user-cas/ip-restrictions/{namespace_name}/{user_name}
Esempio:
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 -
Esempio di corpo della risposta: (solo l'IP client fornito di seguito ha accesso per l'utente)
<?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>
Esempio 2 del corpo della risposta: (GET per un utente per impostazione predefinita quando non è impostata alcuna restrizione 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>
Per elencare le restrizioni IP con gli utenti:
Utilizzare il comando riportato di seguito:
GET /object/user-cas/ip-restrictions/
Esempio: (elenca le restrizioni IP per ogni utente)
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>
Per eliminare le restrizioni IP impostate per un utente:
Rimuovere le voci di restrizione IP dal .xml ed eseguire una 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>
Comando:
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
Esempio di corpo della risposta:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions> <user_name>clientuser</user_name> </user_ip_restrictions>
L'esempio seguente mostra il comportamento della funzione durante PUTe GETe l'accesso a un utente con e senza restrizioni:
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>
Utilizzando JCASS, ha provato ad accedere al pool da 127.127.127.127 e ha potuto accedere:
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
Si è tentato di accedere al pool da un IP non presente nell'elenco delle restrizioni IP (un elenco di indirizzi consentiti). L'accesso al pool dovrebbe avere esito negativo con il seguente errore:
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)Informazioni aggiuntive
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