diff --git a/v2/internal/attacktechniques/aws/credential-access/ec2-get-password-data/main.tf b/v2/internal/attacktechniques/aws/credential-access/ec2-get-password-data/main.tf index a0c8a604..d0dd0afb 100644 --- a/v2/internal/attacktechniques/aws/credential-access/ec2-get-password-data/main.tf +++ b/v2/internal/attacktechniques/aws/credential-access/ec2-get-password-data/main.tf @@ -18,10 +18,14 @@ provider "aws" { } } +locals { + resource_prefix = "stratus-red-team-ec2-get-password-data" +} + data "aws_caller_identity" "current" {} resource "aws_iam_role" "role" { - name = "sample-role-used-by-stratus-for-ec2-password-data" + name = "${local.resource_prefix}-role" assume_role_policy = jsonencode({ Version = "2012-10-17" Statement = [ diff --git a/v2/internal/attacktechniques/aws/credential-access/ec2-steal-instance-credentials/main.tf b/v2/internal/attacktechniques/aws/credential-access/ec2-steal-instance-credentials/main.tf index c7f50389..b6887a6a 100644 --- a/v2/internal/attacktechniques/aws/credential-access/ec2-steal-instance-credentials/main.tf +++ b/v2/internal/attacktechniques/aws/credential-access/ec2-steal-instance-credentials/main.tf @@ -19,6 +19,10 @@ provider "aws" { } } +locals { + resource_prefix = "stratus-red-team-ec2-steal-credentials" +} + data "aws_availability_zones" "available" { state = "available" } @@ -26,7 +30,7 @@ data "aws_availability_zones" "available" { module "vpc" { source = "terraform-aws-modules/vpc/aws" - name = "stratus-red-team-vpc-ec2-credentials" + name = "${local.resource_prefix}-vpc" cidr = "10.0.0.0/16" azs = [data.aws_availability_zones.available.names[0]] @@ -57,7 +61,7 @@ resource "aws_network_interface" "iface" { } resource "aws_iam_role" "instance-role" { - name = "stratus-ec2-credentials-instance-role" + name = "${local.resource_prefix}-role" path = "/" assume_role_policy = <