Skip to main content

AWS

Adding an AWS account gives Cloud Defense access to it through an IAM role you create in the account. Cloud Defense discovers the account's resources into Inventory, runs posture monitoring checks against them, and, with Read/Write access, can apply the checks' remediation actions. The same setup forwards CloudTrail events and Security Hub findings, which keeps inventory current between daily discoveries and is what the threat detectors run on.

Everything is created by a CloudFormation stack (or the equivalent Terraform) whose parameters Cloud Defense fills in for you. You always own the role; it exists in your account and you can review or remove it at any time.

Before you start

PrerequisiteWhy it's neededWhere to check
The 12-digit AWS account IDIt identifies the account in Cloud DefenseAWS console, account menu (top right)
Permission to create a CloudFormation stack that creates IAM resources in that accountThe stack creates the role and its policiesYour IAM permissions in the account
For an AWS Organizations rollout, access to the organization's management account and the root ID (r-…) or the OU IDs (ou-…) to coverThe StackSet is created from the management accountAWS Organizations in the console

Set up an AWS account

  1. In Cloud Defense, go to Settings > Cloud Accounts and click Add Cloud Account.
  2. Cloud Provider: AWS. Enter the AWS Account ID, a name, a project, and the Account Environment.
  3. Cloud Defense Access: Read Only to assess and suggest, or Read/Write to also let Cloud Defense apply remediation actions. See Access levels.
  4. Save. You land on the Provision page, which offers three ways to create the role. Pick one:
    • CloudFormation, for a single account. Sign in to that AWS account in the console, then open the Quick create stack link. The parameters are pre-filled from your account; leave them as they are, tick I acknowledge that AWS CloudFormation might create IAM resources, and create the stack.
    • AWS Organizations CloudFormation, for many accounts at once. Sign in to the organization's management account, open the Quick create stack link, and enter the root ID or a comma-separated list of OU IDs to cover. Everything else is pre-filled.
    • Terraform. Download the template from the link, copy the tfvars text, and apply the template with those variables.
  5. Once the stack has finished creating, click Verify Account Access. It reports Access to this account has been successfully verified. when Cloud Defense can assume the role. Discovery starts on its own from there, and findings appear under Posture Monitoring once the first checks have run.

If you'd rather review what the stack does before creating it, open the template URL shown on the quick-create page, or choose Create change set so CloudFormation lists the resources first.

What the stack creates

ResourcePurpose
An IAM role under the path /CloudDefense/The role Cloud Defense assumes. Only Cloud Defense can assume it, and only with an external ID. It carries the AWS-managed SecurityAudit policy plus a custom policy with a few additional read-only permissions that SecurityAudit lacks
A small function that runs once while the stack is createdRegisters the role with Cloud Defense
A StackSet that adds an event rule in each selected regionForwards CloudTrail events and Security Hub findings to Cloud Defense for near-real-time updates. Not created for free-tier clients

The region list for the StackSet defaults to every AWS region. If some regions are disabled in your account, remove them from the EventRegions parameter before creating the stack; a disabled region makes the StackSet fail.

With Read/Write access, the role also carries a write policy. It contains only the permissions the supported remediation actions need, listed per action on the Check Actions page, and the role is explicitly denied from changing its own policies.

With Events Only access, the stack creates no role for Cloud Defense to assume. It only forwards events, and the account's resources aren't discovered into Inventory.

Verify it landed

What to checkWhere to look
Cloud Defense can assume the roleVerify Account Access succeeds, and the Provision page shows This account has been provisioned. with no Resource Errors
The account has no discovery errorsSettings > Cloud Accounts: no red warning icon on the account's row
The resources themselvesInventory, filtered by the account. Supported resources lists what discovery covers
FindingsPosture Monitoring, after the first checks run
Events are arrivingEvents lists the account's CloudTrail events shortly after they happen, and a change such as tagging an instance shows up in Inventory within a few minutes rather than after the next daily discovery

Keeping the stack current

The template is updated as discovery covers more services. Once the account is provisioned, the CloudFormation tab on the Provision page switches to showing an AWS CLI command that updates your existing stack to the latest template. You can run it from AWS CloudShell. To preview the changes first, download the template at the --template-url in the command, or update the stack with a change set.

Resource Errors on the Provision page whose message mentions Access Denied or not authorized usually mean the stack is behind the template; updating it adds the missing permissions.

Details and edge cases

Deleting the stack removes the role, and discovery stops at the next run with permission errors. Delete the account in Cloud Defense as well, so it doesn't keep reporting errors.

Free-tier clients don't receive events. The stack is created without the event StackSet, so inventory updates only on the daily discovery and the threat detectors have nothing to run on.

AWS documentation

Supported resources

Discovery covers the AWS resource types below. The ID column is the type each resource is listed under in Inventory.

Show all 103 resource types
NameID
Access AnalyzerAWS::AccessAnalyzer::Analyzer
AccountCustom::AWS::Account
Amazon InspectorCustom::AWS::InspectorV2::Inspector
Amazon Inspector Covered ResourceCustom::AWS::InspectorV2::CoveredResource
Amazon MacieAWS::Macie::Session
API Gateway API KeyAWS::ApiGateway::ApiKey
API Gateway HTTP APIAWS::ApiGatewayV2::Api
API Gateway REST APIAWS::ApiGateway::RestApi
AppRunner ServiceAWS::AppRunner::Service
Athena DataCatalogAWS::Athena::DataCatalog
Athena WorkGroupAWS::Athena::WorkGroup
Auto Scaling GroupAWS::AutoScaling::AutoScalingGroup
Auto Scaling Launch ConfigurationAWS::AutoScaling::LaunchConfiguration
Backup PlanAWS::Backup::BackupPlan
Certificate Manager (ACM) CertificateAWS::CertificateManager::Certificate
CloudFormation StackAWS::CloudFormation::Stack
CloudFront DistributionAWS::CloudFront::Distribution
CloudTrail TrailAWS::CloudTrail::Trail
CloudWatch AlarmAWS::CloudWatch::Alarm
CloudWatch Events RuleAWS::Events::Rule
CloudWatch Log GroupAWS::Logs::LogGroup
CodeBuild ProjectAWS::CodeBuild::Project
CodeCommit RepositoryAWS::CodeCommit::Repository
Config Configuration RecorderAWS::Config::ConfigurationRecorder
DynamoDB Accelerator ClusterAWS::DAX::Cluster
DynamoDB TableAWS::DynamoDB::Table
EC2 Elastic IP Address (EIP)AWS::EC2::EIP
EC2 Flow LogAWS::EC2::FlowLog
EC2 ImageAWS::EC2::Image
EC2 InstanceAWS::EC2::Instance
EC2 Network ACLAWS::EC2::NetworkAcl
EC2 Network InterfaceAWS::EC2::NetworkInterface
EC2 Route TableAWS::EC2::RouteTable
EC2 Security GroupAWS::EC2::SecurityGroup
EC2 Service ConfigurationAWS::EC2::ServiceConfiguration
EC2 SnapshotAWS::EC2::Snapshot
EC2 SubnetAWS::EC2::Subnet
EC2 Transit GatewayAWS::EC2::TransitGateway
EC2 Transit Gateway AttachmentAWS::EC2::TransitGatewayAttachment
EC2 Transit Gateway Route TableAWS::EC2::TransitGatewayRouteTable
EC2 VolumeAWS::EC2::Volume
EC2 VPCAWS::EC2::VPC
EC2 VPC EndpointAWS::EC2::VpcEndpoint
EC2 VPC Peering ConnectionAWS::EC2::VpcPeeringConnection
ECR RepositoryAWS::ECR::Repository
ECS TaskAWS::ECS::Task
ECS Task DefinitionAWS::ECS::TaskDefinition
EFS File SystemAWS::EFS::FileSystem
EKS ClusterAWS::EKS::Cluster
Elastic Load BalancerAWS::ElasticLoadBalancing::LoadBalancer
Elastic Load Balancer V2AWS::ElasticLoadBalancingV2::LoadBalancer
Elastic Load Balancing V2 TargetGroupAWS::ElasticLoadBalancingV2::TargetGroup
ElastiCache Replication GroupAWS::ElastiCache::ReplicationGroup
Fault Injection Simulator ExperimentAWS::Fis::Experiment
Firehose Delivery StreamAWS::Firehose::DeliveryStream
Glue ConnectionAWS::Glue::Connection
Glue Data Catalog Encryption SettingsAWS::Glue::DataCatalogEncryptionSettings
Glue Data Catalog Resource PolicyAWS::Glue::ResourcePolicy
Glue DatabaseAWS::Glue::Database
Glue Dev EndpointAWS::Glue::DevEndpoint
Glue JobAWS::Glue::Job
Glue ML TransformAWS::Glue::MLTransform
Glue Security ConfigurationAWS::Glue::SecurityConfiguration
GuardDuty DetectorAWS::GuardDuty::Detector
IAM AccountCustom::AWS::IAM::Account
IAM GroupAWS::IAM::Group
IAM Identity CenterCustom::AWS::IAM::IdentityCenter
IAM Instance ProfileAWS::IAM::InstanceProfile
IAM Managed PolicyAWS::IAM::ManagedPolicy
IAM RoleAWS::IAM::Role
IAM SAML ProviderAWS::IAM::SAMLProvider
IAM Server CertificateAWS::IAM::ServerCertificate
IAM UserAWS::IAM::User
IAM Virtual MFA DeviceAWS::IAM::VirtualMFADevice
Kinesis StreamAWS::Kinesis::Stream
KMS KeyAWS::KMS::Key
Lambda FunctionAWS::Lambda::Function
OpenID Connect ProviderAWS::IAM::OIDCProvider
OpenSearch DomainAWS::OpenSearch::Domain
RDS DB ClusterAWS::RDS::DBCluster
RDS DB Cluster SnapshotAWS::RDS::DBClusterSnapshot
RDS DB InstanceAWS::RDS::DBInstance
RDS DB Parameter GroupAWS::RDS::DBParameterGroup
RDS DB SnapshotAWS::RDS::DBSnapshot
RDS Option GroupAWS::RDS::OptionGroup
Redshift ClusterAWS::Redshift::Cluster
RegionCustom::AWS::Region
Route53 Hosted ZoneAWS::Route53::HostedZone
S3 AccountCustom::AWS::S3::Account
S3 BucketAWS::S3::Bucket
SageMaker Notebook InstanceAWS::SageMaker::NotebookInstance
Secrets Manager SecretAWS::SecretsManager::Secret
Security HubAWS::SecurityHub::Hub
SNS SubscriptionAWS::SNS::Subscription
SNS TopicAWS::SNS::Topic
SQS QueueAWS::SQS::Queue
SSM DocumentAWS::SSM::Document
SSM InstanceInformationAWS::SSM::InstanceInformation
WAF v2 IP SetAWS::WAFv2::IPSet
WAF v2 Logging ConfigurationAWS::WAFv2::LoggingConfiguration
WAF v2 Regex Pattern SetAWS::WAFv2::RegexPatternSet
WAF v2 Rule GroupAWS::WAFv2::RuleGroup
WAF v2 Web ACLAWS::WAFv2::WebACL