Skip to content

HADOOP-16653. S3Guard DDB overreacts to no tag access. #1653

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

Closed
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,16 @@ private RolePolicies() {
*/
public static final String DDB_BATCH_WRITE_ITEM = "dynamodb:BatchWriteItem";

/**
* Read tags of a table: {@value}.
*/
public static final String DDB_TAGS_LIST = "dynamodb:ListTagsOfResource";

/**
* Write- tags of a table: {@value}.
*/
public static final String DDB_TAGS_WRITE = "dynamodb:TagResource";

/**
* All DynamoDB tables: {@value}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -722,4 +722,25 @@ public void executePartialDelete(final Configuration conf,
roleFS.delete(pathWhichDoesntExist, true));
}

/**
* Turn off access to dynamo DB Tags and see how DDB table init copes.
*/
@Test
public void testRestrictDDBTagAccess() throws Throwable {

describe("extra policies in assumed roles need;"
+ " all required policies stated");
Configuration conf = createAssumedRoleConfig();

bindRolePolicyStatements(conf,
STATEMENT_S3GUARD_CLIENT,
STATEMENT_ALLOW_SSE_KMS_RW,
STATEMENT_ALL_S3,
new Statement(Effects.Deny)
.addActions(S3_PATH_RW_OPERATIONS)
.addResources(ALL_DDB_TABLES));
Path path = path("testRestrictDDBTagAccess");
roleFS = (S3AFileSystem) path.getFileSystem(conf);
}

}