Ravindra BagaleCourses & study guides Track your progress

AWS Cloud

AWS Security Services Interview Questions and Answers: KMS, WAF, Shield, GuardDuty, Inspector, Macie and Security Hub (50 Questions)

This page has 50 new security interview questions with full answers. The first set covered IAM and the basics of KMS, Secrets Manager, GuardDuty and WAF. This page goes deeper into each security service and into how a security team really uses them together.

1. An everyday example: securing a jewellery shop

Why are security services asked in every cloud interview?

One leaked key or one public bucket can cost a company millions and its reputation. Every cloud role now shares security work, so interviewers check that you know which service solves which problem, and how to respond when an alert fires.

Think of a jewellery shop. KMS is the safe and its keys. Secrets Manager is the locked drawer for passwords. WAF is the guard who checks every visitor at the door. Shield protects against a crowd blocking the entrance. GuardDuty is the CCTV that spots suspicious behaviour. Inspector checks the locks and windows for weak points. Macie finds where valuable items are lying around. Security Hub is the control room screen that shows everything in one place.

How to use this page

  • Learn which service answers which question: prevent, detect, find weaknesses or respond.
  • Turn services on in a test account to see real findings (most have free trials).
  • For senior questions, describe the full flow: detect, triage, contain, fix and learn.

2. Fresher level questions

Start here if you are a fresher or have less than two years of experience. Try to answer each question aloud first. Then open it and compare.

Q1. How does automatic key rotation work for a customer managed KMS key? Fresher

When you turn on automatic rotation, KMS creates new key material on a schedule. By default this is every year, and you can choose a period between 90 and 2560 days. You can also rotate on demand.

  • The key ID, ARN and aliases stay the same, so applications do not change.
  • Old key material is kept, so data encrypted before the rotation can still be decrypted.
  • New encryptions use the newest material.

Automatic rotation works for symmetric encryption keys with KMS-generated material. It is not available for asymmetric keys or imported key material in the same way.

Q2. What is a KMS alias and why should applications use it? Fresher

An alias is a friendly name that points to a KMS key, such as alias/shop-prod-data.

Why use it:

  • Easier to read in code and policies than a long key ID.
  • You can point the alias to a different key later without changing application code.
  • The same alias name can exist in each Region and account, so code stays the same everywhere.

Note: aliases are not a security boundary by themselves. Permissions are still controlled by the key policy and IAM, although you can use aliases in some policy conditions.

Q3. What is the difference between symmetric and asymmetric KMS keys? Fresher
  • Symmetric key: one secret key that encrypts and decrypts. It never leaves KMS unencrypted. Most AWS services use symmetric keys for encryption at rest.
  • Asymmetric key: a public and private key pair. The private key stays in KMS. You can download the public key.

Uses of asymmetric keys:

  • Signing and verifying, for example signing software releases or tokens.
  • Encryption by outside parties who only have the public key.

For normal data encryption inside AWS, choose symmetric keys.

Q4. What does AWS Certificate Manager (ACM) do? Fresher

ACM provides and manages SSL/TLS certificates for your domains.

  • Public certificates are free when used with integrated services, such as Elastic Load Balancing, CloudFront and API Gateway.
  • ACM renews them automatically before they expire, if validation still works.
  • You prove domain ownership by DNS validation (a CNAME record) or email validation. DNS validation is recommended, because renewal then happens without any action.
  • Certificates for CloudFront must be requested in us-east-1.

You can also import your own certificates, but ACM does not renew imported ones.

Q5. What is a rate-based rule in AWS WAF? Fresher

A rate-based rule counts requests from each client (by default by IP address) over a time window and takes an action when a client goes over your limit.

Example: block any IP that sends more than 1,000 requests in 5 minutes to /login, to slow down password-guessing attacks.

You can also aggregate by other keys, such as a header, a cookie or a query parameter, and scope the rule down to certain paths.

It protects against simple floods and brute force, but not against attacks spread across thousands of IPs, so combine it with other rules.

Q6. What are AWS WAF managed rule groups? Fresher

Managed rule groups are ready-made sets of WAF rules maintained by AWS or by AWS Marketplace sellers.

Examples of AWS managed rule groups:

  • Core rule set: common web attacks.
  • Known bad inputs.
  • SQL database: SQL injection patterns.
  • Amazon IP reputation list.
  • Bot Control and account takeover prevention (paid add-ons).

Benefits: quick protection and automatic updates when new threats appear. You can override actions for individual rules if a rule blocks legitimate traffic.

Q7. What is the difference between Shield Standard and Shield Advanced? Fresher
  • Shield Standard: free and automatic for all AWS customers. It protects against common network and transport layer DDoS attacks, such as SYN floods.
  • Shield Advanced: a paid subscription with:

- Extra detection and mitigation for resources such as CloudFront, Route 53, Global Accelerator, ELB and Elastic IPs.

- Access to the AWS Shield Response Team (SRT) during attacks.

- Cost protection for scaling charges caused by DDoS attacks.

- AWS WAF included for protected resources, and automatic application layer mitigation.

Choose Advanced for business-critical, internet-facing apps.

Q8. What kinds of data does Amazon GuardDuty analyse? Fresher

GuardDuty's foundational data sources are:

  • AWS CloudTrail management events.
  • VPC Flow Logs.
  • Route 53 Resolver DNS query logs.

GuardDuty reads these directly. You do not need to turn on or pay for flow logs or DNS logs separately for it.

Optional protection plans add more: S3 Protection (data events), EKS Protection (audit logs), Runtime Monitoring (an agent for EC2, ECS and EKS), Malware Protection (EC2 volumes and S3 uploads), RDS Protection (login activity) and Lambda Protection (network activity).

Q9. What does Amazon Inspector scan? Fresher

Amazon Inspector finds software vulnerabilities and unintended network exposure.

  • EC2 instances: operating system and application packages, using the SSM Agent or agentless scanning of EBS snapshots.
  • Container images in Amazon ECR, on push and continuously.
  • Lambda functions: package dependencies, and optionally code scanning.

Findings include CVE details, a severity, and an Inspector risk score that considers things like network reachability and available exploits.

It scans continuously, so a new CVE produces new findings without you starting a scan.

Q10. What does Amazon Macie do? Fresher

Macie discovers sensitive data in Amazon S3, such as personal data (names, addresses, ID numbers), financial data (card numbers) and credentials.

It also checks bucket security, for example buckets that are public, shared with other accounts or not encrypted.

Two ways to scan:

  • Automated sensitive data discovery: samples objects across your buckets continuously at lower cost.
  • Sensitive data discovery jobs: targeted full scans of chosen buckets.

Use case: before a data protection audit, find every bucket that contains customer phone numbers.

Q11. What is AWS Security Hub CSPM? Fresher

Security Hub CSPM (cloud security posture management) checks your AWS resources against security standards and collects findings from many services in one place.

  • Standards: AWS Foundational Security Best Practices, CIS AWS Foundations Benchmark, PCI DSS and others.
  • Each control runs checks, mostly through AWS Config, and produces passed or failed findings.
  • It also receives findings from GuardDuty, Inspector, Macie, Firewall Manager and partner tools, in the ASFF format.

It was previously called just "Security Hub". The newer Security Hub builds on it to correlate findings into exposures.

Q12. What is Amazon Detective used for? Fresher

Amazon Detective helps you investigate security findings.

It collects and links data from CloudTrail, VPC Flow Logs, GuardDuty findings and EKS audit logs into a behaviour graph.

When GuardDuty reports suspicious activity for a role, Detective shows its normal behaviour over time, which IPs it used, which API calls it made, and related resources.

This answers questions like "is this new?", "what else did this IP do?" and "how far did it go?" much faster than reading raw logs.

Q13. How do you force HTTPS for all requests to an S3 bucket? Fresher

Add a bucket policy that denies any request where aws:SecureTransport is false.

aws s3api get-bucket-policy --bucket shop-docs-prod --query Policy --output text | jq '.Statement[0].Condition'

Output:

{ "Bool": { "aws:SecureTransport": "false" } }

The first statement (with Effect Deny) applies to every request made over plain HTTP, so only HTTPS requests can succeed.

AWS Security Hub CSPM has a control that checks for this, so you can find buckets without it across accounts.

Q14. What is S3 Object Lock and how does it help security? Fresher

Object Lock stores objects in write-once-read-many (WORM) mode, so they cannot be deleted or overwritten for a fixed time.

  • Governance mode: most users cannot delete, but users with a special permission can.
  • Compliance mode: nobody, including the root user, can delete the object version until the retention ends.
  • Legal hold: blocks deletion until the hold is removed, with no end date.

Security use: protect backups and logs from ransomware or an attacker with admin access. Versioning must be turned on.

Q15. How can a central security team push the same WAF and security group rules to every new account automatically? Fresher

Use AWS Firewall Manager. It lets a central security team manage firewall rules across all accounts in AWS Organizations.

It can apply and enforce:

  • AWS WAF web ACLs on ALBs, CloudFront and API Gateway.
  • Shield Advanced protections.
  • Security group policies (common rules and audits for overly open groups).
  • AWS Network Firewall and Route 53 Resolver DNS Firewall policies.

New accounts and resources get the policies automatically. It needs AWS Organizations and AWS Config.

Q16. What is the difference between prevention and detection controls in AWS security? Fresher
  • Preventive controls stop bad actions before they happen. Examples: SCPs, IAM permission boundaries, S3 Block Public Access, WAF rules, security groups.
  • Detective controls find problems after they happen. Examples: GuardDuty, AWS Config rules, Security Hub CSPM, CloudTrail with alarms, Macie.
  • Responsive controls fix problems automatically. Examples: EventBridge rules that run Lambda or Systems Manager Automation to fix a finding.

Good security uses all three, because no single prevention control is perfect.

Q17. What is Amazon Cognito used for in application security? Fresher

Amazon Cognito adds sign-up, sign-in and access control to web and mobile apps.

  • User pools: a user directory with sign-in, MFA, password policies and social or enterprise login (Google, SAML, OIDC). It issues JWT tokens.
  • Identity pools: exchange a login for temporary AWS credentials, so the app can call AWS services directly with limited permissions.

Security benefits: you do not store passwords yourself, and features like MFA and compromised credential checks are built in (some are part of paid feature plans).

APIs can validate Cognito tokens, for example with an API Gateway authorizer.

3. Mid level questions

These questions check how you use the service in real projects. Interviewers expect the why, the how and one real example.

Q18. How can a KMS key policy stop one tenant's role from decrypting another tenant's data? Mid level

Use encryption context with policy conditions. Encryption context is a set of non-secret key-value pairs that you pass when encrypting. You must pass exactly the same pairs when decrypting, or decryption fails.

Example: {"tenant":"acme","purpose":"invoice"}.

Uses:

  • Integrity: ciphertext cannot be decrypted in the wrong context.
  • Audit: the context appears in CloudTrail logs for each KMS call.
  • Access control: key policy conditions such as kms:EncryptionContext:tenant can allow a role to decrypt only data for its own tenant.

Many AWS services set encryption context automatically.

Q19. What are KMS grants and when are they used? Mid level

A grant gives a principal permission to use a KMS key for specific operations, without changing the key policy.

AWS services use grants a lot. For example, when an EBS volume is attached to an instance, EBS creates a grant so it can decrypt the volume's data key.

Grants are good for temporary or programmatic access, and they can be retired or revoked when no longer needed.

aws kms list-grants --key-id alias/shop-prod-ebs --query "Grants[].{op:Operations[0],grantee:GranteePrincipal}" --output table

shows who has been granted use of the key and for which operation. Review grants when you audit key access.

Q20. What does the kms:ViaService condition do? Mid level

kms:ViaService limits use of a KMS key to requests that come through a specific AWS service in a specific Region.

Example: a key policy allows the app role to decrypt only when the request comes via s3.ap-south-1.amazonaws.com.

Then, even if the role's credentials are stolen, the attacker cannot call kms:Decrypt directly on stolen ciphertext. They can only read data through S3, which still checks S3 permissions.

It is a strong way to tie a key to the service that should use it.

Q21. What are KMS multi-Region keys and when should you use them? Mid level

Multi-Region keys are a set of KMS keys in different Regions with the same key ID and the same key material. Data encrypted in one Region can be decrypted in another without calling across Regions.

Uses:

  • Disaster recovery: encrypted data replicated to another Region can be decrypted there quickly.
  • Global apps that encrypt in one Region and decrypt in another, such as with client-side encryption or DynamoDB global tables.

Each replica key has its own key policy, aliases and grants.

Use them only when needed, because a single-Region key gives a clearer security boundary.

Q22. How do you allow another AWS account to use your KMS key? Mid level

Two steps are needed:

  • Key policy in your account: allow the other account (or a specific role in it) to use the key, for example kms:Decrypt and kms:DescribeKey.
  • IAM policy in the other account: the role must also have permission for these actions on your key ARN.

Use the key ARN, not an alias, because aliases cannot be used across accounts in the same way.

Common use: sharing an encrypted S3 bucket, encrypted snapshots or an encrypted AMI. Remember that the AWS managed keys (aws/ebs, aws/s3) cannot be shared. You need a customer managed key.

Q23. How do S3 Bucket Keys reduce KMS cost and request load? Mid level

With SSE-KMS, S3 normally calls KMS for each object to get a data key. A busy bucket can make millions of KMS requests, which cost money and can hit KMS request quotas.

An S3 Bucket Key is a short-lived bucket-level key that S3 gets from KMS and uses to create data keys for many objects.

Result: KMS requests can drop by a large amount (AWS says up to 99%), so cost and throttling go down.

Note: the encryption context and CloudTrail entries then refer to the bucket, not to each object, so check policies that rely on object-level context.

Q24. What is the difference between the single-user and alternating-users rotation strategies in Secrets Manager? Mid level
  • Single user: the rotation function changes the password of the same database user. During a short moment, apps with the old password may fail until they fetch the new one.
  • Alternating users: Secrets Manager keeps two users, such as app_user and app_user_clone. Rotation changes the password of the user not in use, then switches the secret to it. Connections with the old user keep working.

Use alternating users for high-availability apps that cannot tolerate login errors. It needs a superuser secret to manage the users.

Apps should cache secrets briefly and refresh on authentication errors.

Q25. How do you make a secret available in a disaster recovery Region? Mid level

Use Secrets Manager secret replication.

  • Choose the replica Regions on the primary secret.
  • Secrets Manager keeps the replica values in sync, including rotations done on the primary.
  • Each replica can use a KMS key in its own Region.

In a disaster, you can promote a replica to a standalone secret.

Applications in the DR Region read the secret by the same name in their local Region, so code does not change.

Q26. An ACM certificate shows "Pending validation" for days. What is wrong? Mid level

ACM is waiting for proof that you control the domain.

For DNS validation:

  • The CNAME record that ACM gave you is missing, has a typo, or was created in the wrong hosted zone.
  • The domain's name servers at the registrar do not point to the hosted zone where you created the record.
  • A CAA record on the domain does not allow Amazon to issue certificates.

Check with dig CNAME _abc123.shop.example.com and compare with the value ACM shows. In Route 53, the console has a "Create records in Route 53" button that adds them correctly.

Q27. How do you safely introduce a new AWS WAF rule without blocking real users? Mid level
  • Add the rule in Count mode first. Matching requests are counted and labelled, but not blocked.
  • Turn on WAF logging (to CloudWatch Logs, S3 or Firehose) and check which requests match: are they attacks or real users?
  • Use scope-down statements or exclusions for known safe paths, such as an upload endpoint that triggers a size rule.
  • Switch the rule to Block, or to CAPTCHA or Challenge for a softer action.
  • Watch the BlockedRequests metric and application error reports after the change.

Keep rule changes in IaC with review.

Q28. What are WAF labels and how are they useful? Mid level

When a rule matches, it can add a label to the request, such as awswaf:managed:aws:bot-control:bot:category:search_engine.

Later rules in the same web ACL can match on labels.

Example:

  • The Bot Control rule group labels verified search engine bots.
  • A later custom rule allows requests with that label, and blocks other bots only on the /checkout path.

Labels let you build layered logic without repeating conditions, and they appear in WAF logs, which helps analysis.

Q29. What do web ACL capacity units (WCUs) mean in AWS WAF? Mid level

Each rule uses some capacity based on how complex it is. Simple IP matches use little capacity. Regex, many text transformations or large rule groups use more.

A web ACL has a capacity limit (in current documentation, 1,500 WCUs at the base price, with extra charges above that up to a higher maximum).

If you add too many complex rules, you reach the limit or pay more.

Tips: use managed rule groups wisely, use IP sets instead of many IP rules, and reuse regex pattern sets.

Q30. What do GuardDuty finding names like "UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS" tell you? Mid level

Finding types follow the format ThreatPurpose:ResourceType/ThreatFamily.Detail.

This one means: credentials that belong to an EC2 instance role were used from an IP address outside AWS. That strongly suggests someone stole the role credentials from the instance, for example through an SSRF bug reading IMDS.

Response:

  • Revoke active sessions for the role (deny tokens issued before now).
  • Investigate the instance for compromise.
  • Require IMDSv2 and fix the vulnerable application.

The severity and the affected resource are in the finding details.

Q31. How do you manage GuardDuty across all accounts in an organisation? Mid level
  • In the management account, choose a delegated administrator account for GuardDuty, usually the security tooling account.
  • In the delegated admin, turn on auto-enable for all existing and new member accounts, and choose protection plans organisation-wide.
  • Findings from all accounts appear in the delegated admin account.
  • Send findings to Security Hub and to EventBridge for alerts and automation.

Do this in every Region you use, or at least turn GuardDuty on in all Regions, because attackers often use Regions you do not watch.

Q32. How do you reduce noise from expected GuardDuty findings? Mid level
  • Use suppression rules to auto-archive findings that match known, expected behaviour, for example a vulnerability scanner that scans your own instances on a schedule.
  • Add trusted IP lists for your own scanners or office IPs, carefully.
  • Add threat IP lists for known bad IPs from your threat intelligence.
  • Tag and document every suppression rule with an owner and a reason, and review them regularly.

Never suppress whole categories just because they are noisy. Investigate first.

Q33. How does Security Hub CSPM help in a multi-account setup? Mid level
  • Set a delegated administrator account and turn on central configuration, so standards and controls are applied to all accounts and Regions from one place.
  • Turn on cross-Region aggregation, so findings from all Regions appear in one home Region.
  • Use automation rules to change severity or add notes, for example raise severity for production accounts.
  • Send findings to EventBridge for tickets and auto-remediation.
  • Track the security score per standard and per account.

This turns many separate accounts into one view for the security team.

Q34. What does the newer AWS Security Hub add on top of Security Hub CSPM? Mid level

The newer Security Hub (generally available since late 2025) takes signals from Security Hub CSPM, GuardDuty, Inspector and Macie and correlates them.

It creates exposure findings, which combine several issues on one resource into one prioritised risk. Example: an EC2 instance that is reachable from the internet, has a critical vulnerability, and has a role with access to sensitive S3 data.

It also gives near real-time risk analytics, trends and unified enablement. Its findings use the OCSF format, while CSPM uses ASFF.

AWS recommends turning on both, because Security Hub needs CSPM findings for full exposure analysis.

Q47. How do you find out who used a KMS key and for what? Mid level

Every KMS API call is logged in CloudTrail as a management event: Encrypt, Decrypt, GenerateDataKey, and also key policy changes and deletion requests.

aws cloudtrail lookup-events --lookup-attributes AttributeKey=ResourceName,AttributeValue=arn:aws:kms:ap-south-1:111122223333:key/1a2b3c4d-1111-2222-3333-444455556666 --max-results 2 --query "Events[].[EventTime,EventName,Username]" --output text

Output:

2026-11-20T10:14:03+05:30  Decrypt          shop-api-task-role
2026-11-20T10:13:59+05:30  GenerateDataKey  shop-api-task-role

The API task role used the key for these two calls. The full event shows the encryption context and the calling service.

For long-term analysis, query the CloudTrail logs in S3 with Athena, and alarm on sensitive events such as ScheduleKeyDeletion or PutKeyPolicy.

4. Senior level and scenario questions

These questions check design thinking and troubleshooting. Think aloud. Say what you check first, what you change, and how you prevent it next time.

Q35. An attacker may have used a leaked IAM role session for six hours. How do you respond? Senior
  • Contain: revoke active sessions for the role (an inline deny for tokens issued before now), and remove or restrict the role's trust policy if needed.
  • Scope: use CloudTrail (and Detective) to list every API call by that role in the period, from which IPs, in which Regions.
  • Look for persistence: new IAM users, access keys, roles, Lambda functions, EC2 instances, changed trust policies, or disabled logging.
  • Check data access: S3 data events and KMS Decrypt calls.
  • Remove what the attacker created, rotate related secrets, and fix the leak source.
  • Write a timeline and lessons learned.
Q36. How would you design encryption key management for a multi-tenant SaaS application on AWS? Senior

Options, from simple to strict:

  • One KMS key per environment, with encryption context including tenant ID, and key policy conditions on that context.
  • One KMS key per large tenant, especially for customers who want their own key, rotation control or the ability to revoke access.
  • Envelope encryption with data keys in the application, using the AWS Encryption SDK and caching data keys within safe limits to reduce KMS calls.

Consider: KMS request quotas, cost per key, auditability in CloudTrail, and how to delete a tenant's data by disabling or deleting its key (crypto shredding).

Q37. Your public website is under a layer 7 DDoS attack. What do you do right now? Senior
  • Confirm: traffic spike in CloudFront or ALB metrics, many requests to a few URLs, from many IPs.
  • Use WAF logs to find patterns: path, user agent, country, header or query.
  • Add or tighten rate-based rules, and block or challenge the pattern (CAPTCHA or Challenge actions).
  • Turn on AWS managed IP reputation and anonymous IP lists, and Bot Control if needed.
  • Cache more at CloudFront so the origin sees less traffic.
  • If you have Shield Advanced, engage the Shield Response Team and use automatic application layer mitigation.

Afterwards, review and make the protections permanent.

Q38. How do you prioritise thousands of Inspector vulnerability findings with a small team? Senior
  • Focus on exposure: findings on internet-reachable resources first. Inspector's risk score and network reachability help.
  • Focus on exploitability: known exploited vulnerabilities and available exploits.
  • Focus on importance: production and resources that touch sensitive data.
  • Fix by root cause: update the base AMI or container base image once, instead of patching hundreds of instances one by one.
  • Use Security Hub exposure findings to see combined risks.
  • Set SLAs by severity and track them.
  • Suppress accepted risks with documented reasons.
Q39. Macie found customer ID numbers in a bucket that should only contain logs. What do you do? Senior
  • Treat it as a possible data incident. Restrict access to the bucket now.
  • Find the source: which application wrote these objects, since when, and why personal data is in logs.
  • Check access: S3 server access logs or CloudTrail data events, to see who read the objects.
  • Clean up: delete or move the data according to policy, and check for copies (replication, backups, analytics tables).
  • Fix the application to mask or remove personal data before logging.
  • Inform the data protection officer if regulations apply, and add a Macie job to monitor the bucket.
Q40. How would you build automatic remediation for common security findings? Senior
  • Send findings from Security Hub (or GuardDuty and Config) to EventBridge.
  • EventBridge rules match specific findings, such as "S3 bucket public" or "security group open to 0.0.0.0/0 on port 22".
  • Targets run Systems Manager Automation runbooks or Lambda functions to fix them, for example turn on Block Public Access or remove the open rule.
  • Notify the owner with details, and record what changed.
  • Start in notify-only mode, then turn on auto-fix for low-risk, high-confidence cases.
  • Exclude break-glass resources with tags, and test runbooks in a sandbox account.
Q41. How do you protect data from a malicious admin in your own AWS organisation? Senior
  • Separation of duties: different people manage KMS keys, data and logs.
  • KMS key policies that do not give full control to the account root by default for sensitive keys, with careful break-glass access.
  • SCPs that stop disabling CloudTrail, GuardDuty or Config, and stop deleting KMS keys or backups.
  • Backups in a separate account with AWS Backup vault lock and S3 Object Lock in compliance mode.
  • Logs in a separate log archive account that admins of workload accounts cannot change.
  • Alerts on sensitive actions, such as key policy changes, sent to a team outside the admin's control.
Q42. An auditor asks you to prove that all data at rest is encrypted in 80 accounts. How do you answer? Senior
  • Use AWS Config with organisation conformance packs or rules such as encrypted volumes, RDS storage encrypted and S3 default encryption, aggregated to one account.
  • Use Security Hub CSPM controls and their pass and fail results as evidence across accounts and Regions.
  • Show preventive controls: EBS encryption by default in every Region, SCPs denying unencrypted resource creation where possible, and IaC templates with encryption on.
  • Export a report from the Config aggregator and Security Hub CSPM.
  • Explain exceptions with risk acceptance and a fix plan.

Evidence from tools is stronger than spreadsheets.

Q43. How do you secure a public API against credential stuffing on the login endpoint? Senior

Credential stuffing uses leaked username and password lists from other sites.

  • AWS WAF Fraud Control account takeover prevention (ATP) rule group on the login path, which checks for compromised credentials and suspicious patterns.
  • Rate-based rules per IP and per username.
  • Bot Control and Challenge or CAPTCHA actions for suspicious clients.
  • MFA for users, and Cognito's threat protection features if you use Cognito.
  • Generic error messages, so attackers cannot tell which usernames exist.
  • Alerts when failed logins spike.
Q44. How would you design a central security tooling account? Senior
  • A dedicated security account in a Security OU, separate from the log archive account.
  • Delegated administrator for GuardDuty, Security Hub and Security Hub CSPM, Inspector, Macie, Detective, Firewall Manager, IAM Access Analyzer and Config aggregation.
  • Organisation-wide auto-enable for new accounts.
  • Cross-Region aggregation of findings into one home Region.
  • EventBridge rules to route findings to the ticketing system, chat and auto-remediation.
  • Read-only cross-account roles for investigation, and tightly controlled break-glass roles.
  • SCPs to stop member accounts from disabling these services.
Q45. A developer asks for kms:* on all keys to fix an "AccessDenied" error. How do you handle it? Senior

Do not grant kms:* on *. It would allow decrypting any data and even scheduling key deletion.

Instead:

  • Read the exact error and CloudTrail event: which action (for example kms:Decrypt or kms:GenerateDataKey), which key and which principal.
  • Check the key policy: does it allow this role, or allow IAM policies in the account to grant access?
  • Check the IAM policy, SCPs, VPC endpoint policies and encryption context conditions.
  • Grant only the needed actions on the specific key ARN, ideally with kms:ViaService.

Explain the reason to the developer, so they can debug similar issues next time.

Q46. How do you prepare for a security incident before it happens on AWS? Senior
  • Logging ready: CloudTrail organisation trail, VPC Flow Logs, DNS logs, S3 and load balancer access logs, all in a protected log account with retention.
  • Detection ready: GuardDuty, Security Hub and alerts to an on-call channel.
  • Access ready: pre-created incident response roles with read and forensics permissions, tested regularly.
  • Tools ready: a forensics account, isolation security groups, snapshot and memory capture runbooks.
  • People ready: playbooks for common scenarios (leaked key, compromised instance, public bucket), contact lists, and game days.
  • AWS Support plan level that gives fast response for critical cases.
Q48. How do you secure container images from build to runtime on AWS? Senior
  • Build: use small, trusted base images, pin versions, and build in a pipeline, not on laptops.
  • Scan: Amazon Inspector scans images in ECR on push and continuously for new CVEs. Fail the pipeline on critical findings.
  • Sign: sign images (for example with AWS Signer and Notation) and verify signatures before deploy.
  • Store: private ECR repositories with tag immutability, encryption and lifecycle policies.
  • Run: non-root users, read-only root file systems where possible, least-privilege task roles, and GuardDuty Runtime Monitoring for ECS and EKS.
  • Rebuild regularly so patched base images reach production.
Q49. How do you detect and limit data exfiltration from S3? Senior

Prevent:

  • Bucket policies that allow access only from your VPC endpoints or organisation (aws:SourceVpce, aws:PrincipalOrgID), plus VPC endpoint policies that allow only your own buckets.
  • Least-privilege roles and Block Public Access.

Detect:

  • GuardDuty S3 Protection finds unusual access patterns, such as large downloads from new locations.
  • CloudTrail data events for sensitive buckets, and Macie to know where sensitive data lives.
  • Alarms on unusual data transfer out.

Respond: revoke the principal's sessions, block the source, and check what was read using data events.

Q50. GuardDuty reports crypto-mining activity on an EKS worker node. What do you do? Senior
  • Triage: read the finding. Which node, which pod (Runtime Monitoring gives process and container details), which outbound IPs or domains?
  • Contain: cordon the node so no new pods are placed on it, isolate it with a restrictive security group, and scale the affected workload to zero if it is the source.
  • Preserve evidence: snapshot the node's volumes before termination.
  • Find the entry point: a vulnerable image, an exposed dashboard, stolen kubeconfig, or overly broad RBAC. Check EKS audit logs.
  • Fix and rebuild: patch or replace the image, rotate credentials, replace the nodes.
  • Prevent: admission policies, image scanning and least-privilege pod roles.

5. Frequently asked questions

Which security services should a beginner turn on first?

CloudTrail in all Regions, GuardDuty, IAM Access Analyzer, Security Hub CSPM with a standard such as AWS Foundational Security Best Practices, and billing alarms. Then add Inspector and Macie based on workload.

Is Security Hub the same as Security Hub CSPM?

Not any more. The original service is now called Security Hub CSPM and focuses on posture checks and finding aggregation. The newer Security Hub correlates signals from CSPM, GuardDuty, Inspector and Macie into prioritised exposure findings. AWS recommends turning on both.

Do these services cost a lot?

Most charge by usage, such as events analysed or resources scanned. Use the free trials to estimate cost, and turn them on organisation-wide through a delegated administrator account.

6. Quick revision

  • KMS: key policy first, grants for temporary use, encryption context for extra checks.
  • WAF: test new rules in Count mode, then block.
  • GuardDuty: detects threats. Inspector: finds vulnerabilities. Macie: finds sensitive data.
  • Security Hub CSPM checks configuration against standards.
  • Incident response: contain first, keep evidence, rotate credentials, then fix the root cause.

This page is one part of a 1000-question AWS interview set. Open the full list here: All 1000 AWS interview questions.