在基于属性的访问控制(ABAC)中,建议的方法是建立来自主体和对象之间关系的属性?
示例:医疗记录作为对象和医生/护士的帐户作为主题。在一个简单的设置中,主体和对象之间没有直接关系,规则可能会在心脏病学部 中声明“护士从业者 心脏病患者的医疗记录 (来自NIST Whitepaper的例子)。现在想象一下,在医疗记录数据库中,每条记录都明确地将某医生的帐户称为其主治医师。规则应规定只允许记录的主治医生更改该记录的某些关键属性。
我们如何在属性中对此进行最佳建模?
理想情况下,授权主体可以携带“功能=主治医师”属性。这样可以很容易地在技术上表达规则,但它也会使特定于对象的主题构建错误。
或者,该对象可以携带属性“Attending Physician =(Account-ID)”,这听起来更好,但是规则的技术表达将更复杂:“如果主题的Account ID属性值匹配,则授予访问权限对象的参加医师属性值“。 (在现实生活中,这种关系可能会更复杂和嵌套,而且规则更难用简单的术语表达。)
任何建议或最佳做法?
谢谢,约翰
答案 0 :(得分:1)
是。在ABAC(和ALFA / XACML)中,您可以按照以下方式编写策略:
这是没有关系的基线。如果你想引入一种关系,例如护理关系,将患者对象引入混合物中。该记录属于患者,患者具有指定的医生。该政策现在变为:
以消化的格式,它变为:
这是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
}
}
}
}
}