Skip to content

Commit

Permalink
fixups on ACL permission checks for implicitDeny logic
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed Nov 7, 2023
1 parent 5fe6d2c commit 312f9d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 5 additions & 0 deletions constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ const constants = {
'user',
'bucket',
],
arrayOfAllowed: [
'objectPutTagging',
'objectPutLegalHold',
'objectPutRetention',
],
allowedUtapiEventFilterStates: ['allow', 'deny'],
// The AWS assumed Role resource type
assumedRoleArnResourceType: 'assumed-role',
Expand Down
8 changes: 1 addition & 7 deletions lib/api/apiUtils/authorization/permissionChecks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { evaluators, actionMaps, RequestContext } = require('arsenal').policies;
const constants = require('../../../../constants');

const { allAuthedUsersId, bucketOwnerActions, logId, publicId,
assumedRoleArnResourceType, backbeatLifecycleSessionName } = constants;
assumedRoleArnResourceType, backbeatLifecycleSessionName, arrayOfAllowed } = constants;

// whitelist buckets to allow public read on objects
const publicReadBuckets = process.env.ALLOW_PUBLIC_READ_BUCKETS ?
Expand All @@ -15,12 +15,6 @@ function checkBucketAcls(bucket, requestType, canonicalID, mainApiCall) {
if (bucket.getOwner() === canonicalID) {
return true;
}
// Backward compatibility
const arrayOfAllowed = [
'objectPutTagging',
'objectPutLegalHold',
'objectPutRetention',
];
if (mainApiCall === 'objectGet') {
if (requestTypeParsed === 'objectGetTagging') {
return true;
Expand Down

0 comments on commit 312f9d9

Please sign in to comment.