mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
Remove applying custom policies with STS access keys (#6626)
Move away from allowing custom policies, all policies in STS come from OPA otherwise they fail.
This commit is contained in:
committed by
Dee Koder
parent
81a481e098
commit
23b166b318
16
cmd/iam.go
16
cmd/iam.go
@@ -326,20 +326,16 @@ func (sys *IAMSys) IsAllowed(args iampolicy.Args) bool {
|
||||
sys.RLock()
|
||||
defer sys.RUnlock()
|
||||
|
||||
// If policy is available for given user, check the policy.
|
||||
if p, found := sys.iamPolicyMap[args.AccountName]; found {
|
||||
// If opa is configured, use OPA in conjunction with IAM policies.
|
||||
if globalPolicyOPA != nil {
|
||||
return p.IsAllowed(args) && globalPolicyOPA.IsAllowed(args)
|
||||
}
|
||||
return p.IsAllowed(args)
|
||||
}
|
||||
|
||||
// If no policies are set, let the policy arrive from OPA if any.
|
||||
// If opa is configured, use OPA always.
|
||||
if globalPolicyOPA != nil {
|
||||
return globalPolicyOPA.IsAllowed(args)
|
||||
}
|
||||
|
||||
// If policy is available for given user, check the policy.
|
||||
if p, found := sys.iamPolicyMap[args.AccountName]; found {
|
||||
return p.IsAllowed(args)
|
||||
}
|
||||
|
||||
// As policy is not available and OPA is not configured, return the owner value.
|
||||
return args.IsOwner
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user