0

我创建了用户并只给了他一个角色。(成员)目前这个角色没有任何 Http 动词或路径的权限。这是我的用户:

{
organizations: [1]
0:  {
website: ""
description: "AREAS"
roles: [1]
0:  {
name: "Member"
id: "09dc1bdba42c48de9e15e88816284cbc"
}-
-
enabled: true
id: "363ac390cfc94aa293e02547afa78256"
domain_id: "default"
name: "AREAS"
}-
-
displayName: "root"
roles: [0]
app_id: "aea8f4a70b87422cb48068db9f0c6aea"
email: "root"
id: "root"
}

现在,当我尝试对地址执行 GET 请求时:http://localhost/parameters/search_tables/ 对此用户没有权限,它仍然允许我访问并重定向我。这是来自 pep 代理的日志:

2015-11-13 14:55:53.446  - INFO: IDM-Client - Checking token with IDM...
2015-11-13 14:55:53.484  - INFO: AZF-Client - Checking auth with AZF...
2015-11-13 14:55:53.484  - INFO: AZF-Client - Checking authorization
to roles [ '09dc1bdba42c48de9e15e88816284cbc' ] to do  GET  
on  parameters/search_tables/ and app  aea8f4a70b87422cb48068db9f0c6aea
2015-11-13 14:55:53.508  - INFO: Root - Access-token OK. Redirecting to app...
Refused to set unsafe header "accept-encoding"
Refused to set unsafe header "cookie"

我关于授权的配置文件是:

config.azf = {
        enabled: true,
    host: '192.168.4.180',
    port: 8080,
    path: '/authzforce/domains/afb096b2-8951-11e5-980f-6bf3c4dac98a/pdp'
};
config.public_paths = [];

config.tokens_engine = 'oauth2';

我的 Pap 政策是:

 <PolicySet PolicySetId="default" Version="1.0" 
PolicyCombiningAlgId="urn:oasis:names:tc:xacml:1.1:policy-combining-
algorithm:ordered-permit-overrides">
<Target />
 <Policy PolicyId="permit-all" Version="1.0" 
 RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.1:rule-combining-
 algorithm:ordered-permit-overrides">
<Target />
<Rule RuleId="permit-all" Effect="Permit" />
 </Policy>
 </PolicySet>

我应该如何制定我的 PAP 策略以启用授权级别 2,仅使用 http 动词和资源路径进行授权?

4

1 回答 1

1

默认情况下,当没有添加策略时,Authzforce PAP 允许所有操作。检查您的 PAP 是否有正确的信息:

GET
/domains/{domainId}/pap/policySet

编辑1:

为了能够与 Authzforce 连接,您需要在 IdM 实例中配置一些 Authzforce 参数:

  • ACCESS_CONTROL_URLfiware-idm/horizon/openstack_dashboard/local/local_settings.py
  • ACCESS_CONTROL_MAGIC_KEYfiware-idm/horizon/openstack_dashboard/local/local_settings.py

然后,只需转到 IdM,并检查权限和角色是否配置正确。有时,您必须“触发”IdM 中的策略生成,方法是转到您的应用程序 -> 管理角色,然后单击“保存”以触发 XACML 生成。

于 2015-11-13T14:49:52.207 回答