Skip to content

Commit

Permalink
Merge pull request #12 from hackforla/cb/testuser
Browse files Browse the repository at this point in the history
Creating users to test permissions and updating level 4 policy
  • Loading branch information
freaky4wrld authored Feb 29, 2024
2 parents e79f5cc + 8da07fb commit 5ef82fa
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 27 deletions.
4 changes: 2 additions & 2 deletions terraform/aws-custom-policies.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module "aws_custom_policies" {
source = "./modules/aws-policies"
policies = {
"IAMServicesAdmin" = {
"IAMServicesSupervisor" = {
description = "Policy granting IAM services admins permissions to make changes to user accounts"
filename = "level-4-iam-services-admin-policy.json"
filename = "level-4-iam-services-supervisor-policy.json"
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"Statement": [
{
"Action": [
"iam:CreateAccessKey"
],
"Effect": "Allow",
"Resource": "arn:aws:iam::*:user/*"
},
{
"Action": [
"iam:UpdateLoginProfile"
],
"Condition": {
"StringEquals": {
"iam:ResourceTag/Access Level": [
"1",
"2"
]
}
},
"Effect": "Allow",
"Resource": "arn:aws:iam::*:user/*"
},
{
"Action": [
"cloudshell:CreateEnvironment",
"cloudshell:GetEnvironmentStatus",
"cloudshell:CreateSession",
"cloudshell:StartEnvironment",
"cloudshell:StopEnvironment"
],
"Effect": "Allow",
"Resource": "*"
}
],
"Version": "2012-10-17"
}
2 changes: 1 addition & 1 deletion terraform/aws-groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module "iam_services_admin_group" {

group_name = "iam-services-admin-group"
policy_arn = {
"IAMServicesAdmin" = module.aws_custom_policies.policy_arns["IAMServicesAdmin"]
"IAMServicesAdmin" = module.aws_custom_policies.policy_arns["IAMServicesSupervisor"]
}
}

22 changes: 22 additions & 0 deletions terraform/aws-users.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,26 @@ module "iam_user_awlFCCamp" {
"Access Level" = "1"
}
user_groups = ["read-only-group"]
}

module "iam_user_testiamuser" {
source = "./modules/aws-users"

user_name = "testiamuser"
user_tags = {
"Project" = "devops-security"
"Access Level" = "1"
}
user_groups = ["read-only-group"]
}

module "iam_user_chelseyb" {
source = "./modules/aws-users"

user_name = "chelseyb"
user_tags = {
"Project" = "devops-security"
"Access Level" = "1"
}
user_groups = ["read-only-group", "iam-services-admin-group"]
}

0 comments on commit 5ef82fa

Please sign in to comment.