Skip to content
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 #2181

Merged
merged 5 commits into from
Nov 3, 2023

Conversation

benzekrimaha
Copy link
Contributor

@benzekrimaha benzekrimaha commented Oct 30, 2023

Opened after closed PR here

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?selectedIssue=S3C-7756

Green build in Vault and CS:
https://github.com/scality/Vault/actions/runs/6694175632/job/18186886853?pr=2135
https://github.com/scality/cloudserver/actions/runs/6693681174/job/18185346914?pr=5322

Would appreciate reviews on Integration branches as well
Arsenal version has been bumped lastly

Will Toozs and others added 4 commits October 27, 2023 17:22
As the evaluateAllPolicies function is using the result of the
standardEvaluateAllPolicies , the redundant tests are removed.
The test that was kept is only to show that we use the result.verdict
in old flow evaluation.
@bert-e
Copy link
Contributor

bert-e commented Oct 30, 2023

Hello benzekrimaha,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Oct 30, 2023

Incorrect fix version

The Fix Version/s in issue ARSN-362 contains:

  • 7.10.49

  • 7.70.13

  • 8.1.113

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 7.10.49

  • 7.70.13

  • 8.1.114

Please check the Fix Version/s of ARSN-362, or the target
branch of this pull request.

@benzekrimaha benzekrimaha marked this pull request as ready for review October 30, 2023 14:53
@benzekrimaha
Copy link
Contributor Author

ping

@scality scality deleted a comment from bert-e Oct 30, 2023
@bert-e
Copy link
Contributor

bert-e commented Oct 30, 2023

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@benzekrimaha
Copy link
Contributor Author

/create_integration_branches

@bert-e
Copy link
Contributor

bert-e commented Oct 30, 2023

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/6.4
  • development/7.4

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

The following options are set: create_integration_branches

@bert-e
Copy link
Contributor

bert-e commented Oct 30, 2023

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

The following options are set: create_integration_branches

@benzekrimaha
Copy link
Contributor Author

@bert-e create_pull_requests

@bert-e
Copy link
Contributor

bert-e commented Oct 30, 2023

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/6.4
  • development/7.4

Follow integration pull requests if you would like to be notified of
build statuses by email.

The following options are set: create_pull_requests, create_integration_branches

@bert-e
Copy link
Contributor

bert-e commented Oct 30, 2023

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

The following options are set: create_pull_requests, create_integration_branches

@scality scality deleted a comment from bert-e Oct 30, 2023
@scality scality deleted a comment from bert-e Oct 30, 2023
@scality scality deleted a comment from bert-e Oct 30, 2023
@scality scality deleted a comment from bert-e Oct 30, 2023
@benzekrimaha
Copy link
Contributor Author

ping

allPolicies: any[],
log: Logger,
): {
verdict: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a discussion about this some time ago with William maybe in a PR (I can't find the ref) it was about returning a single state string like ImplicitDeny or ExplicitDeny rather than an object with a boolean, to make it simpler and more visual, forcing to handle all states explicitly. There could have been reasons to stick to using a boolean maybe for backward-compatibility, since I'm not aware of this just want to make sure it was a conscious decision.

Copy link
Contributor Author

@benzekrimaha benzekrimaha Oct 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I indeed found the comment you are refering to here : https://github.com/scality/citadel/pull/165#discussion_r1276904304
I'm looping @williamlardier in for more insight on this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is for backward compatibility, that we use the boolean, given that we want to keep both flows. With a boolean, we can minimize the changes applied to our code base.

But our last discussion was about the request contexts responses (i.e., in Vault), not the internal logic. The request context API must be updated as stated in the design, but the evaluation logic can stay like that, unless we see benefits of having a uniform authz result starting at Arsenal level (maybe by creating a new typescript type or enum). Then in cloudserver we can check the authz result using string comparisons, and update the functions here (and associated tests).

As discussed with Maha already, if we want to deviate from the design (with good reasons), we must update the design. Here, the current code looks compatible with it, but I think having a unified implementation would be better indeed. It will require creating the new authz types in arsenal, update the functions, and then reuse them in Vault/Cloudserver.

@anurag4DSB anurag4DSB self-requested a review October 31, 2023 08:58
@benzekrimaha
Copy link
Contributor Author

benzekrimaha commented Nov 3, 2023

@bert-e approve

@bert-e
Copy link
Contributor

bert-e commented Nov 3, 2023

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/7.10

  • ✔️ development/7.70

  • ✔️ development/8.1

The following branches will NOT be impacted:

  • development/6.4
  • development/7.4

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve, create_pull_requests, create_integration_branches

@bert-e
Copy link
Contributor

bert-e commented Nov 3, 2023

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/7.10

  • ✔️ development/7.70

  • ✔️ development/8.1

The following branches have NOT changed:

  • development/6.4
  • development/7.4

Please check the status of the associated issue ARSN-362.

Goodbye benzekrimaha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants