1
저는 XACML을 처음 사용하고 ALFA를 사용하여 정책을 작성합니다. 제가 작성하고자하는 정책은 은행에 $ 2000의 양도 한도를 설정하는 것입니다. 양도 금액보다 많으면 작업을 거부해야합니다.ALFA 및 XACML을 사용하여 샘플 ABAC 인증 정책 작성
어떻게 해결할 수 있습니까?
감사합니다.
저는 XACML을 처음 사용하고 ALFA를 사용하여 정책을 작성합니다. 제가 작성하고자하는 정책은 은행에 $ 2000의 양도 한도를 설정하는 것입니다. 양도 금액보다 많으면 작업을 거부해야합니다.ALFA 및 XACML을 사용하여 샘플 ABAC 인증 정책 작성
어떻게 해결할 수 있습니까?
감사합니다.
사용 사례는 매우 간단합니다. 난 당신이 ALFA 먼저하고 영어로 쓰기 추천 :
이type==bank account
의 자원에 action==transfer
을 할 수있는 경우에만 경우 amount transferred < the amount limit
(귀하의 경우 예를 들어, 2000) ==>허가는 ALFA, 상기 정책이 될 거부
namespace policies{
attribute actionId{
category = actionCat
id = "actionId"
type = string
}
attribute resourceType{
category = resourceCat
id = "resourceType"
type = string
}
attribute amount{
category = resourceCat
id = "amount"
type = double
}
/**
* The limit could be a subject attribute in the case it's user-specific
*/
attribute limit{
category = subjectCat
id = "limit"
type = double
}
/*
* A user can do the `action==transfer` on a resource of `type==bank account` if and only if the `amount transferred
* < the amount limit` (e.g. 2000 in your case) ==> **permit**
*
*/
policy transfer{
target clause actionId == "transfer" and resourceType=="bank account"
apply firstApplicable
rule allow{
condition amount <= limit
permit
}
rule denyTransfer{
deny
}
}
}