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/cldsrv-426-ACL-Implicit-Deny #5420

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

benzekrimaha
Copy link
Contributor

@benzekrimaha benzekrimaha commented Nov 7, 2023

PR opened after closing : #5323

Bucket policies are not correctly interpreted, this is part of the following epic to fix that: scality/Arsenal#2181

This PR is aiming to update ACL checks for APIs with multiple permission , ticket linked to this issue here : https://scality.atlassian.net/browse/CLDSRV-426

PRs providing implicit Deny logic to CS for processing in this PR
scality/Arsenal#2181
https://github.com/scality/Vault/pull/2135
#5322

Tests have also been added.

I'm not bumping a new CLDSRV version since a new version has been created in this merged PR : #5322 , Please let me know if it needs to be done anyways.

@bert-e
Copy link
Contributor

bert-e commented Nov 7, 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.

@scality scality deleted a comment from bert-e Nov 7, 2023
@bert-e
Copy link
Contributor

bert-e commented Nov 7, 2023

Incorrect fix version

The Fix Version/s in issue CLDSRV-426 contains:

  • 7.10.31

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

  • 7.10.33

  • 7.70.30

  • 8.6.12

  • 8.7.31

  • 8.8.5

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

@benzekrimaha
Copy link
Contributor Author

ping

@bert-e
Copy link
Contributor

bert-e commented Nov 7, 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 Nov 7, 2023

Conflict

A conflict has been raised during the creation of
integration branch w/8.6/improvement/CLDSRV-426-acl-impl-deny with contents from w/7.70/improvement/CLDSRV-426-acl-impl-deny
and development/8.6.

I have not created the integration branch.

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout -B w/8.6/improvement/CLDSRV-426-acl-impl-deny origin/development/8.6
 $ git merge origin/w/7.70/improvement/CLDSRV-426-acl-impl-deny
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/8.6/improvement/CLDSRV-426-acl-impl-deny

The following options are set: create_integration_branches

@benzekrimaha
Copy link
Contributor Author

ping

@bert-e
Copy link
Contributor

bert-e commented Nov 7, 2023

Integration data created

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

The following branches will NOT be impacted:

  • 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 Nov 7, 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 benzekrimaha marked this pull request as ready for review November 7, 2023 12:15
@@ -62,11 +81,7 @@ function checkBucketAcls(bucket, requestType, canonicalID) {
}
}

if (requestType === 'bucketDelete' && bucket.getOwner() === canonicalID) {
Copy link
Contributor

Choose a reason for hiding this comment

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

For this PR I believe we should keep this logic for the bucketDelete API, as it seems we remove it with the changes. It may be a miss from the PoC

Copy link
Contributor

Choose a reason for hiding this comment

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

We can also have a test for this one

Copy link
Contributor Author

@benzekrimaha benzekrimaha Nov 7, 2023

Choose a reason for hiding this comment

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

this can actually be removed since we have this condition

if (bucket.getOwner() === canonicalID) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for the test it's already here :

description: 'should return true if bucket owner matches canonicalID',

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, it was a dead code, looks good

lib/api/apiUtils/authorization/permissionChecks.js Outdated Show resolved Hide resolved
@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-426-acl-impl-deny branch from d8b3ee4 to 1867d99 Compare November 7, 2023 17:08
@scality scality deleted a comment from bert-e Nov 7, 2023
@scality scality deleted a comment from bert-e Nov 7, 2023
@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-426-acl-impl-deny branch 2 times, most recently from 312f9d9 to b138e9d Compare November 7, 2023 17:46
@scality scality deleted a comment from bert-e Nov 7, 2023
@scality scality deleted a comment from bert-e Nov 7, 2023
@scality scality deleted a comment from bert-e Nov 7, 2023
@scality scality deleted a comment from bert-e Nov 7, 2023
@scality scality deleted a comment from bert-e Nov 7, 2023
@scality scality deleted a comment from bert-e Nov 7, 2023
@scality scality deleted a comment from bert-e Nov 7, 2023
@scality scality deleted a comment from bert-e Nov 7, 2023
@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-426-acl-impl-deny branch from b138e9d to eecb2a9 Compare November 7, 2023 18:42

// whitelist buckets to allow public read on objects
const publicReadBuckets = process.env.ALLOW_PUBLIC_READ_BUCKETS ?
process.env.ALLOW_PUBLIC_READ_BUCKETS.split(',') : [];

function checkBucketAcls(bucket, requestType, canonicalID) {
function checkBucketAcls(bucket, requestType, canonicalID, mainApiCall) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure where the mainApiCall comes from and where it is set. JSDOC might be helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

JSDOC has been added , let me know if it's still not clear enough

Copy link
Contributor

Choose a reason for hiding this comment

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

I do not see it defined here:

const aclPermission = checkBucketAcls(bucket, requestType, canonicalID);

Is it on purpose?

Copy link
Contributor Author

@benzekrimaha benzekrimaha Nov 13, 2023

Choose a reason for hiding this comment

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

As it's not effecting the current behavior , it's defined on this PR ( which is aiming to update the functions calling the acl checks) : https://github.com/scality/cloudserver/pull/5432/files#diff-773344fcfc0f64145ff95eb6eccd556588c19449dc2c263a2532d4030bf00dffR360

@bert-e
Copy link
Contributor

bert-e commented Nov 13, 2023

Conflict

A conflict has been raised during the update of
integration branch w/8.6/improvement/CLDSRV-426-acl-impl-deny with contents from w/7.70/improvement/CLDSRV-426-acl-impl-deny
and development/8.6.

Please resolve the conflict on the integration branch (w/8.6/improvement/CLDSRV-426-acl-impl-deny).

Here are the steps to resolve this conflict:

 $ git fetch
 $ git checkout w/8.6/improvement/CLDSRV-426-acl-impl-deny
 $ git pull  # or "git reset --hard origin/w/8.6/improvement/CLDSRV-426-acl-impl-deny"
 $ git merge origin/development/8.6
 $ # <intense conflict resolution>
 $ git commit
 $ git merge origin/w/7.70/improvement/CLDSRV-426-acl-impl-deny
 $ # <intense conflict resolution>
 $ git commit
 $ git push -u origin w/8.6/improvement/CLDSRV-426-acl-impl-deny

The following options are set: create_pull_requests, create_integration_branches

Will Toozs added 2 commits November 13, 2023 13:10
CLDSRV-426:fixups on ACL permission checks for implicitDeny logic

CLDSRV-426:better readability on ACL permission
@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-426-acl-impl-deny branch from 17d69ed to e0eab95 Compare November 13, 2023 12:10
@bert-e
Copy link
Contributor

bert-e commented Nov 13, 2023

History mismatch

Merge commit #fbb0de94b2d0901a610b6e26fd0351e01ac286b0 on the integration branch
w/7.70/improvement/CLDSRV-426-acl-impl-deny is merging a branch which is neither the current
branch improvement/CLDSRV-426-acl-impl-deny nor the development branch
development/7.70.

It is likely due to a rebase of the branch improvement/CLDSRV-426-acl-impl-deny and the
merge is not possible until all related w/* branches are deleted or updated.

Please use the reset command to have me reinitialize these branches.

The following options are set: create_pull_requests, create_integration_branches

@benzekrimaha
Copy link
Contributor Author

ping

@bert-e
Copy link
Contributor

bert-e commented Nov 13, 2023

Integration data created

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

The following branches will NOT be impacted:

  • 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 Nov 13, 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

@benzekrimaha
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented Nov 13, 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.6

  • ✔️ development/8.7

  • ✔️ development/8.8

The following branches will NOT be impacted:

  • 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 13, 2023

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

  • ✔️ development/7.10

  • ✔️ development/7.70

  • ✔️ development/8.6

  • ✔️ development/8.7

  • ✔️ development/8.8

The following branches have NOT changed:

  • development/7.4

Please check the status of the associated issue CLDSRV-426.

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.

5 participants