首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ABAC返回序列化权限

ABAC返回序列化权限
EN

Stack Overflow用户
提问于 2018-07-25 09:20:01
回答 2查看 369关注 0票数 2

如何使用ABAC获得可能的操作(权限)?我需要对前端说,这个按钮应该被隐藏,因为这个动作是为这个特定的情况而限制的,而另一个则不是。

目前只有混合RBAC/ABAC模型是我正在考虑的,但它仍然没有涵盖所有的情况,因为我们可能有未经认证的访问,其权限将不包括在RBAC,因此,应该涵盖在ABAC。

问题是,ABAC是否可以为当前对象收集该用户允许的所有操作?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-07-25 15:34:32

是的,您可以根据用户的属性限制UI元素。如果用户的属性发生变化,比如用户被提升或降级,那么一旦逻辑实现,前端将根据您的策略进行调整。

我有一个使用Java +Security限制使用ABAC的UI元素的示例项目:https://github.com/michaelcgood/spring-security-ui-demo

正如我提到的,我为公理学工作,这个项目被配置为与pdp.properties中的公理化项目一起工作。但是,该项目可以与具有适当属性设置的实现ABAC的XACML的其他软件一起使用。

如果您不使用Java,那么这个项目对您就不会那么有用了。但是,它确实演示了您所要求的内容-- UI元素可以被限制。

前端框架是Thymeleaf,这是一个服务器端Java模板引擎,它是HTML友好的。

通过应用资源ID限制UI元素的代码是:<div class="jumbotron" style="background-color: green" sec:authorize="XACMLDecisionUI('secretmessage')"> <p style="color:white" align="center">Message only available to senior admins (seniority == 2).</p> </div>

如果你正在使用公理化软件,请在评论中告诉我,我有进一步的指导,我可以给你。

谢谢你,迈克尔

票数 2
EN

Stack Overflow用户

发布于 2018-07-28 16:31:03

ABAC是一个宽泛的概念,它没有具体说明这种低级行为;而且很难为所有ABAC框架提供一个通用的最佳实践,因为它们中有越来越多的框架可能是完全不同的:其中一些是标准的(例如。绿洲XACMLNIST NGAC),其他非标准但通用的(例如。( OPA),其他特定产品(例如。Kubernetes ABAC)。

无论如何,在XACML --最成熟的标准--中,您使用的是多决策剖面 (例如方案3.3重复属性类别),它允许在单个XACML请求中请求多个授权决策:

代码语言:javascript
复制
<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" CombinedDecision="false" ReturnPolicyIdList="false">
   <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
      <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="false">
         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">/objects/XXX</AttributeValue>
      </Attribute>
   </Attributes>
   <Attributes Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
      <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" IncludeInResult="false">
         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">bob</AttributeValue>
      </Attribute>
   </Attributes>
   <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
      <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">create</AttributeValue>
      </Attribute>
   </Attributes>
   <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
      <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue>
      </Attribute>
   </Attributes>
   <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
      <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">update</AttributeValue>
      </Attribute>
   </Attributes>
   <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
      <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="true">
         <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">delete</AttributeValue>
      </Attribute>
   </Attributes>
</Request>

在本例中,我们请求对给定用户(bob)和资源(/objects/XXX)进行授权,但同时执行多个操作(创建、读取、更新、删除)。一个兼容的PDP返回一个具有多个结果的XACML响应,每个单个授权决策请求一个。IncludeInResult告诉响应中包含哪些属性,以便PEP可以关联。

AuthzForce和AT&T XACML等开源XACML实现支持这种多决策配置文件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51515282

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档