-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement/arsn 362 implicit deny #2162
Conversation
Hello kaztoozs,My role is to assist you with the merge of this Status report is not available. |
Branches have divergedThis pull request's source branch To avoid any integration risks, please re-synchronize them using one of the
Note: If you choose to rebase, you may have to ask me to rebuild |
lib/policyEvaluator/evaluator.ts
Outdated
@@ -324,7 +324,10 @@ export function evaluateAllPolicies( | |||
requestContext: RequestContext, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to avoid breaking compatibility, may be better not to touch the prototype of this function : i.e. make the change to the body in a function with a new name, and transform the older function in a simpler wrapper
→ this way existing code using it is not affected, it can decide when they "upgrade" to the new API, and we don't introduce coupling or limit upgrade paths
→ ideally we could even mark the 'old' method as deprecated, though I am not sure what is the impact currently: depending on build flags it could probably fail the build...
Something like this:
/* @deprecated Upgrade to evaluateAllPoliciesV2
*/
export function evaluateAllPolicies(
requestContext: RequestContext,
allPolicies: any[],
log: Logger,
): string {
return evaluateAllPoliciesV2(requestContext, allPolicies, log).verdict;
}
export function evaluateAllPoliciesV2(
requestContext: RequestContext,
allPolicies: any[],
log: Logger,
): {
verdict: string;
isImplicit: boolean;
} {
...
}
12205d6
to
227b869
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
The PR needs to target development/7.70
We need a test to ensure the v1 method only returns verdict for future change prevention
@anurag4DSB the tests you're speaking of already exist just above Is this what you had in mind? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its worth keeping the v1/v2 consistent across cloudserver, arsenal and vault.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to aim development/7.10 as per the fix versions specified in the epic: https://scality.atlassian.net/browse/S3C-7756
closing and opening new PR to facilitate rebase to 7.10 |
Adds ImplicitDeny logic to policy checks, where an ImplicitDeny will be sent back in case no policy validates an action, but does not explicitly Deny it either, allowing for bucket policies and other authorization mechanisms to grant permission.
Part of the bucket policy redo epic: https://scality.atlassian.net/jira/software/c/projects/OS/boards/214?modal=detail&selectedIssue=S3C-7756