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

INTEGRATION [PR#1340 > development/8.1] bugfix: S3C-3904: better-s3-action-logs #1344

Merged
merged 3 commits into from
Feb 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions lib/policyEvaluator/utils/actionMaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ const sharedActionMap = {
objectPutTagging: 's3:PutObjectTagging',
};

// Meant to override shared action map values with fakes name for monitoring of s3
const sharedMonitoringMap = {
bucketGet: 's3:GetBucket',
bucketHead: 's3:HeadBucket',
};

// action map used for request context
const actionMapRQ = Object.assign({
bucketPut: 's3:CreateBucket',
Expand All @@ -64,15 +70,40 @@ const actionMapRQ = Object.assign({
objectReplicate: 's3:ReplicateObject',
}, sharedActionMap);

// Meant to override shared action map values with fakes name for moniroting of s3
const actionMonitoringMapRQ = Object.assign({
bucketDeleteCors: 's3:DeleteBucketCORS',
completeMultipartUpload: 's3:CompleteMultipartUpload',
initiateMultipartUpload: 's3:InitiateMultipartUpload',
objectHead: 's3:HeadObject',
objectPutPart: 's3:PutPartObject',
}, sharedMonitoringMap);

// action map used for bucket policies
const actionMapBP = Object.assign({}, sharedActionMap);

// Meant to override shared action map values with fakes name for moniroting of s3
const actionMonitoringMapBP = Object.assign(
{},
sharedMonitoringMap,
);

// action map for all relevant s3 actions
const actionMapS3 = Object.assign({
bucketGetNotification: 's3:GetBucketNotification',
bucketPutNotification: 's3:PutBucketNotification',
}, sharedActionMap, actionMapRQ, actionMapBP);

// Meant to override shared action map values with fakes name for moniroting of s3
const actionMonitoringMapS3 = Object.assign(
{},
sharedMonitoringMap,
actionMonitoringMapRQ,
actionMonitoringMapBP,
);

// Action monitoring

const actionMapIAM = {
attachGroupPolicy: 'iam:AttachGroupPolicy',
attachUserPolicy: 'iam:AttachUserPolicy',
Expand Down Expand Up @@ -126,8 +157,11 @@ const actionMapMetadata = {

module.exports = {
actionMapRQ,
actionMonitoringMapRQ,
actionMapBP,
actionMonitoringMapBP,
actionMapS3,
actionMonitoringMapS3,
actionMapIAM,
actionMapSSO,
actionMapSTS,
Expand Down