ECS:CAS 客户端 IP 限制
摘要: 本文介绍如何限制可访问 CAS 存储区的客户端 IP 地址。
本文适用于
本文不适用于
本文并非针对某种特定的产品。
本文并非包含所有产品版本。
说明
简介:
- 当客户希望限制客户端 IP 访问 CAS 存储区时,可以使用该功能。只有在限制列表下设置的 IP 才能访问相关用户。
- 默认情况下,没有为用户设置任何限制。
- CAS 用户 IP 限制适用于所有 VDC 中的用户。
- 针对用户的默认 IP 限制是 10,并且可以配置。
提醒:请联系 Dell ECS 远程支持 以更改默认 IP 限制值。
配置 CAS 客户端 IP 限制的步骤:
- 创建 CAS 用户
- 使用要向用户提供访问权限的 IP 列表创建 .xml 文件,尝试访问 CAS 用户的任何其他 IP 都应失败,并显示
FP_AUTHENTICATION_FAILED_ERR - 使用
PUT为特定用户设置 IP 限制的命令 - 使用
GET用于获取或查看用户限制集的命令 - 修改至
EDIT之前为用户设置的限制,使用 IP 编辑 XML 文件,然后执行PUT - 修改至
DELETE之前设置的限制,请删除<ip_restrictions>127.127.127.127</ip_restrictions>从 xml 文件中执行PUT
设置 IP 限制时的示例 xml 文件:(只有这两个 IP 有权访问 CAS 用户access_user)
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>
以下是 REST 命令 PUT开始, GET开始, LIST以及 DELETE 作,root 用户必须使用访问令牌。
例:
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:~>
要设置用户 IP 限制,请执行以下作:
使用以下命令:PUT /object/user-cas/ip-restrictions/{namespace_name}/{user_name}
示例:
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
响应正文示例 1:(默认情况下,当没有为用户设置 IP 限制时)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions> <user_name>access_user</user_name> </user_ip_restrictions>
响应正文示例 2:(只有下面提供的客户端 IP 有权访问用户)
<?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>
要获取用户 IP 限制,请执行以下作:
使用以下命令:GET /object/user-cas/ip-restrictions/{namespace_name}/{user_name}
示例:
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 -
响应正文示例:(只有下面提供的客户端 IP 有权访问用户)
<?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>
响应正文示例 2:(GET 默认情况下,当未设置 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>
要向用户列出 IP 限制,请执行以下作:
使用以下命令:
GET /object/user-cas/ip-restrictions/
示例:(列出每个用户的 IP 限制)
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>
要删除为用户设置的 IP 限制,请执行以下作:
从.xml中删除 IP 限制条目,然后执行 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>
命令:
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
响应正文示例:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <user_ip_restrictions> <user_name>clientuser</user_name> </user_ip_restrictions>
以下示例显示了该功能在 PUT以及 GET,以及访问有和无限制的用户:
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>
使用 JCASS,尝试从 127.127.127.127 访问池,并且可以访问:
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
尝试从不在 IP 限制列表(这是允许列表)中的 IP 访问池。对池的访问应失败,并显示以下错误:
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)其他信息
另请参阅 ECS 管理指南:
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
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
受影响的产品
Elastic Cloud Storage产品
ECS, ECS Appliance文章属性
文章编号: 000214011
文章类型: How To
上次修改时间: 18 5月 2026
版本: 8
从其他戴尔用户那里查找问题的答案
支持服务
检查您的设备是否在支持服务涵盖的范围内。