This page provides a comprehensive guide to setting up the necessary AWS resources for security testing with Fluid Attacks' cloud security posture management (CSPM) module and adding new credentials to clone your repository.
To begin, navigate to your group's Scope section on Fluid Attacks' platform to add a CSPM environment. (If you need a refresher on how to reach this point, refer to Find the option for cloud integrations.)
Upon selecting AWS in Cloud name, you encounter two key elements:
Follow the steps presented further in this document and then go back to the platform to fill out the remaining fields.
To enable the Fluid Attacks scanner to access your AWS resources, you need to set up an IAM role. Once this role is created, its ARN is all you need to start using CSPM.
There are two ways to set up the role:
Here is how you create the IAM role on the AWS user interface:
<YOUR-EXTERNAL-ID>
with the external ID provided by Fluid Attacks.{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "FluidAttacksAccess",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "sts:AssumeRole",
"Condition": {
"ArnEquals": {
"aws:PrincipalArn": "arn:aws:iam::205810638802:role/prod_integrates"
},
"StringEquals": {
"sts:ExternalId": "<YOUR-EXTERNAL-ID>"
}
}
}
]
}
Here is an explanation of this trust policy:
Principal
field is set as *
, allowing any AWS account to assume this role. However, the policy further restricts this to ensure security.sts:AssumeRole
action allows other entities to assume this role.aws:PrincipalArn
condition ensures that, although the principal is open to anyone, the role can only be assumed by Fluid Attacks' production role.sts:ExternalId
is a shared secret between Fluid Attacks and you and is used to verify that the request to assume the role comes from Fluid Attacks.
apigateway:GET(GetMethod)
apigateway:GET(GetResources)
apigateway:GET(GetRestApis)
autoscaling:DescribeAutoScalingInstances
cloudfront:GetDistribution
cloudfront:GetDistributionConfig
cloudfront:ListDistributions
cloudtrail:DescribeTrails
cloudtrail:GetTrailStatus
cloudtrail:ListTrails
cognito-idp:GetUserPoolMfaConfig
dynamodb:DescribeContinuousBackups
dynamodb:DescribeTable
dynamodb:ListTables
ec2:DescribeFlowLogs
ec2:DescribeImages
ec2:DescribeInstanceAttribute
ec2:DescribeInstances
ec2:DescribeKeyPairs
ec2:DescribeLaunchTemplateVersions
ec2:DescribeNetworkAcls
ec2:DescribeNetworkInterfaces
ec2:DescribeRegions
ec2:DescribeSecurityGroups
ec2:DescribeSnapshots
ec2:DescribeVolumes
ec2:DescribeVpcEndpoints
ec2:DescribeVpcs
eks:DescribeCluster
eks:ListClusters
elasticache:DescribeCacheClusters
elasticloadbalancing:DescribeListeners
elasticloadbalancing:DescribeLoadBalancerAttributes
elasticloadbalancing:DescribeLoadBalancers
elasticloadbalancing:DescribeSSLPolicies
elasticloadbalancing:DescribeTags
iam:GenerateCredentialReport
iam:GetAccountPasswordPolicy
iam:GetAccountSummary
iam:GetCredentialReport
iam:GetInstanceProfile
iam:GetLoginProfile
iam:GetPolicy
iam:GetPolicyVersion
iam:GetRolePolicy
iam:GetUser
iam:ListAccessKeys
iam:ListAttachedRolePolicies
iam:ListAttachedUserPolicies
iam:ListGroupPolicies
iam:ListGroups
iam:ListMFADevices
iam:ListRolePolicies
iam:ListRoles
iam:ListSSHPublicKeys
iam:ListUserPolicies
iam:ListUsers
kms:DescribeKey
kms:GetKeyPolicy
kms:GetKeyRotationStatus
kms:ListAliases
kms:ListKeyPolicies
kms:ListKeys
rds:DescribeDBClusters
rds:DescribeDBInstances
rds:DescribeDBSnapshotAttributes
rds:DescribeDBSnapshots
redshift:DescribeClusterParameters
redshift:DescribeLoggingStatus
s3:GetBucketAcl
s3:GetBucketLogging
s3:GetBucketPolicy
s3:GetBucketVersioning
s3:GetBucketPublicAccessBlock
s3:ListAllMyBuckets
secretsmanager:DescribeSecret
secretsmanager:ListSecrets
sns:GetTopicAttributes
sns:ListTopics
sqs:GetQueueAttributes
sqs:ListQueues
sts:GetCallerIdentity
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "LeastPrivilegeCodeCommit",
"Effect": "Allow",
"Action": ["codecommit:Get*", "codecommit:GitPull"],
"Resource": ["<REPO'S ARN>"]
}
]
}
This section outlines how to deploy the necessary resources for the Fluid Attacks CSPM module using AWS CloudFormation.
Resources:
CSPMRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- "sts:AssumeRole"
Principal:
AWS:
- "*"
Condition:
ArnEquals:
aws:PrincipalArn: "arn:aws:iam::205810638802:role/prod_integrates"
StringEquals:
sts:ExternalId: "<YOUR-EXTERNAL-ID>"
Description: Role to enable Fluid Attacks CSPM module
ManagedPolicyArns:
- arn:aws:iam::aws:policy/ReadOnlyAccess
RoleName: CSPM
<YOUR-EXTERNAL-ID>
in the code snippet with the actual external ID provided by Fluid Attacks, then save the file.To be able to deploy the template using the CLI, you first need to install the AWS CLI and then configure the security credentials (AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
) to authenticate as a user with permissions to read and write CloudFormation and IAM resources. Please refer to the official documentation to see the configuration specifications.
Once that setup is done, do the following:
aws cloudformation deploy --template-file <path/to/template> --stack-name <stack-name> --capabilities CAPABILITY_NAMED_IAM
aws iam get-role --role-name "CSPM"
You then receive a JSON response with details about the role, including the ARN.
To deploy the template using the AWS Management Console:
If you encounter issues while adding your AWS environment to the Fluid Attacks platform, verify the following:
ReadOnlyAccess
or a custom policy with equivalent permissions.