mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
fix(iam): honor managed policy attachment conditions (#5578)
* fix(iam): honor managed policy attachment conditions * test(iam): keep managed policy group tests isolated
This commit is contained in:
1 parent
04dd78d0f6
commit
367ae0b2db
6 files changed
+377
-1
No files matched your search
+173
@@ -0,0 +1,173 @@
|
||||
package com.floci.test;
|
||||
|
||||
import org.junit.jupiter.api.Assumptions;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
||||
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
|
||||
import software.amazon.awssdk.regions.Region;
|
||||
import software.amazon.awssdk.services.iam.IamClient;
|
||||
import software.amazon.awssdk.services.iam.model.AccessKey;
|
||||
import software.amazon.awssdk.services.iam.model.IamException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
class IamPolicyArnConditionTest {
|
||||
|
||||
private static final String DOCUMENT = """
|
||||
{"Version":"2012-10-17","Statement":[
|
||||
{"Effect":"Allow","Action":"s3:GetObject","Resource":"*"}]}""";
|
||||
private static final String TRUST = """
|
||||
{"Version":"2012-10-17","Statement":[{"Effect":"Allow",
|
||||
"Principal":{"Service":"ec2.amazonaws.com"},"Action":"sts:AssumeRole"}]}""";
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"Role", "User", "Group"})
|
||||
void policyArnConditionsControlAttachmentsAndPreserveDeniedState(String kind) {
|
||||
String target = TestFixtures.uniqueName("sdk-policy-target");
|
||||
String caller = TestFixtures.uniqueName("sdk-policy-caller");
|
||||
List<Runnable> cleanup = new ArrayList<>();
|
||||
try (IamClient root = TestFixtures.iamClient()) {
|
||||
try {
|
||||
String policy = root.createPolicy(b -> b.policyName(TestFixtures.uniqueName("sdk-policy"))
|
||||
.policyDocument(DOCUMENT)).policy().arn();
|
||||
cleanup.add(() -> root.deletePolicy(b -> b.policyArn(policy)));
|
||||
String resource = createTarget(root, kind, target);
|
||||
cleanup.add(() -> {
|
||||
for (String arn : attached(root, kind, target)) {
|
||||
change(root, kind, target, arn, false);
|
||||
}
|
||||
deleteTarget(root, kind, target);
|
||||
});
|
||||
root.createUser(b -> b.userName(caller));
|
||||
cleanup.add(() -> root.deleteUser(b -> b.userName(caller)));
|
||||
AccessKey key = root.createAccessKey(b -> b.userName(caller)).accessKey();
|
||||
cleanup.add(() -> root.deleteAccessKey(b -> b.userName(caller).accessKeyId(key.accessKeyId())));
|
||||
try (IamClient client = IamClient.builder().endpointOverride(TestFixtures.endpoint())
|
||||
.region(Region.US_EAST_1).credentialsProvider(StaticCredentialsProvider.create(
|
||||
AwsBasicCredentials.create(key.accessKeyId(), key.secretAccessKey()))).build()) {
|
||||
boolean enforcement;
|
||||
try {
|
||||
client.getUser(b -> b.userName(caller));
|
||||
enforcement = false;
|
||||
} catch (IamException e) {
|
||||
assertThat(e.statusCode()).isEqualTo(403);
|
||||
assertThat(e.awsErrorDetails().errorCode()).isEqualTo("AccessDenied");
|
||||
enforcement = true;
|
||||
}
|
||||
Assumptions.assumeTrue(enforcement, "IAM enforcement must be enabled");
|
||||
String allowed = statement("Allow", kind, resource, policy);
|
||||
root.putUserPolicy(b -> b.userName(caller).policyName("condition").policyDocument(document(allowed)));
|
||||
cleanup.add(() -> root.deleteUserPolicy(b -> b.userName(caller).policyName("condition")));
|
||||
change(client, kind, target, policy, true);
|
||||
assertThat(attached(root, kind, target)).containsExactly(policy);
|
||||
change(client, kind, target, policy, false);
|
||||
assertThat(attached(root, kind, target)).isEmpty();
|
||||
|
||||
String denied = "{\"Effect\":\"Allow\",\"Action\":\"iam:*\",\"Resource\":\"*\"},"
|
||||
+ statement("Deny", kind, resource, policy);
|
||||
root.putUserPolicy(b -> b.userName(caller).policyName("condition").policyDocument(document(denied)));
|
||||
assertDenied(() -> change(client, kind, target, policy, true));
|
||||
assertThat(attached(root, kind, target)).isEmpty();
|
||||
change(root, kind, target, policy, true);
|
||||
assertDenied(() -> change(client, kind, target, policy, false));
|
||||
assertThat(attached(root, kind, target)).containsExactly(policy);
|
||||
}
|
||||
} finally {
|
||||
RuntimeException cleanupFailure = null;
|
||||
for (int i = cleanup.size() - 1; i >= 0; i--) {
|
||||
try {
|
||||
cleanup.get(i).run();
|
||||
} catch (RuntimeException failure) {
|
||||
if (cleanupFailure == null) {
|
||||
cleanupFailure = failure;
|
||||
} else {
|
||||
cleanupFailure.addSuppressed(failure);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cleanupFailure != null) {
|
||||
throw cleanupFailure;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static String document(String statements) {
|
||||
return "{\"Version\":\"2012-10-17\",\"Statement\":[" + statements + "]}";
|
||||
}
|
||||
|
||||
private static String statement(String effect, String kind, String resource, String policy) {
|
||||
return """
|
||||
{"Effect":"%s","Action":["iam:Attach%sPolicy","iam:Detach%sPolicy"],"Resource":"%s",
|
||||
"Condition":{"ArnEquals":{"iam:PolicyARN":"%s"}}}""".formatted(effect, kind, kind, resource, policy);
|
||||
}
|
||||
|
||||
private static void assertDenied(Runnable request) {
|
||||
IamException error = assertThrows(IamException.class, request::run);
|
||||
assertThat(error.statusCode()).isEqualTo(403);
|
||||
assertThat(error.awsErrorDetails().errorCode()).isEqualTo("AccessDenied");
|
||||
}
|
||||
|
||||
private static String createTarget(IamClient client, String kind, String name) {
|
||||
return switch (kind) {
|
||||
case "Role" -> client.createRole(b -> b.roleName(name).path("/sdk/")
|
||||
.assumeRolePolicyDocument(TRUST)).role().arn();
|
||||
case "User" -> client.createUser(b -> b.userName(name).path("/sdk/")).user().arn();
|
||||
case "Group" -> client.createGroup(b -> b.groupName(name).path("/sdk/")).group().arn();
|
||||
default -> throw new IllegalArgumentException(kind);
|
||||
};
|
||||
}
|
||||
|
||||
private static void deleteTarget(IamClient client, String kind, String name) {
|
||||
switch (kind) {
|
||||
case "Role" -> client.deleteRole(b -> b.roleName(name));
|
||||
case "User" -> client.deleteUser(b -> b.userName(name));
|
||||
case "Group" -> client.deleteGroup(b -> b.groupName(name));
|
||||
default -> throw new IllegalArgumentException(kind);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<String> attached(IamClient client, String kind, String name) {
|
||||
return switch (kind) {
|
||||
case "Role" -> client.listAttachedRolePolicies(b -> b.roleName(name)).attachedPolicies()
|
||||
.stream().map(p -> p.policyArn()).toList();
|
||||
case "User" -> client.listAttachedUserPolicies(b -> b.userName(name)).attachedPolicies()
|
||||
.stream().map(p -> p.policyArn()).toList();
|
||||
case "Group" -> client.listAttachedGroupPolicies(b -> b.groupName(name)).attachedPolicies()
|
||||
.stream().map(p -> p.policyArn()).toList();
|
||||
default -> throw new IllegalArgumentException(kind);
|
||||
};
|
||||
}
|
||||
|
||||
private static void change(IamClient client, String kind, String name, String policy, boolean attach) {
|
||||
switch (kind) {
|
||||
case "Role" -> {
|
||||
if (attach) {
|
||||
client.attachRolePolicy(b -> b.roleName(name).policyArn(policy));
|
||||
} else {
|
||||
client.detachRolePolicy(b -> b.roleName(name).policyArn(policy));
|
||||
}
|
||||
}
|
||||
case "User" -> {
|
||||
if (attach) {
|
||||
client.attachUserPolicy(b -> b.userName(name).policyArn(policy));
|
||||
} else {
|
||||
client.detachUserPolicy(b -> b.userName(name).policyArn(policy));
|
||||
}
|
||||
}
|
||||
case "Group" -> {
|
||||
if (attach) {
|
||||
client.attachGroupPolicy(b -> b.groupName(name).policyArn(policy));
|
||||
} else {
|
||||
client.detachGroupPolicy(b -> b.groupName(name).policyArn(policy));
|
||||
}
|
||||
}
|
||||
default -> throw new IllegalArgumentException(kind);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1266,6 +1266,9 @@ account key carries no identity policies of its own.
|
||||
A `Condition` operator can only match a key floci actually places in the request context.
|
||||
floci populates:
|
||||
|
||||
- `iam:PolicyARN`: the managed policy ARN in the form body for `AttachRolePolicy`,
|
||||
`DetachRolePolicy`, `AttachUserPolicy`, `DetachUserPolicy`, `AttachGroupPolicy` and
|
||||
`DetachGroupPolicy`. The target role, user or group remains the authorized resource.
|
||||
- `s3:prefix`, `s3:delimiter`, `s3:max-keys`: from the S3 request parameters.
|
||||
- `aws:RequestTag/<key>`: the tags named in the request itself, before they are applied, for
|
||||
`ec2:RunInstances` (`TagSpecification.N`), `ec2:CreateTags` (`Tag.N`) and
|
||||
|
||||
@@ -83,6 +83,18 @@ public class IamConditionContextResolver {
|
||||
case "s3" -> s3ConditionContext(action, ctx);
|
||||
case "ec2" -> ec2ConditionContext(action, ctx);
|
||||
case "dynamodb" -> dynamoDbConditionContext(action, ctx);
|
||||
case "iam" -> iamConditionContext(action, ctx);
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private static Map<String, List<String>> iamConditionContext(String action, ContainerRequestContext ctx) {
|
||||
return switch (action) {
|
||||
case "iam:AttachRolePolicy", "iam:DetachRolePolicy", "iam:AttachUserPolicy",
|
||||
"iam:DetachUserPolicy", "iam:AttachGroupPolicy", "iam:DetachGroupPolicy" -> {
|
||||
String policyArn = formParameters(ctx).get("PolicyArn");
|
||||
yield policyArn == null ? null : Map.of("iam:PolicyARN", List.of(policyArn));
|
||||
}
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
+24
@@ -115,6 +115,30 @@ class IamConditionContextResolverTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void iamPolicyContextKeepsEmptyValuesAndOmitsMissingValues() {
|
||||
assertNull(resolver.resolve("iam", "iam:AttachRolePolicy", formRequest("RoleName=role")));
|
||||
assertEquals(Map.of("iam:PolicyARN", List.of("")),
|
||||
resolver.resolve("iam", "iam:AttachRolePolicy", formRequest("PolicyArn=")));
|
||||
assertEquals(Map.of("iam:PolicyARN", List.of("")),
|
||||
resolver.resolve("iam", "iam:AttachRolePolicy", formRequest("PolicyArn")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void iamPolicyContextIsNotLeakedToOtherActions() {
|
||||
for (String action : List.of("iam:GetPolicy", "iam:DeletePolicy", "iam:PutRolePolicy",
|
||||
"iam:PutRolePermissionsBoundary")) {
|
||||
assertNull(resolver.resolve("iam", action, formRequest("PolicyArn=example")));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void iamPolicyContextDecodesOnceAndPreservesCase() {
|
||||
assertEquals(Map.of("iam:PolicyARN", List.of("arn:aws:iam::123456789012:policy/Team/A+B%2F")),
|
||||
resolver.resolve("iam", "iam:AttachGroupPolicy",
|
||||
formRequest("PolicyArn=arn%3Aaws%3Aiam%3A%3A123456789012%3Apolicy%2FTeam%2FA%2BB%252F")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void resolvesS3ListBucketQueryConditionContext() {
|
||||
ContainerRequestContext containerRequest = mock(ContainerRequestContext.class);
|
||||
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
package io.github.hectorvent.floci.services.iam;
|
||||
|
||||
import io.github.hectorvent.floci.testing.EnforcementFixtures;
|
||||
import io.github.hectorvent.floci.testing.IamEnforcementProfile;
|
||||
import io.github.hectorvent.floci.testing.PartitionCleanup;
|
||||
import io.quarkus.test.common.http.TestHTTPResource;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.quarkus.test.junit.TestProfile;
|
||||
import io.restassured.response.Response;
|
||||
import io.restassured.specification.RequestSpecification;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static io.restassured.RestAssured.given;
|
||||
import static org.junit.jupiter.api.Assertions.assertAll;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
@QuarkusTest
|
||||
@TestProfile(IamEnforcementProfile.class)
|
||||
class IamPolicyArnConditionIntegrationTest {
|
||||
private static final String DOCUMENT = """
|
||||
{"Version":"2012-10-17","Statement":[
|
||||
{"Effect":"Allow","Action":"s3:GetObject","Resource":"*"}]}""";
|
||||
private static final String TRUST = """
|
||||
{"Version":"2012-10-17","Statement":[{"Effect":"Allow",
|
||||
"Principal":{"Service":"ec2.amazonaws.com"},"Action":"sts:AssumeRole"}]}""";
|
||||
private String account;
|
||||
private String region;
|
||||
private boolean operationAlias;
|
||||
|
||||
@RegisterExtension
|
||||
final PartitionCleanup cleanup = new PartitionCleanup();
|
||||
@TestHTTPResource("/")
|
||||
URI baseUri;
|
||||
|
||||
static Stream<Arguments> requests() {
|
||||
return Stream.of("Role", "User", "Group").flatMap(kind ->
|
||||
Stream.of("Attach", "Detach").flatMap(verb ->
|
||||
Stream.of("allow", "deny", "control", "mismatchAllow", "mismatchDeny", "duplicate")
|
||||
.flatMap(mode -> Stream.of(false, true)
|
||||
.map(scoped -> Arguments.of(kind, verb, mode, scoped)))));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("requests")
|
||||
void managedPolicyConditionMatchesTheRequestedPolicy(String kind, String verb, String mode, boolean scoped) {
|
||||
account = scoped ? "123456789012" : "000000000000";
|
||||
region = scoped ? "cn-north-1" : "us-east-1";
|
||||
operationAlias = scoped;
|
||||
String suffix = UUID.randomUUID().toString().substring(0, 8);
|
||||
String target = "context-target-" + suffix;
|
||||
String targetKey = kind + "Name";
|
||||
String policyName = "context-policy-" + suffix;
|
||||
Response createdPolicy = call(account, "CreatePolicy", Map.of("PolicyName", policyName,
|
||||
"PolicyDocument", DOCUMENT));
|
||||
assertEquals(200, createdPolicy.statusCode(), createdPolicy.asString());
|
||||
String policyArn = createdPolicy.xmlPath().getString("CreatePolicyResponse.CreatePolicyResult.Policy.Arn");
|
||||
cleanup.register(() -> EnforcementFixtures.removePolicy(baseUri.getPort(), auth(account), policyArn));
|
||||
if (kind.equals("Role")) {
|
||||
cleanup.register(() -> EnforcementFixtures.removeRole(baseUri.getPort(), auth(account), target));
|
||||
} else if (kind.equals("Group")) {
|
||||
cleanup.register(() -> EnforcementFixtures.removeGroup(baseUri.getPort(), auth(account), target));
|
||||
} else {
|
||||
cleanup.register(() -> EnforcementFixtures.removeUser(baseUri.getPort(), auth(account), target));
|
||||
}
|
||||
Map<String, String> create = kind.equals("Role")
|
||||
? Map.of(targetKey, target, "Path", "/context/", "AssumeRolePolicyDocument",
|
||||
TRUST)
|
||||
: Map.of(targetKey, target, "Path", "/context/");
|
||||
Response created = call(account, "Create" + kind, create);
|
||||
assertEquals(200, created.statusCode(), created.asString());
|
||||
String targetArn = created.xmlPath().getString(
|
||||
"Create" + kind + "Response.Create" + kind + "Result." + kind + ".Arn");
|
||||
Map<String, String> parameters = Map.of(targetKey, target, "PolicyArn", policyArn);
|
||||
if (verb.equals("Detach")) {
|
||||
Response attached = call(account, "Attach" + kind + "Policy", parameters);
|
||||
assertEquals(200, attached.statusCode(), attached.asString());
|
||||
}
|
||||
String caller = "context-caller-" + suffix;
|
||||
String accessKey = EnforcementFixtures.createUser(cleanup, baseUri.getPort(), auth(account), caller).accessKeyId();
|
||||
String action = "iam:" + verb + kind + "Policy";
|
||||
boolean denyStatement = mode.equals("deny") || mode.equals("mismatchDeny");
|
||||
String conditional = """
|
||||
{"Effect":"%s","Action":"%s","Resource":"%s",
|
||||
"Condition":{"ArnEquals":{"iam:PolicyARN":"%s"}}}"""
|
||||
.formatted(denyStatement ? "Deny" : "Allow", action, targetArn,
|
||||
mode.startsWith("mismatch") ? policyArn + "-other" : policyArn);
|
||||
String broad = """
|
||||
{"Effect":"Allow","Action":"%s","Resource":"%s"}""".formatted(action, targetArn);
|
||||
String statements = mode.equals("control") ? broad
|
||||
: denyStatement ? broad + "," + conditional : conditional;
|
||||
Response authorized = call(account, "PutUserPolicy", Map.of("UserName", caller, "PolicyName", "condition",
|
||||
"PolicyDocument", "{\"Version\":\"2012-10-17\",\"Statement\":[" + statements + "]}"));
|
||||
assertEquals(200, authorized.statusCode(), authorized.asString());
|
||||
RequestSpecification request = given().header("Authorization", auth(accessKey))
|
||||
.contentType("application/x-www-form-urlencoded")
|
||||
.formParam(operationAlias ? "Operation" : "Action", verb + kind + "Policy")
|
||||
.formParam("Version", "2010-05-08").formParam(targetKey, target)
|
||||
.formParam("PolicyArn", policyArn)
|
||||
.queryParam("PolicyArn", policyArn + "-url-shadow");
|
||||
if (mode.equals("duplicate")) {
|
||||
request.formParam("PolicyArn", policyArn + "-second-value");
|
||||
}
|
||||
Response result = request.when().post("/");
|
||||
Response listed = call(account, "ListAttached" + kind + "Policies", Map.of(targetKey, target));
|
||||
assertEquals(200, listed.statusCode(), listed.asString());
|
||||
boolean denied = mode.equals("deny") || mode.equals("mismatchAllow");
|
||||
boolean shouldBeAttached = verb.equals("Attach") != denied;
|
||||
if (denied) {
|
||||
assertEquals("AccessDenied", result.xmlPath().getString("ErrorResponse.Error.Code"));
|
||||
}
|
||||
assertAll(
|
||||
() -> assertEquals(denied ? 403 : 200, result.statusCode(), result.asString()),
|
||||
() -> assertEquals(shouldBeAttached, listed.asString().contains(policyArn), listed.asString()));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(booleans = {false, true})
|
||||
void sharedGroupCleanupReleasesManagedPolicies(boolean scoped) {
|
||||
account = scoped ? "123456789012" : "000000000000";
|
||||
region = scoped ? "cn-north-1" : "us-east-1";
|
||||
String suffix = UUID.randomUUID().toString().substring(0, 8);
|
||||
String group = "cleanup-group-" + suffix;
|
||||
Response createdPolicy = call(account, "CreatePolicy", Map.of("PolicyName", "cleanup-policy-" + suffix,
|
||||
"PolicyDocument", DOCUMENT));
|
||||
assertEquals(200, createdPolicy.statusCode(), createdPolicy.asString());
|
||||
String arn = createdPolicy.xmlPath().getString("CreatePolicyResponse.CreatePolicyResult.Policy.Arn");
|
||||
cleanup.register(() -> EnforcementFixtures.removePolicy(baseUri.getPort(), auth(account), arn));
|
||||
cleanup.register(() -> EnforcementFixtures.removeGroup(baseUri.getPort(), auth(account), group));
|
||||
assertEquals(200, call(account, "CreateGroup", Map.of("GroupName", group)).statusCode());
|
||||
assertEquals(200, call(account, "AttachGroupPolicy", Map.of("GroupName", group, "PolicyArn", arn))
|
||||
.statusCode());
|
||||
EnforcementFixtures.removeGroup(baseUri.getPort(), auth(account), group);
|
||||
assertEquals(404, call(account, "GetGroup", Map.of("GroupName", group)).statusCode());
|
||||
// The policy's attachment count must be released too, otherwise its deletion is refused.
|
||||
assertEquals(200, call(account, "DeletePolicy", Map.of("PolicyArn", arn)).statusCode());
|
||||
assertEquals(404, call(account, "GetPolicy", Map.of("PolicyArn", arn)).statusCode());
|
||||
}
|
||||
|
||||
private String auth(String key) {
|
||||
return EnforcementFixtures.auth(key, "iam").replace("/us-east-1/", "/" + region + "/");
|
||||
}
|
||||
|
||||
private Response call(String key, String action, Map<String, String> parameters) {
|
||||
return given().header("Authorization", auth(key)).contentType("application/x-www-form-urlencoded")
|
||||
.formParam("Action", action).formParam("Version", "2010-05-08").formParams(parameters)
|
||||
.when().post("/");
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,7 @@ public final class EnforcementFixtures {
|
||||
"InstanceProfileName", profileName).statusCode(200);
|
||||
}
|
||||
|
||||
/** Deletes a group, and first the users in it, which IAM wants gone before it will. */
|
||||
/** Deletes a group after removing its users, inline policies and managed policy attachments. */
|
||||
public static void removeGroup(int port, String authorization, String groupName) {
|
||||
if (iam(port, authorization, "GetGroup", "GroupName", groupName)
|
||||
.extract().statusCode() == 404) {
|
||||
@@ -190,6 +190,13 @@ public final class EnforcementFixtures {
|
||||
iam(port, authorization, "DeleteGroupPolicy", "GroupName", groupName,
|
||||
"PolicyName", policyName).statusCode(200);
|
||||
}
|
||||
for (String policyArn : iam(port, authorization, "ListAttachedGroupPolicies",
|
||||
"GroupName", groupName).statusCode(200).extract().xmlPath()
|
||||
.getList("ListAttachedGroupPoliciesResponse.ListAttachedGroupPoliciesResult"
|
||||
+ ".AttachedPolicies.member.PolicyArn", String.class)) {
|
||||
iam(port, authorization, "DetachGroupPolicy", "GroupName", groupName,
|
||||
"PolicyArn", policyArn).statusCode(200);
|
||||
}
|
||||
iam(port, authorization, "DeleteGroup", "GroupName", groupName).statusCode(200);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user