【问题标题】:In Attribute-Based Access Control (ABAC), how to model attributes from a relation between subject and object?在基于属性的访问控制 (ABAC) 中,如何根据主体和客体之间的关系对属性进行建模?
【发布时间】:2018-01-05 16:29:49
【问题描述】:

在基于属性的访问控制 (ABAC) 中,对来自主客体之间的关系的属性进行建模的推荐方法是什么?

例如:病历作为客体,医生/护士的账户作为主体。在一个简单的设置中,主体和客体之间没有直接关系,规则可能会声明类似“心脏病科中的执业护士可以查看 心脏病患者的病历”(来自NIST Whitepaper的示例)。现在想象一下,在医疗记录数据库中,每条记录都明确引用某个医生的帐户作为其主治医师。一条规则应规定只有记录的主治医师才可以更改该记录的某些关键属性。

我们如何最好地在属性中建模?

理想情况下,授权对象可以带有属性“功能 = 主治医师”。这将使从技术上表达规则变得容易,但它也会使主题的构造变得特定于对象,这听起来是错误的。

或者,对象可以携带属性“Attending Physician = (Account-ID)”,这听起来更好,但规则的技术表达会更复杂:“如果主体的 Account ID 属性值匹配,则授予访问权限对象的主治医师属性值”。 (在现实生活中,关系可能会更复杂和嵌套,规则更难用简单的术语表达。)

有什么建议或最佳实践吗?

谢谢,约翰

【问题讨论】:

    标签: access-control abac


    【解决方案1】:

    是的。在 ABAC(和 ALFA/XACML)中,您将按照以下方式编写策略:

    • 医生可以查看病历。

    这是没有关系的基线。如果你想介绍一种关系,例如护理关系,将患者对象引入组合。记录属于患者,患者有指定的医生。该政策现在变为:

    • 医生可以查看与其有护理关系的患者的病历。

    在摘要格式中,它变成:

    • 如果 record.owner.assignedPhysician == user.userID,角色 == "physician" 的用户可以对 == "medical record" 类型的对象执行操作 == "view"。

    这是 ALFA 中的完整示例。

    namespace com.axiomatics.examples{
    
        import Attributes.*
    
        obligation breakTheGlass = "com.axiomatics.examples.breakTheGlass"
        obligation auditLog = "com.axiomatics.examples.auditLog"
    
        namespace user{
            attribute role{
                category = subjectCat
                id = "com.axiomatics.examples.user.role"
                type = string
            }
            attribute identifier{
                category = subjectCat
                id = "com.axiomatics.examples.user.identifier"
                type = string
            }
            attribute managerEmail{
                category = subjectCat
                id = "com.axiomatics.examples.user.manager.email"
                type = string
            }
        }
        namespace patient{
            attribute assignedDoctor{
                category = resourceCat
                id = "com.axiomatics.examples.user.assignedDoctor"
                type = string
            }
        }
        namespace record{
            attribute identifier{
                category = resourceCat
                id = "com.axiomatics.examples.record.identifier"
                type = string
            }
        }
        attribute actionId{
            category = actionCat
            id = "com.axiomatics.examples.actionId"
            type = string
        }
        attribute objectType{
            category = resourceCat
            id = "com.axiomatics.examples.objectType"
            type = string
        }
        attribute isEmergency{
            category = environmentCat
            id = "com.axiomatics.examples.isEmergency"
            type = boolean
        }
        attribute message{
            category = environmentCat
            id = "com.axiomatics.examples.message"
            type = boolean
        }
        /**
         * Control access to medical records
         */
        policy accessMedicalRecord{
            target clause actionId == "view" and objectType == "medical record"
            apply firstApplicable
            /**
             * Doctors can view medical records of patients they are assigned to
             */
            rule allowRegularAccess{
                target clause user.role == "doctor"
                condition patient.assignedDoctor == user.identifier
                permit
            }
            /**
             * Doctors can view any medical reason in the case of an emergency
             */
            rule allowBreakTheGlassAccess{
                target clause isEmergency == true
                permit
                on permit{
                    obligation auditLog{
                        message = "A doctor has gotten access to a medical record by breaking the glass"
                        user.identifier = user.identifier
                        record.identifier = record.identifier
                        currentDateTime = currentDateTime
                    }
    
                }
            }
            /**
             * Deny other accesses. If access is normally denied, tell doctors how
             * they can get access by "breaking the glass".
             */
            rule denyAccess{
                deny
                on deny{
                    obligation breakTheGlass{
                        message = "You do not have access to this medical record. To be granted access, set the isEmergency flag to true."
                        record.identifier = record.identifier
                        currentDateTime = currentDateTime
                    }
                }
            }
        }
    }
    

    【讨论】:

    • 大卫,谢谢。因此,在我的示例中,Attending Physician 的帐户 ID 将添加到对象的属性集中(=医疗记录)。或者,在您的示例中,主题的属性集。这将使政策决定保持可缓存性:更改主治医师将更改对象(我的示例)或主题(您的示例)。
    • 但似乎仍然无法使用不使用直接 id 比较的简单条件(如“功能 = 主治医师”)来表达访问规则。
    • 主治医师不再是一个角色。相反,您会将分配给给定患者的医生的 ID(这是您的信息模型的一部分)与当前登录的用户的 ID 进行比较
    猜你喜欢
    • 2015-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    • 1970-01-01
    • 2013-03-26
    • 1970-01-01
    相关资源
    最近更新 更多