AWS Security Services
Organizations and SCPs, Artifact, Shield, WAF, KMS and CloudHSM, Inspector, GuardDuty, Security Hub, Macie, plus zero trust, cryptography and compliance basics.
What is it?
Beyond IAM and network rules, AWS has many security services. Group them by the job they do.
Governance and compliance
- AWS Organizations: manage many accounts centrally with organizational units (OUs), consolidated billing and service control policies (SCPs). SCPs set the maximum permissions accounts can have. They never grant access on their own.
- AWS Artifact: self-service portal for AWS compliance reports and agreements.
- AWS Config / CloudTrail: configuration compliance and audit trail (see monitoring).
- AWS Audit Manager: keeps collecting evidence (from Config, CloudTrail, Security Hub and others) and maps it to frameworks such as SOC 2 or PCI DSS for audit-ready reports. It does not make you compliant; you still need an auditor. Exam tip: Security Hub CSPM = posture score, Audit Manager = audit evidence.
Protecting against attacks
- A DDoS attack floods a target with traffic from many compromised machines.
- Shield Standard: free and automatic for all customers. Protects against common layer 3 (network) and layer 4 (transport) attacks, especially for traffic through CloudFront and Route 53.
- Shield Advanced: a paid subscription for CloudFront, Route 53, ELB, Global Accelerator and Elastic IPs. Adds better detection and visibility, access to the Shield Response Team (needs a Business-level or higher support plan), DDoS cost protection and an SLA. Pair it with AWS WAF for layer 7 (application) protection.
- AWS WAF: a web application firewall. Web ACLs hold your own rules, AWS Managed Rules or Marketplace rule groups to block SQL injection, cross-site scripting, bad IPs, rate-limit abuse and bots (Bot Control). Attaches to CloudFront, Application Load Balancer, API Gateway REST APIs, AppSync and Cognito user pools, not to a Network Load Balancer.
- AWS Network Firewall: managed stateful firewall and intrusion prevention for VPCs.
- AWS Firewall Manager: centrally applies WAF rules, Shield Advanced, security groups, network ACLs, Network Firewall, Route 53 Resolver DNS Firewall and third-party firewalls across accounts. Needs AWS Organizations, a Firewall Manager administrator account and AWS Config.
Protecting data
- AWS KMS (Key Management Service): create and control encryption keys. Encryption at rest protects stored data (S3, EBS, RDS). Encryption in transit protects data moving over the network with TLS.
- AWS Secrets Manager: stores and automatically rotates secrets such as database passwords and API keys. Parameter Store is a related option.
- AWS Certificate Manager (ACM): provisions, manages and renews public and private TLS certificates for services like CloudFront and load balancers.
- AWS CloudHSM: single-tenant hardware security modules you control (details below).
- Amazon Macie: uses machine learning to find sensitive data (like personal information) in S3.
Detecting threats and weaknesses
- Amazon GuardDuty: must be switched on. Then it uses machine learning, anomaly detection and threat intelligence on CloudTrail events, VPC Flow Logs and DNS logs (with optional protection for S3, EKS, RDS, Lambda, malware and runtime). A classic finding is use of the root user's credentials. Findings can trigger automatic responses through EventBridge, and one delegated administrator account can manage it across an organization.
- Amazon Inspector: continuously scans EC2 instances, container images in ECR and Lambda functions for software vulnerabilities and unintended network exposure. (The older agent-based "Inspector Classic" is retired.)
- Amazon Detective: builds a graph of related logs to find the root cause of a finding. Pipeline to remember: CloudTrail records, GuardDuty detects, Detective investigates.
- AWS Security Hub CSPM (the original Security Hub, renamed in June 2025): cloud security posture management. Turn on security standards (such as CIS or AWS Foundational Security Best Practices, built on AWS Config rules) and get a security score plus collected findings.
- AWS Security Hub (the new service with that name): correlates findings from Security Hub CSPM, GuardDuty, Inspector and Macie into prioritised risks. Older study material says "Security Hub" for the posture-score service.
Identity and sharing
- AWS IAM Identity Center (formerly AWS Single Sign-On): the recommended way to give your workforce one sign-in to all accounts in AWS Organizations, plus single sign-on to SAML business apps. Identities can live in its built-in directory, in Active Directory (AWS Managed Microsoft AD or AD Connector), or in an external SAML 2.0 identity provider such as Microsoft Entra ID (formerly Azure AD) or Okta.
- Amazon Cognito: sign-up, sign-in and access control for your web and mobile app users (customer identity). IAM is for your workforce.
- AWS Directory Service: managed Microsoft Active Directory in AWS, plus AD Connector and Simple AD options.
- AWS Resource Access Manager (RAM): shares resources such as subnets or Transit Gateways with other accounts without copying them.
Security resources: AWS Trusted Advisor security checks, the AWS Knowledge Center, security blogs, whitepapers, AWS Marketplace security products, and the Artifact portal for compliance reports.
Security concepts the exam expects
- Zero trust: "never trust, always verify". With remote work and personal devices, the network edge is no longer a reliable wall, so identity becomes the main security perimeter. Identity controls add to network controls (firewalls, VPNs); they do not replace them. On AWS the building blocks are IAM policies, permissions boundaries, SCPs and IAM conditions (source IP, Region, MFA, time of day). AWS Verified Access gives VPN-less, identity- and device-aware access to internal apps.
- Defense in depth: layers of protection from the inside out: data, application, compute, network, perimeter (for example DDoS filtering), identity and access, physical. If one layer fails, the next still protects you.
- CIA triad: confidentiality (only the right people see data, e.g. encryption), integrity (data stays accurate and untampered, e.g. hashing, tamper-evident HSMs) and availability (data is reachable when needed, e.g. multi-AZ, DDoS protection). Improving one often costs another.
- Vulnerability: a design flaw or bug an attacker can exploit, such as missing input validation, weak cryptography or too-broad permissions. The OWASP Top 10 lists the most common web app risks (SQL injection, cross-site scripting and so on).
- Hardening: removing as many risks as possible from a system, often by checking it against a benchmark such as the CIS Benchmarks.
Cryptography basics
- Encryption turns readable plaintext into ciphertext using a key and an algorithm (cipher). Symmetric encryption uses one shared key to encrypt and decrypt (AES, used across AWS). Asymmetric encryption uses a key pair: one key encrypts, the other decrypts (RSA).
- Hashing turns any input into a fixed-size output. It is one-way and always gives the same result for the same input, which is why passwords are stored as hashes. A salt (a random value added before hashing) makes identical passwords produce different hashes. Avoid MD5; use SHA-256 or bcrypt.
- Digital signatures: a private key signs and the public key verifies. This proves who sent something and that it was not changed. SSH key pairs and code signing work this way.
- In transit vs at rest: TLS (1.2 or 1.3; SSL is obsolete) protects data moving over a network. AES-style encryption protects stored data.
Keys and HSMs in more detail
- A hardware security module (HSM) stores keys in tamper-resistant hardware. FIPS 140 is the US/Canadian standard for cryptographic modules. Level 3 adds tamper resistance and response on top of Level 2's tamper evidence. FIPS 140-3 is the current version.
- AWS KMS is a managed, multi-tenant service. Its HSMs are FIPS 140-3 Level 3 validated. Many services encrypt with KMS through one setting (EBS, RDS, DynamoDB, S3). AWS managed keys are created for you. Customer managed keys let you write key policies, control rotation, and separate key administrators from key users. KMS uses envelope encryption: a data key encrypts your data, and the KMS key (which never leaves KMS) encrypts the data key.
- AWS CloudHSM gives you dedicated, single-tenant HSMs in your VPC. AWS handles hardware, patching and backups, but only you control the keys. It supports standard APIs (PKCS#11, Java JCE, Microsoft CNG, OpenSSL) and can back a KMS custom key store. It costs much more than KMS, so pick it for strict regulatory or key-control needs.
- Exam trap: older material says "KMS = FIPS Level 2, CloudHSM = Level 3". That is outdated. The real difference today is multi-tenant and AWS-managed (KMS) vs single-tenant and customer-controlled (CloudHSM).
Compliance programs and proof
- Know the common names: ISO/IEC 27001 (information security management), 27017 (cloud security controls), 27018 (personal data in the cloud), 27701 (privacy management); SOC 1 (financial reporting controls), SOC 2 (security and availability controls), SOC 3 (public summary); PCI DSS (card payments); HIPAA (US health data); FedRAMP (US government cloud); GDPR (EU personal data); FIPS 140 (crypto modules); CSA STAR (cloud provider security); CJIS (US criminal justice data).
- The AWS Compliance Programs page lists what AWS supports. AWS Artifact is where you download the actual reports (SOC, PCI, ISO, FedRAMP) and accept agreements such as a HIPAA Business Associate Addendum (BAA). Artifact answers "why should we trust AWS?". Do not confuse it with AWS CodeArtifact, a package repository.
Penetration testing: you may pen-test your own resources on approved services (EC2, ELB, RDS, Aurora, CloudFront, API Gateway, Lambda, Lightsail, Elastic Beanstalk and others) without asking AWS first.
- Prohibited: DNS zone walking on Route 53 hosted zones, DoS/DDoS or simulated DoS (there is a separate DDoS simulation testing policy), and port, protocol or request flooding.
- Other simulated events, such as red-team or phishing exercises, need a request form.
Look-alike services: Inspector scans your workloads for vulnerabilities. Trusted Advisor gives account-wide best-practice checks (cost, performance, security, fault tolerance, service quotas, operational excellence). Artifact gives you AWS's compliance reports; Inspector reports on the security of your workloads.
Explain like I'm 10
Securing an account is like running a museum. Organizations and SCPs are museum-wide rules no gallery manager can override. Shield and WAF are the barriers and bag checks at the entrance. KMS is the locksmith holding the keys to the display cases. Inspector checks locks and windows for weak spots, GuardDuty is the camera system spotting odd behavior, Macie finds valuables left unlabeled on tables, and Security Hub is the control room with every alert on one screen.
Examples
A service control policy (guardrail)
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyOutsideApprovedRegions",
"Effect": "Deny",
"NotAction": ["iam:*", "organizations:*", "route53:*", "cloudfront:*", "support:*"],
"Resource": "*",
"Condition": {
"StringNotEquals": { "aws:RequestedRegion": ["eu-west-1", "eu-central-1"] }
}
},
{
"Sid": "ProtectCloudTrail",
"Effect": "Deny",
"Action": ["cloudtrail:StopLogging", "cloudtrail:DeleteTrail"],
"Resource": "*"
}
]
}Attached to an OU, this limits every account in it to two Regions and stops anyone, even admins, from switching off auditing.
Encrypt with KMS
KEY=$(aws kms create-key --description "app data key" --query KeyMetadata.KeyId --output text)
aws kms create-alias --alias-name alias/app-data --target-key-id "$KEY"
aws s3api put-bucket-encryption --bucket zykit-demo-bucket-12345 \
--server-side-encryption-configuration '{
"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"aws:kms","KMSMasterKeyID":"alias/app-data"}}]
}'Which service?
Question Service
---------------------------------------------------- ----------------
Where do I download AWS's SOC / ISO reports? Artifact
Stop a Region or service across 50 accounts? Organizations SCP
Block SQL injection on my website? WAF
Absorb a volumetric DDoS attack? Shield
Manage encryption keys? KMS
Find personal data stored in S3? Macie
Scan EC2 / images for known vulnerabilities? Inspector
Detect odd API calls or crypto-mining traffic? GuardDuty
See all findings in one dashboard? Security HubHow it works
SCP evaluation: an action is allowed only if the account's IAM permissions allow it and no SCP on the path from the organization root to the account blocks it. Envelope encryption in KMS: a KMS key encrypts a small data key, and the data key encrypts your data. Services do this for you.
Detection services run all the time. GuardDuty reads CloudTrail, VPC flow logs and DNS logs. Inspector scans on events like new images. Macie samples S3 contents. Findings go to Security Hub for triage and can trigger automatic responses through EventBridge and Lambda.
Organization root
|-- OU: Prod ----- SCPs (max permissions)
| '-- accounts
'-- OU: Dev
Edge: Shield + WAF --> CloudFront / ALB
Data: KMS keys --> S3 / EBS / RDS encryption
Detect: GuardDuty + Inspector + Macie --> Security Hub --> alertsWhy does it exist?
Attacks, mistakes and compliance demands grow with scale. Central guardrails and automatic detection let small teams protect many accounts the same way, without relying on every engineer remembering everything.
When to use it
Use Organizations from the start for a multi-account setup, encrypt by default with KMS, put WAF and Shield in front of public apps, and turn on GuardDuty, Inspector and Security Hub as baseline detection.
When not to use it
Do not use SCPs to grant permissions (they only restrict). Shield Advanced is overkill for low-risk internal apps. A WAF is not a substitute for fixing vulnerable code.
Common mistakes
Thinking an SCP gives users access.
Encrypting data but leaving key policies wide open.
Enabling detection services but never reading or routing findings.
Confusing Inspector (vulnerabilities in workloads), GuardDuty (threat detection), and Macie (sensitive data).
Assuming Shield Advanced is required to get basic DDoS protection.
Mixing up Cognito (your app's customers) with IAM Identity Center (your workforce).
Hard-coding database passwords instead of using Secrets Manager.
Repeating the old rule "KMS is FIPS Level 2, CloudHSM is Level 3" - KMS HSMs are now FIPS 140-3 Level 3; the real difference is multi-tenant vs single-tenant control.
Trying to attach AWS WAF to a Network Load Balancer (it works with CloudFront, ALB, API Gateway, AppSync and Cognito).
Expecting Shield Standard to stop layer 7 attacks - application-layer filtering needs AWS WAF.
Confusing AWS Artifact (AWS compliance reports) with AWS CodeArtifact (software packages) or with Amazon Inspector (your workloads' vulnerabilities).
Thinking Audit Manager makes you compliant - it gathers evidence; an auditor still assesses it.
Running a load or flood test against AWS endpoints and calling it a pen test - DoS and flooding are prohibited.
Using MD5 or unsalted hashes for passwords.
Practice exercises
- Easy:
Match each to its job: Artifact, KMS, WAF, Macie, GuardDuty, Inspector.
- Medium:
Write an SCP that prevents leaving the organization and explain why attaching it at an OU is safer than at each account.
- Medium:
Explain encryption at rest vs in transit with one AWS example each.
- Hard:
GuardDuty reports an EC2 instance contacting a known malicious IP. Outline a response: isolate, investigate with logs, rotate credentials, remediate.
- Easy:
Give one AWS example for each part of the CIA triad: confidentiality, integrity, availability.
- Medium:
List the defense-in-depth layers from data outwards and name one AWS service or feature that protects each layer.
- Medium:
A regulator requires that only your company can ever access the encryption keys, on dedicated hardware. Choose between KMS and CloudHSM and explain the trade-offs.
- Hard:
Design a zero trust access setup for 20 accounts: IAM Identity Center with an external IdP, SCPs, IAM conditions requiring MFA, and Verified Access for an internal web app.
Interview questions
What is an SCP?
A policy in AWS Organizations that sets the maximum available permissions for accounts in an OU or the organization; it does not grant permissions.
Shield Standard vs Advanced?
Standard is automatic and free for all customers against common network and transport layer attacks. Advanced is paid and adds extended protections, 24/7 response team access and cost protection.
What does KMS do?
Creates, stores and controls cryptographic keys used to encrypt data in AWS services and applications.
Exam-style: Which service finds sensitive data such as PII in S3?
Amazon Macie.
Exam-style: Where can a customer download AWS compliance reports?
AWS Artifact.
Exam-style: Which service rotates database credentials automatically?
AWS Secrets Manager.
Exam-style: Which service manages TLS certificates for a CloudFront distribution?
AWS Certificate Manager.
Exam-style: Which service enforces WAF rules across all accounts in an organization?
AWS Firewall Manager.
Exam-style: Which service analyses CloudTrail events, VPC Flow Logs and DNS logs to detect malicious activity?
Amazon GuardDuty.
Exam-style: Which service continuously scans EC2 instances, ECR images and Lambda functions for software vulnerabilities?
Amazon Inspector.
Exam-style: Which service collects evidence and maps it to frameworks like SOC 2 to prepare for an audit?
AWS Audit Manager.
Exam-style: A company needs single-tenant HSMs where only it controls the keys. Which service?
AWS CloudHSM.
Exam-style: Where does a healthcare customer accept the AWS HIPAA Business Associate Addendum?
AWS Artifact (Agreements).
Exam-style: Which Shield Advanced feature requires a Business-level or higher support plan?
Access to the Shield Response Team (SRT).
Exam-style: Which service gives one workforce sign-in across all accounts in AWS Organizations?
AWS IAM Identity Center (formerly AWS Single Sign-On).
Do you need AWS approval to pen-test your own EC2 instances?
No, for the listed approved services you can test without prior approval, but DoS, flooding and Route 53 zone walking are prohibited.
What is zero trust?
A model that verifies every request and treats identity, not the network location, as the main security perimeter.
What is the difference between Security Hub CSPM and the new AWS Security Hub?
Security Hub CSPM (the original service) runs posture checks against standards and aggregates findings; the new Security Hub correlates findings from CSPM, GuardDuty, Inspector and Macie into prioritised risks.
What is the difference between hashing and encryption?
Encryption is reversible with the right key; hashing is one-way and is used to verify data such as passwords.