Study guide
6.4 Instance Profiles, Service Roles & Execution Roles for Compute
AWS Certified Security – Specialty SCS-C03
Track your progress as you read
Finished sections get a check mark.
1 Chapter 0: Getting Started with the SCS-C03 Exam
0.1 SCS-C03 Exam Format, Domains & Study Strategy
2 Chapter 1: Security Monitoring, Alerting & Threat Detection Services
1.1 Workload Monitoring & Health Check Strategies 1.2 Amazon GuardDuty Architecture & Finding Types 1.3 AWS Security Hub & Automated Conformance Assessment 1.4 Amazon Macie & Automated Data Classification
3 Chapter 2: Enterprise Logging Architecture & Analysis
2.1 Multi-Account CloudTrail & Organization Trails 2.2 Amazon Security Lake & OCSF Log Normalization 2.3 Network Telemetry: VPC Flow Logs & Route 53 Resolver Logs 2.4 Troubleshooting Security Telemetry & Log Ingestion 2.5 Analyzing, Normalizing & Correlating Security Logs
4 Chapter 3: Incident Readiness, Response Planning & Automated Runbooks
3.1 Incident Response Planning & Blast Radius Mitigation 3.2 Testing & Validating Incident Response Plans 3.3 Automated Incident Remediation with EventBridge & Step Functions 3.4 Systems Manager OpsCenter & Incident Manager Runbooks
5 Chapter 4: Digital Forensics, Evidence Preservation & Root Cause Analysis
4.1 Forensic Artifact Capture & Chain of Custody 4.2 Threat Containment & Network Quarantine Techniques 4.3 Correlating Events & Root Cause Analysis with Amazon Detective
6 Chapter 5: Edge Protection, WAF & DDoS Mitigation
5.1 CloudFront Security Headers & Origin Access Control 5.2 AWS WAF Architecture & Advanced Rule Sets 5.3 AWS Shield Advanced & DDoS Defense Architectures 5.4 Edge Integrations: Managed Rule Groups, OCSF Ingestion, IoT Policies & CORS
7 Chapter 6: Compute Workload Hardening, Vulnerability Management & GenAI Security
6.1 Golden AMIs & Container Image Hardening Pipelines 6.2 Amazon Inspector Vulnerability Management & Patch Automation 6.3 Generative AI Security: Amazon Bedrock Guardrails & Model Protection 6.4 Instance Profiles, Service Roles & Execution Roles for Compute 6.5 Secure Administrative Access: Session Manager & EC2 Instance Connect
8 Chapter 7: Network Security, Segmentation, Private Connectivity & Encryption in Transit
7.1 Layered Traffic Filtering: SGs, NACLs & AWS Network Firewall 7.2 Hybrid Connectivity Security: VPN, Direct Connect & MACsec 7.3 Zero-Trust Access & Network Access Analysis 7.4 Enforcing Encryption in Transit: ELB Security Policies, TLS & HTTPS-Only Access 7.5 Private Access: VPC Endpoints, PrivateLink, Client VPN & Verified Access 7.6 Inter-Resource Encryption in Transit: Nitro, EMR, EKS & SageMaker AI
9 Chapter 8: Enterprise Authentication, Federation & Directory Services
8.1 AWS IAM Identity Center & Enterprise IdP Integration 8.2 Amazon Cognito User Pools & Identity Pools 8.3 AWS Security Token Service (STS) & Temporary Credential Workflows 8.4 Troubleshooting Identity & Authentication Failures
10 Chapter 9: Advanced Authorization Architecture & Policy Evaluation
9.1 Complete AWS Policy Evaluation Logic & Decision Flow 9.2 Permission Boundaries & Safe Admin Delegation 9.3 Attribute-Based Access Control (ABAC) with IAM Tags
11 Chapter 10: Least Privilege, Policy Validation & External Access Auditing
10.1 IAM Roles Anywhere & Amazon Verified Permissions 10.2 Auditing External & Unused Access with IAM Access Analyzer 10.3 Analyzing Authorization Failures & Policy Simulation
12 Chapter 11: Cryptographic Services: KMS Architecture & Key Governance
11.1 AWS KMS Architecture, Key Policies & Key Types 11.2 KMS Grants, Encryption Context & Multi-Region Keys 11.3 Imported Key Material (BYOK) & CloudHSM Key Stores
13 Chapter 12: Secrets Management, Sensitive Data Masking & PKI
12.1 AWS Secrets Manager & Systems Manager Parameter Store 12.2 Sensitive Data Masking in Telemetry & Messaging 12.3 AWS Certificate Manager (ACM) & Private CA Architecture
14 Chapter 13: Storage Encryption, Integrity, Lifecycle & Backup Protection
13.1 S3 Encryption Modes & S3 Bucket Keys 13.2 Data Integrity Protection: Object Lock, Vault Lock & Code Signing 13.3 Secure Data Lifecycle, Cross-Account Replication & Backup Vault Lock 13.4 Lifecycle, Backup & Secure Replication Beyond S3: EFS, FSx, DLM, DataSync & Air-Gapped Vaults
15 Chapter 14: Multi-Account Architecture, Organizations & Control Tower Governance
14.1 AWS Organizations Structure, Hierarchy & Resource Control 14.2 AWS Control Tower Landing Zone & Guardrail Framework 14.3 Delegated Administrator Architecture & Root User Governance 14.4 Centralized Resource Sharing with RAM & Service Catalog
16 Chapter 15: Compliance Automation, Infrastructure as Code Security & Auditing
15.1 Infrastructure as Code Security & Multi-Account Deployment 15.2 AWS Config, Conformance Packs & Automated Remediation 15.3 Audit Evidence Collection & Well-Architected Security Reviews
6.4 Instance Profiles, Service Roles & Execution Roles for Compute
Key Takeaways Explain This Topic AI
EC2 instances get role credentials from IMDS through an instance profile; require IMDSv2 to block SSRF-based credential theft.
iam:PassRole, scoped by role ARN and the iam:PassedToService condition, controls who can attach roles to compute services.
In Amazon ECS the task role serves the application, while the task execution role pulls images, writes logs, and retrieves referenced secrets.
EKS Pod Identity roles trust pods.eks.amazonaws.com, work across clusters without trust-policy edits, and add session tags; IRSA trusts each cluster's OIDC provider.
Trust policies for service principals should use aws:SourceArn and aws:SourceAccount to prevent the confused deputy problem.
Last updated: September 2026
6.4 Instance Profiles, Service Roles & Execution Roles for Compute
Every compute workload that calls an AWS API needs credentials. Skill 3.2.2 tests whether you give them the right kind: temporary credentials from an IAM role , delivered by the platform, scoped to that workload, and never embedded in code, AMIs, container images, or environment files. Each compute service delivers role credentials differently, and most exam traps come from mixing them up.
The Roles Each Compute Service Uses
- Compute Service Role Mechanism Trusted Service Principal How Code Gets Credentials
- Amazon EC2 Instance profile containing one IAM role ec2.amazonaws.com Instance Metadata Service (IMDS)
- AWS Lambda Execution role lambda.amazonaws.com Environment variables injected into the runtime
Amazon ECS task Task role (application) and task execution role (agent) ecs-tasks.amazonaws.com Container credentials endpoint for the task role
Amazon EKS pod EKS Pod Identity or IAM roles for service accounts (IRSA) pods.eks.amazonaws.com , or the cluster's OIDC provider Pod Identity Agent, or a projected service account token exchanged with STS
Other services (Glue, Step Functions, SageMaker AI, CodeBuild) Service role The service's principal Assumed by the service on your behalf
EC2 Instance Profiles and IMDS
An instance profile is a container for one IAM role. When it is attached, code on the instance retrieves short-term credentials from the Instance Metadata Service, and the credentials rotate automatically.
Require IMDSv2. IMDSv2 requires a session token obtained with a PUT request (the token lifetime is 1 second to 6 hours) before metadata can be read, which blocks most server-side request forgery (SSRF) attempts to steal role credentials. Set HttpTokens to required on instances and launch templates, and enforce it with an SCP on the ec2:MetadataHttpTokens condition key or a declarative policy for instance metadata defaults.
Control the hop limit. HttpPutResponseHopLimit of 1 stops containers that sit an extra network hop away from reaching IMDS, which forces them to use their own task or pod credentials.
Detect credential theft. GuardDuty reports UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS (and .InsideAWS ) when an instance's role credentials are used from somewhere other than that instance.
Bind credentials to the network. The global condition keys aws:EC2InstanceSourceVPC and aws:EC2InstanceSourcePrivateIPv4 identify where instance credentials were delivered. Comparing aws:EC2InstanceSourceVPC with aws:SourceVpc in an SCP or resource policy lets instance credentials work only from their own VPC.
iam:PassRole: Who Can Hand a Role to a Service
Attaching a role to an EC2 instance, Lambda function, ECS task, or other service requires the caller to have iam:PassRole on that role. If a developer can pass any role, they can launch compute with an administrator role and run code as that role, which is privilege escalation. Restrict iam:PassRole to specific role ARNs or paths and use the iam:PassedToService condition: {
- "Effect": "Allow",
- "Action": "iam:PassRole",
- "Resource": "arn:aws:iam::111122223333:role/app-roles/lambda-*",
- "Condition": {
- "StringEquals": { "iam:PassedToService": "lambda.amazonaws.com" }
- }
- }
- Service Roles, Service-Linked Roles & the Confused Deputy
A service role is a role you create and control that a service assumes to act for you, such as a Glue job role or a Step Functions state machine role.
A service-linked role is predefined by the service, linked to it, and not editable; SCPs don't restrict service-linked roles.
When a service principal assumes your role on behalf of a specific resource, add aws:SourceArn and aws:SourceAccount conditions to the trust policy. This prevents the confused deputy problem, where another customer's resource tricks the service into using your role.
Lambda Execution Roles
The execution role grants the function's permissions. Lambda assumes it and injects the credentials as environment variables ( AWS_ACCESS_KEY_ID , AWS_SECRET_ACCESS_KEY , AWS_SESSION_TOKEN ), so never log the environment. Separate this from the function's resource-based policy , which controls who may invoke the function. The execution role should include only the function's needs; functions attached to a VPC also need permissions to manage network interfaces (for example, the AWSLambdaVPCAccessExecutionRole managed policy).
ECS: Task Role vs Task Execution Role
This distinction appears on the exam often:
The task role is what the application code in the container uses (for example, dynamodb:PutItem ). Credentials come from the container credentials endpoint, not the EC2 instance profile.
The task execution role is used by the ECS agent and Fargate to pull images from Amazon ECR, send container logs to CloudWatch Logs, and retrieve Secrets Manager or Parameter Store values referenced in the task definition.
If an application gets AccessDenied calling DynamoDB, check the task role; if the task fails to start because it can't pull an image or read a secret, check the task execution role.
EKS: Pod Identity and IRSA
Pods should never share the node's instance profile. Two mechanisms give each Kubernetes service account its own role:
Feature EKS Pod Identity IAM Roles for Service Accounts (IRSA)
Setup Create a pod identity association in the EKS API; run the EKS Pod Identity Agent add-on Create an IAM OIDC provider for each cluster
Role trust policy Trusts pods.eks.amazonaws.com for sts:AssumeRole and sts:TagSession Trusts the cluster's OIDC provider, with conditions on sub ( system:serviceaccount:<namespace>:<name> ) and aud
Reuse across clusters Same role works in many clusters without editing the trust policy Trust policy must list each cluster's OIDC provider
ABAC Adds session tags such as cluster name, namespace, and service account No automatic session tags
Separately, EKS access entries map IAM principals to Kubernetes permissions through the EKS API (with access policies such as cluster admin or view), replacing hand-edited aws-auth ConfigMap entries.
Specialty Exam Pitfalls
Long-term keys in user data or images : Access keys baked into AMIs, containers, or user data are exposed to anyone who can read them. Use roles.
IMDSv1 left enabled : SSRF against an application can read instance credentials; require IMDSv2.
Unrestricted iam:PassRole : Lets users launch compute with privileged roles.
Confusing ECS roles : Application permissions belong in the task role, not the task execution role or the container instance's instance profile.
Pods using the node role : Without Pod Identity or IRSA, and with IMDS reachable, every pod inherits the node's permissions.