Based on the SAP-C02 exam guideReport an error
There are two ways production infrastructure collapses. One is an operator accidentally clicking something wrong on the console (Operational Excellence failure), and the other is an attacker exploiting weak credentials, open ports, or excessive permissions (Security failure). Interestingly, both pillars share essentially the same philosophical solution: Replace manual human intervention with code and automation, and make all actions traceable. When you replace operations with code, human error disappears. When you replace security with code, consistency and auditability emerge.
In SAP-C02, Operational Excellence and Security are relentlessly tested with keywords like "minimize operational burden," "people access without SSH," "auto-rotate password every 30 days," "who called the API?" Today we dive deep into the historical roots of GitOps, the precise boundaries of the Shared Responsibility Model, the internal differences of three traceability types (CloudTrail, Config, Logs), and multi-account security delegation.
The five design principles of Operational Excellence summarize to one sentence: "Perform operations as code, make small changes frequently, make them reversible, learn, and automate everything." The first principle, "Perform operations as code," is the starting point for everything.
| Principle | Meaning | AWS Mapping |
|---|---|---|
| Perform operations as code | Codify infrastructure and operational procedures | CloudFormation, CDK, Terraform, SSM Automation |
| Small, frequent, reversible changes | Deploy small and often instead of big, with rollback capability | CodeDeploy (Canary, Blue/Green) |
| Regularly improve operational procedures | Evolve procedures through retrospectives and Game Days | WA Review, Game Day |
| Anticipate failures and learn | Assume failures and conduct post-mortems | FIS, post-mortem culture |
| Automate all operational tasks | Exclude human hands from repetitive work | SSM, EventBridge, Lambda |
💡 Related Theory: The philosophical roots of "perform operations as code" trace back to GitOps, named by Weaveworks in 2017. The core idea is to "treat the Git repository as the single source of truth for the system, and if the actual infrastructure state differs from the Git declaration, automatically reconcile (reconcile) it." This is a shift toward a declarative rather than imperative model for infrastructure — instead of "execute this command," you declare "the final state should be like this," and the system closes the gap. CloudFormation's drift detection and Terraform's plan/apply are all examples of this convergence loop. In exams, when you see "detect and correct manual changes" or "declarative infrastructure," the IaC + drift detection combination is a signal for the correct answer.
🔍 Deeper Dive: The "small, frequent, reversible changes" principle is implemented through deployment strategies. Blue/Green spins up a new environment (Green) entirely and switches traffic at once—on problems, immediately rolls back to Blue (high reversibility, higher cost—both environments run simultaneously). Canary sends only 5-10% of traffic to the new version for observation before gradually expanding (minimize risk exposure). Rolling replaces instances sequentially (lower cost, slower rollback). In SAP exams, "minimize deployment risk + instant rollback" maps to Blue/Green; "validate with a small group first" maps to Canary. CodeDeploy provides all three strategies as a managed service.
| Tool | Core Use | Exam Keywords |
|---|---|---|
| CloudFormation, CDK | Declarative IaC | "Infrastructure as code" |
| Service Catalog | Self-service deployment of approved products only | "No arbitrary infrastructure creation" |
| Systems Manager | Patch, Session, Parameter, Inventory, Automation, OpsCenter | "No SSH," "Auto patch," "Runbook" |
| CloudWatch | Metrics, Logs, Alarms, Dashboard, Synthetics | "Observability," "Synthetic monitoring" |
| X-Ray, ServiceLens, ADOT | Distributed tracing | "Track microservice latency" |
| CodePipeline, CodeDeploy | CI/CD, deployment strategy | "Automated deployment pipeline" |
| Health Dashboard | Service, account health events | "AWS-side outage notification" |
| Chatbot | Slack, Teams operational alerts | "ChatOps" |
Systems Manager (SSM) is the Swiss Army knife of Operational Excellence. The two functions appearing most often in exams are Session Manager (shell access via IAM permissions without opening SSH/RDP ports—all sessions recorded in CloudTrail and S3) and Patch Manager (automatically patch on schedule after defining a patch baseline). Additionally, Automation Document automates incident response by defining multi-step runbooks (start EC2 → patch → validate → restart) in code.
⚠️ Pitfall: Don't confuse SSM's two types of documents. Run Document (Command document) executes a single command on EC2 (e.g., a shell script line). Automation Document orchestrates multiple AWS APIs in sequence—a multi-step workflow (e.g., snapshot → create AMI → replace instance → validate). In exams, "automate a multi-step recovery/operational workflow" is Automation Document; "run a command inside an instance" is Run Document. Mixing them up is a wrong answer.
To understand the Security pillar, you must precisely draw the boundaries of the Shared Responsibility Model. AWS takes responsibility for "of the cloud" (the cloud itself), while customers take responsibility for "in the cloud" (inside the cloud).
[Customer Responsibility — Security IN the cloud]
• Data encryption (at rest, in transit)
• IAM permissions and credential management
• OS and app patching (for EC2)
• Network and firewall configuration (SG, NACL)
• Application security
─────────────────────────────────
[AWS Responsibility — Security OF the cloud]
• Physical data centers and hardware
• Hypervisor and host OS
• Managed service infrastructure operations
• Global network backbone
The key insight is that as abstraction level increases, customer responsibility decreases. EC2 (IaaS) puts OS patching on the customer, but RDS (managed) has AWS patch the DB engine, and Lambda (serverless) has AWS manage the runtime. So "reduce operational and security burden" is the same as "move to more managed services."
💡 Related Theory: The security philosophy of the Shared Responsibility Model has evolved into Zero Trust. Traditional security used a "perimeter" model—trust inside the network boundary, distrust outside. Zero Trust, as defined in NIST SP 800-207, states: "Don't base trust on network location; verify every request each time." In AWS, this is implemented via IAM permission verification, SG segmentation even inside VPC, IMDSv2's token requirement, and mTLS. The 2019 Capital One breach (SSRF led to theft of IAM credentials from EC2 metadata → 100M people's data leaked) was the direct trigger for IMDSv2 becoming mandatory—the metadata endpoint once trusted as inside the perimeter became an attack surface.
📚 Case Study: The 2019 Capital One data breach is a textbook incident in the "customer responsibility" zone of the Shared Responsibility Model. The cause: misconfigured WAF (customer responsibility) allowed SSRF; IAM role with excessive permissions (customer responsibility) was compromised by metadata service v1 (token unnecessary) and read S3 buckets. AWS infrastructure itself (AWS responsibility) was not breached. Lessons: (1) IMDSv2 mandate blocks metadata access without a token, (2) IAM least privilege, (3) limit metadata access paths via VPC Endpoint and SG. After this breach, GuardDuty added credential theft detection patterns, and all new workloads began recommending IMDSv2 as default.
| Domain | Tool | Core Role |
|---|---|---|
| ID | IAM, IAM Identity Center, STS, Cognito | Authentication, Authorization, Temporary Credentials, User Pool |
| Detection | GuardDuty, Macie, Inspector, Security Hub, Detective | Threat Detection, Sensitive Data, Vulnerabilities, Integration, Root Cause |
| Infrastructure Protection | SG, NACL, WAF, Shield, Network Firewall, Firewall Manager | Firewalls, DDoS, L7 Protection, Org-wide Management |
| Data Protection | KMS, CloudHSM, Secrets Manager, ACM | Key Management, HSM, Secrets, Certificates |
| Incident Response | EventBridge, Lambda, SSM Incident Manager, Detective | Auto Isolation, Pager, Runbook, Investigation |
| Compliance | Artifact, Audit Manager, Config | Evidence Documents, Audit Evidence, Rule Evaluation |
Role division among detection tools is exam gold. GuardDuty analyzes VPC Flow Logs, DNS, and CloudTrail with ML to detect threats (abnormal API calls, crypto mining, credential theft). Macie auto-classifies sensitive data (PII, credit cards) in S3. Inspector scans EC2, ECR, Lambda for software vulnerabilities (CVE). Security Hub aggregates all results in standard format and scores them. Detective visualizes the root cause of detected threats as a graph.
🔍 Deeper Dive: Secrets Manager automatic rotation must be distinguished from Parameter Store in exams. Secrets Manager not only stores secrets but automatically invokes a rotation Lambda on a schedule to rotate passwords for RDS, Redshift, DocumentDB without downtime (four steps: createSecret → setSecret → testSecret → finishSecret). Applications always query the "current version (AWSCURRENT)," so replacement happens seamlessly. SSM Parameter Store (SecureString) encrypts secrets with KMS but does not natively support automatic rotation. In exams, "auto-rotate DB password every 30 days + no downtime" is the direct answer: Secrets Manager.
SAP exam security scenarios almost always assume a multi-account Organization. The core pattern is Delegated Administrator—delegate security tools (GuardDuty, Security Hub, Macie, Config) not to the management account but to a dedicated Security account, from which you view the aggregated detection results for the entire Org.
[Organizations Management Account]
│ (delegate)
▼
[Dedicated Security Account — Delegated Admin]
├── GuardDuty (aggregate threats from all accounts)
├── Security Hub (aggregate scores/integration across all accounts)
├── Macie (aggregate sensitive data in S3 from all accounts)
└── EventBridge → Lambda (auto-isolate and respond)
🎯 Scenario: "An Organization runs 50 accounts. Whenever a threat is detected in any account, the central security team must be immediately notified, and resources must be auto-isolated. What's the pro design?" — Answer: Set GuardDuty and Security Hub as delegated admins in a dedicated Security account → centrally aggregate detection results from all accounts → EventBridge rules receive threat events and auto-isolate via Lambda/SSM Automation (replace SG, isolate instance). Having each account separately manage security tools (distributed) creates blind spots and operational burden. "Central aggregation + auto response" is the hallmark of pro answers.
🔍 Deeper Dive: Another axis of multi-account security is SCP (Service Control Policy). SCP sets an organization-level "hard ceiling that no IAM in that account can exceed, regardless of what it permits"—a preventive control. In contrast, Config and GuardDuty are detective controls that flag violations after the fact. Their role division is exam gold: if you must prevent before it happens (like "ban a specific region," "block root user actions"), SCP is the answer; if "flag violations and auto-remediate," it's Config Rule + auto remediation. The strongest design combines SCP to set broad boundaries (prevent) with Config and GuardDuty to monitor the rest (detect).
⚠️ Pitfall: You must precisely distinguish the three traceability types. CloudTrail records "who called which API and when" (action audit), Config tracks "how a resource's configuration changed + compliance evaluation" (state and compliance), CloudWatch Logs captures "what the application and system logged." In exams, "which API an IAM user called" is CloudTrail, not Config—Config doesn't record API calls themselves but tracks resource configuration changes. Conversely, "how did a security group change state and is it a compliance violation?" is perfect for Config.
Operational Excellence and Security share a common philosophy: "replace manual with code and automation, make all actions traceable." Operational Excellence is implemented through GitOps, declarative IaC, deployment strategies (Blue/Green, Canary), and Systems Manager (Session, Patch, Automation). Security evolves from the Shared Responsibility Model to Zero Trust, implementing detection (GuardDuty, Macie, Inspector, Security Hub, Detective), data protection (KMS, Secrets Manager), and incident response (EventBridge, Incident Manager) via multi-account delegated admins.
SAP exam frequent mappings: (1) "Access via IAM without SSH/RDP + session logging" → SSM Session Manager, (2) "Auto-rotate DB password every 30 days + no downtime" → Secrets Manager rotation (not Parameter Store), (3) "Automate multi-step operational workflow" → SSM Automation Document (not Run Document), (4) "Who called the API?" → CloudTrail, (5) "Resource config change and compliance" → Config, (6) "Ban arbitrary infrastructure creation + self-service" → Service Catalog, (7) "Org-wide threat aggregation + auto-isolate" → GuardDuty/Security Hub delegated admin + EventBridge + Lambda, (8) "Instant rollback on deployment" → Blue/Green. Next day dives into Reliability and Performance Efficiency through distributed systems theory.
Click a choice to reveal the answer and explanation.
Question 1
A company's administrators need to connect to production EC2 instances for debugging, but the company does not want to open the SSH port (22) to the internet or operate a Bastion host. In addition, all connection sessions must be kept in audit logs. What is the most appropriate solution?
Question 2
An application uses RDS, and the security policy requires the DB password to be rotated automatically every 30 days without any application downtime. What is the most appropriate solution?
Question 3
An operations team wants to build a runbook that automatically executes multiple steps without human intervention when a failure occurs: "create an EBS snapshot → build an AMI → replace with a new instance → verify health." Which Systems Manager capability is appropriate?
Question 4
Which is the most accurate description of the root cause of the 2019 Capital One data breach and AWS's response?
Question 5
An Organization operates 50 accounts. The central security team wants to view threat detection (GuardDuty) and security scores (Security Hub) for all accounts in one place and to isolate resources automatically when a threat occurs. What is the most appropriate design?
Question 6
A company wants to minimize risk when deploying a new application version and to roll back the entire deployment to the previous version immediately if a problem is found. It can afford the cost of running both environments at the same time. What is the most appropriate deployment strategy?