AWS AI Practitioner - AWS Security Services
IAM -- Identity and Access Management
IAM is a global AWS service that controls who can do what inside your AWS account. It is foundational to all AWS security and is used extensively in AI/ML workloads to grant services like Bedrock and SageMaker the permissions they need.
Core Components
Users
- Definition
- An IAM user represents one individual in your organization. Each user has their own credentials for console access or programmatic access.
- Root User
- Created automatically when the account is set up. Should only be used for initial setup -- never for day-to-day work, never shared.
- Best Practice
- Create individual IAM users for each person. Do not use the root account.
Groups
Definition: A named collection of IAM users. Permissions attached to the group are inherited by all users in it.
Rules:
- Groups can only contain users -- NOT other groups
- A user can belong to multiple groups
- A user can also have no group (not best practice, but allowed)
Developers group (Alice, Bob, Charles) inherits a developer permissions policy. Operations group (David, Edward) inherits a separate policy.
Policies
Definition: A JSON document that defines what actions are allowed or denied on which resources. Attached to users, groups, or roles.
Policy Structure
Version: Policy language version -- always '2012-10-17'
Id: Optional identifier for the policy
Statement: One or more permission statements -- the core of the policy
Statement Fields
- Sid
- Optional statement identifier
- Effect
- 'Allow' or 'Deny' -- whether to grant or block the listed actions
- Principal
- Which account, user, or role the policy applies to
- Action
- The list of API calls being allowed or denied (e.g., 'iam:ListUsers')
- Resource
- Which resources the actions apply to -- use '*' for all
- Condition
- Optional conditions under which the statement applies
Example: Effect: Allow | Action: * | Resource: * -> This is AdministratorAccess -- allows everything on everything.
Inline Policy: A policy attached directly to one specific user -- not shared with groups. Useful for unique permissions.
Core AWS principle: grant only the minimum permissions a user needs to do their job. Never give more access than required.
Roles
An IAM role is like a user, but designed to be assumed by AWS services -- not by people. Roles give AWS services permissions to act on your behalf.
When an AWS service (EC2, Lambda, Bedrock, SageMaker) needs to call other AWS services, it must be assigned an IAM role with the correct permissions.
Common Roles:
- EC2 Instance Role -- allows an EC2 server to call AWS APIs
- Lambda Execution Role -- allows a Lambda function to write logs and access other services
- SageMaker Execution Role -- allows SageMaker jobs to read from S3, write to CloudWatch, etc.
- Bedrock Service Role -- allows Bedrock agents and customization jobs to access S3 and KMS
You define the role, attach a permissions policy to it, and assign it to the AWS service. The service inherits all permissions from that role.
Iam And Ai
- Bedrock
- IAM roles and policies control which users and services can invoke Bedrock models, access knowledge bases, create custom models, and invoke guardrails.
- Sagemaker
- SageMaker Role Manager uses IAM under the hood to define permissions for personas like data scientists and MLOps engineers.
- Principle
- IAM roles are always the mechanism used to give one AWS service permission to access another.
Key Terms
| Term | Definition |
|---|---|
| IAM (Identity and Access Management) | A global AWS service for creating users, groups, roles, and policies that control who can do what within your AWS account. |
| IAM User | A long-term identity representing a person or application, with its own credentials. Should not be the root user. |
| IAM Group | A named set of IAM users. Policies attached to a group are inherited by all members. Groups cannot contain other groups. |
| IAM Policy | A JSON document defining allowed or denied actions on specified resources. Attached to users, groups, or roles to grant permissions. |
| IAM Role | A set of permissions intended to be assumed by an AWS service (not a person). Used to grant services like EC2, Lambda, SageMaker, or Bedrock the ability to call other AWS APIs. |
| Least Privilege Principle | A security best practice: grant only the minimum permissions required for a user or service to perform its function -- nothing more. |
| Root User | The initial AWS account owner -- has unrestricted access to everything. Should only be used for account setup. Never use it for daily operations. |
| Inline Policy | A policy embedded directly into a single user, group, or role -- not reusable. Used for unique, one-off permissions. |
- IAM is GLOBAL -- there are no region selections. Users and roles are available everywhere.
- Groups = users only. No nesting groups inside groups.
- IAM Role = for AWS SERVICES, not people. EC2, Lambda, SageMaker, Bedrock all use roles.
- Policy structure: Effect (Allow/Deny) + Action (API calls) + Resource (what it applies to). Memorize these three.
- Least privilege = minimum access. This is the core security design principle in AWS.
- When Bedrock needs S3 access -- create an IAM role with the right S3 and KMS permissions and assign it to the Bedrock job.
- Root account: never share it, only use for initial setup.
Practice Questions
Q1. A SageMaker training job needs to read training data from an encrypted S3 bucket. The bucket uses AWS KMS for encryption. Which combination of IAM permissions must the SageMaker execution role include?
- S3 read permission only -- KMS access is automatically inherited
- S3 read permission AND KMS decrypt permission -- both are needed to access encrypted data
- KMS decrypt permission only -- S3 access is implicit when KMS is permitted
- No IAM role is needed -- SageMaker accesses S3 by default
Answer: B
To access an encrypted S3 object, the SageMaker execution role needs: (1) S3 permission to read the object, and (2) KMS decrypt permission to unlock the encryption. Without both, the job will fail. IAM roles are always required to authorize cross-service access in AWS.
Q2. A company has 50 data scientists who all need the same read-only access to Amazon SageMaker. What is the most efficient and maintainable IAM approach?
- Attach an inline policy with read-only access directly to each of the 50 users
- Create a DataScientists IAM group, attach the read-only policy to the group, and add all 50 users to the group
- Create 50 IAM roles and assign one to each user
- Give all 50 users the root account credentials for efficiency
Answer: B
Creating a group with the correct policy and adding users to it is the most scalable approach. All 50 users inherit the group permissions automatically. If permissions change, updating the group policy updates all members simultaneously -- no need to modify 50 individual users.
Q3. An Amazon Bedrock knowledge base needs to access documents stored in an S3 bucket and use an AWS KMS key for encryption. How should permissions be configured?
- Create an IAM user with S3 and KMS permissions and embed the credentials in the Bedrock configuration
- Create an IAM role with S3 read and KMS decrypt permissions and assign it to the Bedrock knowledge base
- Make the S3 bucket public so Bedrock can access it without credentials
- Use the AWS root account credentials for the Bedrock knowledge base
Answer: B
IAM roles are the correct mechanism for granting AWS services permissions to access other AWS resources. The role should include both S3 read permission for the bucket contents and KMS decrypt permission to access encrypted data. Never embed credentials or use root accounts for service access.
Q4. A Lambda function needs to invoke Amazon Bedrock foundation models and log results to CloudWatch. What is the correct IAM configuration?
- Create a Lambda execution role with Bedrock invoke permissions and CloudWatch Logs write permissions
- Attach an inline policy to the Lambda function code with the required permissions
- Use the default Lambda permissions which include all AWS service access
- Create an IAM user for the Lambda function with Bedrock and CloudWatch access
Answer: A
Lambda functions require an execution role that defines which AWS services the function can access. The role should include permissions to invoke Bedrock models and write to CloudWatch Logs. IAM roles (not users) are always used for service-to-service permissions.
Q5. Which IAM security principle states that users and services should only be granted the minimum permissions necessary to perform their tasks?
- Role-based access control
- Least privilege principle
- Defense in depth
- Zero trust architecture
Answer: B
The least privilege principle is a core AWS security best practice stating that users, groups, and roles should be granted only the minimum permissions required to accomplish their specific tasks. This minimizes the potential impact of compromised credentials or accidental misuse.
Amazon EC2 and AWS Lambda
EC2 and Lambda are the two main compute services in AWS. In the AI/ML context, EC2 provides dedicated compute for training and inference, while Lambda enables serverless automation and event-driven integrations.
Ec2
Full Name: Elastic Compute Cloud
Key Options:
- Operating System: Linux (most common), Windows, macOS
- CPU and RAM: Choose instance type (e.g., t2.micro for free tier, p3/p4 for GPU-heavy ML training)
- Storage: EBS (network-attached), instance store (hardware-attached)
- Security Group: Firewall rules controlling inbound and outbound traffic
- Key Pair: SSH credentials for logging into the instance
- User Data: Bootstrap script that runs once on first launch
Public Vs Private Ip
- Public Ip
- Changes every time the instance is stopped and restarted
- Private Ip
- Stays the same throughout the instance's life
- Implication
- Don't hardcode the public IP -- use DNS or Elastic IPs for stable addressing
Instance States:
- Pending -> starting up
- Running -> active and billable
- Stopping -> shutting down
- Stopped -> not running, not billed for compute (EBS still charges)
- Terminated -> permanently deleted
A shell script passed at launch time that auto-installs software or configures the instance. Runs only once -- on the first boot. Runs as root (sudo rights included).
Used for training large ML models, hosting self-managed inference endpoints, and running GPU-intensive workloads using P3/P4/P5 (training) or G4/G5/G6 (inference) instance families.
Lambda
Key Characteristics:
- No servers to manage -- AWS handles all infrastructure
- Runs on demand -- only executes when triggered by an event
- Scales automatically -- from one invocation to thousands simultaneously
- Billed per call and per duration -- not for idle time
Pricing
- Free Monthly Tier
- 1 million invocations and 400,000 GB-seconds of compute
- Per Call
- $0.20 per 1 million requests after free tier
- Per Duration
- $1.00 per 600,000 GB-seconds after free tier
- Key Fact
- Lambda is cheap -- pricing is based on CALLS and DURATION
Supported Languages:
- Node.js / JavaScript
- Python
- Java
- C# (.NET)
- Ruby
- Go / Rust (via Custom Runtime API)
Common Use Cases:
- Serverless thumbnail generation: S3 upload triggers Lambda -> resize image -> write back to S3
- Serverless CRON jobs: EventBridge triggers Lambda on a schedule (hourly, daily, etc.)
- AI pipeline automation: S3 data arrival triggers Lambda -> calls Bedrock or SageMaker API
- Post-processing model outputs: Lambda reacts to inference results and routes them downstream
Lambda is reactive -- it waits for events (S3 uploads, API Gateway calls, EventBridge schedules, SQS messages) and responds. It does NOT run continuously.
Vs Ec2
- Use Ec2
- Long-running workloads, full OS control, GPU-intensive training, persistent servers
- Use Lambda
- Short-lived tasks, event-driven automation, variable or unpredictable traffic, no server management
Key Terms
| Term | Definition |
|---|---|
| Amazon EC2 (Elastic Compute Cloud) | A service for renting virtual servers (instances) in the cloud with configurable CPU, RAM, storage, OS, and networking. The foundation of IaaS on AWS. |
| EC2 User Data | A shell script passed at instance launch that runs once on the first boot to automatically install software, configure the server, or download files. |
| Security Group | A virtual firewall for an EC2 instance that defines inbound and outbound traffic rules. Controls which ports and IPs can communicate with the instance. |
| AWS Lambda | A serverless compute service that runs code in response to events without requiring server management. Billed per invocation and per millisecond of execution time. |
| Event-Driven (Lambda) | Lambda executes only when triggered by an event (S3 upload, HTTP request, schedule, message queue). It does not run continuously between events. |
| Lambda Execution Role | An IAM role assigned to a Lambda function that defines which AWS services the function can access (e.g., write to S3, log to CloudWatch, invoke Bedrock). |
- Lambda pricing = CALLS + DURATION. Free tier = 1M calls/month + 400K GB-seconds.
- Lambda is event-driven and serverless. EC2 is always-on (when running) and server-based.
- EC2 public IP changes on restart. Private IP stays the same.
- User Data = bootstrap script. Runs ONCE on first launch only.
- EC2 GPU instances for AI: P3/P4/P5 = training. G4/G5/G6 = inference.
- Lambda use case in AI: automation, event-driven pipeline steps, lightweight post-processing.
- Both EC2 and Lambda use IAM roles -- never embed credentials in the code.
Practice Questions
Q1. A team wants to automatically process images uploaded to an S3 bucket -- running them through an Amazon Rekognition API call and writing results to DynamoDB -- without managing any servers. Which compute service is MOST appropriate?
- Amazon EC2 -- to host a continuously running image processing server
- AWS Lambda -- to trigger automatically on S3 uploads and run the processing logic serverlessly
- Amazon SageMaker -- to deploy the image processing as a hosted endpoint
- AWS Fargate -- to containerize the image processing workflow
Answer: B
AWS Lambda is ideal for this event-driven, serverless pattern. An S3 event trigger fires the Lambda function for each image upload, the function calls Rekognition and writes to DynamoDB, and Lambda scales automatically with no server management required.
Q2. A company needs to train a large deep learning model that requires multiple GPUs and will run for several days. Which compute option is MOST appropriate?
- AWS Lambda with maximum memory allocation
- Amazon EC2 P4d instances with multiple GPUs
- AWS Fargate containers
- Amazon Lightsail virtual servers
Answer: B
EC2 P4d instances provide multiple high-performance GPUs designed for intensive ML training workloads. Lambda has a 15-minute timeout making it unsuitable for long-running training, and Fargate/Lightsail don't offer GPU instances optimized for deep learning.
Q3. An ML engineer wants to automate a daily job that invokes Amazon Bedrock to summarize news articles and stores results in S3. The job runs for about 2 minutes each day. What is the MOST cost-effective compute solution?
- An always-running EC2 instance that executes the job on a cron schedule
- An AWS Lambda function triggered by Amazon EventBridge on a daily schedule
- A SageMaker Processing job scheduled via Step Functions
- An ECS Fargate task running continuously
Answer: B
Lambda is ideal for short-duration scheduled tasks. The function only runs (and incurs charges) for the 2 minutes it executes each day. EventBridge provides cron-like scheduling capability. Running EC2 or Fargate continuously would cost significantly more for a task that only runs 2 minutes daily.
Q4. Which EC2 instance families are optimized for ML inference workloads?
- T3 and T4 instances for burstable performance
- P3, P4, and P5 instances for training GPUs
- G4, G5, and G6 instances for graphics and inference GPUs
- M5 and M6 instances for general purpose computing
Answer: C
G4, G5, and G6 instances are optimized for graphics-intensive applications and ML inference workloads. They provide cost-effective GPU compute ideal for deploying trained models. P-series instances (P3, P4, P5) are designed for training with more powerful but more expensive GPUs.
Q5. What happens to an EC2 instance's public IP address when the instance is stopped and restarted?
- The public IP remains the same
- The public IP changes to a new address
- The public IP is permanently released and cannot be reassigned
- The instance cannot be restarted without assigning a new IP manually
Answer: B
EC2 public IP addresses change each time an instance is stopped and restarted. Only the private IP remains constant throughout the instance's lifecycle. To maintain a consistent public IP, you must use an Elastic IP address.
Amazon S3 -- Storage Classes and Security
Amazon S3 is the primary object storage service in AWS and a foundational component of AI/ML workflows -- used for training data, model artifacts, pipeline inputs/outputs, and archiving.
Core Concepts For Ai
- Buckets
- Top-level containers for objects. Names must be globally unique across all AWS accounts and regions. Buckets are region-specific despite appearing in a global UI.
- Objects
- Files stored in S3. Each has a key (its full path), a value (the file content), metadata, and optionally a version ID.
- Key
- The full path of an object: 'my-folder/subfolder/file.jpg'. S3 has no real directories -- the folder structure is simulated by key naming conventions.
- Max Size
- 5 TB per object. Files larger than 5 GB must use multi-part upload.
- Pre Signed Url
- A time-limited URL that embeds your credentials, allowing temporary access to a private S3 object without making it publicly accessible.
Storage Classes
Classes
S3 Standard
Availability: 99.99%
Access: Frequent
Retrieval: Instant (milliseconds)
Use Case: Active training datasets, frequently accessed model artifacts, real-time data lakes
Cost: Highest storage cost, no retrieval fee
S3 Standard-IA (Infrequent Access)
Availability: 99.9%
Access: Infrequent but rapid when needed
Retrieval: Instant (milliseconds)
Use Case: Disaster recovery backups, older training datasets still needed quickly
Cost: Lower storage cost, retrieval fee applies
S3 One Zone-IA
Availability: 99.5%
Access: Infrequent
Retrieval: Instant (milliseconds)
Use Case: Secondary backups or easily recreatable data -- stored in ONE AZ only
Cost: Lowest IA storage cost, retrieval fee, data lost if AZ is destroyed
Warning: Data is lost if the Availability Zone is destroyed
S3 Glacier Instant Retrieval
Availability: 99.9%
Access: Rare (quarterly)
Retrieval: Milliseconds
Minimum Storage: 90 days
Use Case: Archived data needing instant access when requested
Cost: Very low storage, retrieval fee
S3 Glacier Flexible Retrieval
Availability: 99.99%
Access: Rare
Retrieval: Expedited: 1-5 min | Standard: 3-5 hrs | Bulk: 5-12 hrs (free)
Minimum Storage: 90 days
Use Case: Long-term archival where you can wait hours for access
Cost: Very low storage, retrieval fee
S3 Glacier Deep Archive
Availability: 99.99%
Access: Extremely rare
Retrieval: Standard: 12 hrs | Bulk: 48 hrs
Minimum Storage: 180 days
Use Case: Regulatory archival, compliance data, historical records rarely accessed
Cost: Lowest storage cost on S3, retrieval fee
S3 Intelligent-Tiering
Availability: 99.9%
Access: Unknown or variable
Retrieval: Instant for frequent/infrequent tiers; hours for archive tiers
Use Case: When you don't know or can't predict access patterns -- S3 automatically moves objects to the right tier
Cost: Small monthly monitoring and auto-tiering fee, no retrieval charges
Tiers:
- Frequent Access (default)
- Infrequent Access (30+ days)
- Archive Instant Access (90+ days)
- Archive Access (90-700+ days, optional)
- Deep Archive Access (180-700+ days, optional)
Configure automatic transitions between storage classes based on object age -- e.g., move to Standard-IA after 30 days, Glacier Flexible after 180 days. This automates cost optimization.
S3Security
- Block Public Access
- Default setting -- blocks all public access. Recommended for maximum security.
- Encryption
- Server-side encryption with S3-managed keys (SSE-S3) or KMS-managed keys (SSE-KMS). SSE-KMS requires the accessing IAM role to also have KMS decrypt permission.
- Pre Signed Url
- Grants temporary, credential-signed access to a private object without making it public.
- Vpc Endpoint
- Use an S3 Gateway VPC Endpoint to access S3 privately from within a VPC without internet traffic.
Key Terms
| Term | Definition |
|---|---|
| Amazon S3 (Simple Storage Service) | AWS's infinitely scalable object storage service. Used for storing training data, model artifacts, pipeline I/O, and archives. Globally unique bucket names, regionally deployed. |
| S3 Storage Class | A storage tier with defined availability, cost, and retrieval characteristics. Choose based on how often data is accessed and how quickly it needs to be retrieved. |
| S3 Glacier | A family of three cold storage classes (Instant, Flexible, Deep Archive) designed for long-term archival at very low cost, with retrieval times ranging from milliseconds to 48 hours. |
| S3 Intelligent-Tiering | A storage class that automatically moves objects between access tiers based on usage patterns, with no retrieval fees. Ideal when access frequency is unknown or variable. |
| S3 Lifecycle Rule | An automated policy that transitions objects between storage classes or deletes them based on their age -- enabling hands-free cost optimization. |
| Pre-Signed URL | A time-limited S3 URL that includes embedded credentials, granting temporary access to a private object without modifying the object's permissions. |
| SSE-KMS (S3 Encryption) | Server-side encryption using a KMS-managed key. Accessing IAM roles must have both S3 read permission AND KMS decrypt permission to retrieve the data. |
- S3 storage class selection: Frequent access -> Standard. Infrequent but fast -> Standard-IA. Archive milliseconds -> Glacier Instant. Archive hours -> Glacier Flexible. Archive 12-48hrs -> Deep Archive. Unknown pattern -> Intelligent-Tiering.
- One Zone-IA = single AZ only. Data IS LOST if the AZ is destroyed -- only use for recreatable data.
- Intelligent-Tiering = NO retrieval fees. Small monitoring fee instead.
- S3 buckets are region-specific even though the UI looks global.
- SSE-KMS encryption: accessing IAM role needs BOTH S3 + KMS decrypt permissions.
- Lifecycle rules automate class transitions -- no manual management needed.
- Pre-signed URL = temporary access without making the object public.
Practice Questions
Q1. A company stores ML training datasets in S3 Standard. After model training completes, datasets are accessed about once per quarter for retraining. After 2 years, they need to be retained for regulatory compliance but will almost never be accessed. Which storage transition strategy is MOST cost-effective?
- Keep everything in S3 Standard -- simplicity outweighs cost savings
- Move to S3 Standard-IA after 30 days, then to S3 Glacier Deep Archive after 2 years
- Move immediately to S3 One Zone-IA -- regulatory archives don't need multi-AZ redundancy
- Use S3 Intelligent-Tiering and let AWS handle all transitions automatically
Answer: B
After training completes, the quarterly access pattern suits Standard-IA (lower cost, instant retrieval, retrieval fee acceptable for infrequent use). After 2 years of near-zero access, Glacier Deep Archive provides the lowest possible storage cost for compliance retention. A lifecycle rule can automate both transitions.
Q2. A SageMaker training job in a private VPC subnet needs to access training data in an S3 bucket. The company's security policy prohibits any internet traffic. How should this be configured?
- Add a NAT Gateway to allow internet access for S3 calls
- Move the training job to a public subnet with direct internet access
- Create an S3 Gateway VPC Endpoint to access S3 privately within AWS network
- Make the S3 bucket public so no authentication is required
Answer: C
An S3 Gateway VPC Endpoint allows resources in private subnets to access S3 directly through AWS's private network without requiring internet access. This meets the security requirement of no internet traffic while enabling the training job to read data from S3.
Q3. A company needs to store model artifacts that may be accessed frequently during the first month after training, but access patterns become unpredictable after that. Which S3 storage class is MOST appropriate?
- S3 Standard for the first month, then manual transition to Glacier
- S3 Intelligent-Tiering to automatically optimize based on actual access patterns
- S3 One Zone-IA for cost savings
- S3 Glacier Instant Retrieval from the start
Answer: B
S3 Intelligent-Tiering is designed for data with unknown or changing access patterns. It automatically moves objects between frequent and infrequent access tiers based on usage, with no retrieval fees. This eliminates the need to predict access patterns or manually manage transitions.
Q4. An S3 bucket uses SSE-KMS encryption. A Bedrock knowledge base needs to read documents from this bucket. What permissions must the Bedrock service role include?
- Only S3:GetObject permission for the bucket
- S3:GetObject for the bucket AND kms:Decrypt for the KMS key
- Only kms:Decrypt permission for the KMS key
- S3:* and KMS:* wildcard permissions
Answer: B
When accessing SSE-KMS encrypted S3 objects, the accessing role needs both S3 read permission to retrieve the object AND KMS decrypt permission to decrypt the data. Without both permissions, the access will fail.
Q5. What is the maximum size for a single object stored in Amazon S3?
- 5 GB
- 5 TB
- 50 TB
- Unlimited
Answer: B
The maximum size for a single S3 object is 5 TB. However, files larger than 5 GB must use multi-part upload to transfer the data in smaller chunks that are reassembled in S3.
Amazon Macie
Amazon Macie is a fully managed data security and privacy service that uses machine learning to automatically discover and alert on sensitive data stored in Amazon S3 -- particularly PII.
How It Works
- Specify the S3 buckets you want Macie to analyze
- Macie scans object contents and metadata using ML pattern matching
- When sensitive data (PII) is detected, Macie generates a finding
- Findings are sent to Amazon EventBridge
- EventBridge can trigger downstream actions: SNS notifications, Lambda functions, security workflows
PII -- personally identifiable information: names, addresses, social security numbers, credit card numbers, driver's license numbers, passport numbers, and other regulated data types.
Critical pre-training step: before using a dataset to train a GenAI or ML model, run Macie to ensure no PII is present in the training data. Prevents the model from inadvertently learning and reproducing sensitive personal information.
Deployment: One-click enablement from the AWS console. No infrastructure to manage.
Scope: S3 only -- Macie analyzes data in S3 buckets. It does not scan databases, EC2 storage, or other services directly.
Key Terms
| Term | Definition |
|---|---|
| Amazon Macie | A fully managed ML-powered service that scans S3 buckets to discover, classify, and alert on sensitive data -- primarily PII. Results are sent to EventBridge for automated response. |
| PII (Personally Identifiable Information) | Data that can identify a specific individual -- names, SSNs, credit card numbers, addresses, etc. Macie's primary detection target. Relevant for GDPR, HIPAA, and other privacy regulations. |
- Macie = S3 PII detection. That's its only job -- don't confuse it with Comprehend's PII detection (which works on text input, not S3 files).
- Macie -> EventBridge -> SNS/Lambda. The detection-notification-action flow.
- Use Macie BEFORE training an ML model to ensure training data doesn't contain PII.
- One-click setup. Fully managed. S3 only.
Practice Questions
Q1. A healthcare company stores patient records in an S3 bucket that will be used as training data for a clinical AI model. Before training begins, they want to verify no PHI or PII is present in the dataset. Which AWS service should they use?
- Amazon Comprehend Medical -- to extract medical entities from the text
- Amazon Macie -- to automatically scan the S3 bucket and detect any PII in the stored data
- AWS Config -- to audit the S3 bucket configuration for public access
- Amazon Inspector -- to scan for software vulnerabilities in the data pipeline
Answer: B
Amazon Macie is specifically designed to scan S3 buckets and automatically detect PII using machine learning. It will flag any sensitive data in the healthcare records before they are used for training, helping the company avoid training a model on PII and maintain compliance.
Q2. A data science team wants to be automatically notified via email whenever Amazon Macie detects PII in their ML training data buckets. Which service integration enables this notification workflow?
- Macie sends findings to AWS CloudTrail which triggers email notifications
- Macie sends findings to Amazon EventBridge which can trigger SNS to send emails
- Macie sends findings directly to Amazon SES for email delivery
- Macie has built-in email notification that requires no additional configuration
Answer: B
Macie findings are sent to Amazon EventBridge, which can be configured with rules to trigger downstream actions. An EventBridge rule can invoke SNS to send email notifications, Lambda functions for automated remediation, or other AWS services for custom workflows.
Q3. What types of sensitive data does Amazon Macie primarily detect?
- Software vulnerabilities and security misconfigurations
- PII such as names, social security numbers, credit card numbers, and addresses
- Malware and viruses in uploaded files
- Network intrusion attempts and suspicious traffic patterns
Answer: B
Amazon Macie uses machine learning to detect personally identifiable information (PII) in S3 buckets. This includes names, addresses, social security numbers, credit card numbers, passport numbers, and other regulated data types relevant to GDPR, HIPAA, and privacy compliance.
Q4. Which AWS storage services does Amazon Macie scan for sensitive data?
- Amazon S3, Amazon EBS, and Amazon RDS
- Amazon S3 only
- Amazon S3 and Amazon EFS
- All AWS storage services
Answer: B
Amazon Macie exclusively scans Amazon S3 buckets for sensitive data. It does not scan EBS volumes, RDS databases, EFS file systems, or other storage services. For PII detection in other contexts, you would need different solutions.
Q5. A GenAI application collects user-submitted documents and stores them in S3 before processing with Bedrock. The company wants to ensure no PII enters their AI pipeline. What is the recommended approach?
- Trust users to not submit PII and proceed with processing
- Configure Amazon Macie to scan the S3 bucket and trigger alerts when PII is detected before Bedrock processing
- Use Amazon Inspector to scan the documents for sensitive content
- Enable S3 encryption which automatically removes PII from documents
Answer: B
Amazon Macie should be configured to scan the S3 bucket containing user-submitted documents. When PII is detected, findings trigger EventBridge events that can pause processing, alert security teams, or invoke Lambda for automated remediation before the data enters the AI pipeline.
AWS Config
AWS Config continuously records the configuration of your AWS resources and evaluates them against compliance rules. It answers the question: 'Has anything changed, and is it still compliant?'
What It Does
- Records the configuration state of all your AWS resources over time
- Stores configuration history in an S3 bucket
- Evaluates resources against Config Rules (compliance checks)
- Sends alerts via SNS when configurations change
- Integrates with CloudTrail to show WHO made a configuration change
Config Rules
Examples:
- restricted-ssh: Flags security groups with unrestricted SSH access (port 22 open to 0.0.0.0/0)
- s3-bucket-logging-enabled: Flags S3 buckets without access logging
- s3-account-level-public-access-blocks: Checks if public access blocking is enabled
- rds-instance-public-access-check: Flags publicly accessible RDS instances
View how a resource's compliance status has changed over time -- was it noncompliant, then fixed, then became noncompliant again?
Scope: Per-region service, but you can aggregate Config data from all regions and accounts into a central dashboard.
Cost: Config is NOT free -- charges apply per configuration item recorded and per rule evaluation.
Config detects a security group with open SSH -> marks it noncompliant -> you see the alert -> fix the security group -> re-evaluate the rule -> resource becomes compliant again
Ai Relevance: Track configuration changes to Bedrock knowledge bases, SageMaker endpoints, and ML infrastructure over time for audit and compliance purposes.
Key Terms
| Term | Definition |
|---|---|
| AWS Config | A service that continuously records AWS resource configurations and evaluates them against compliance rules. Provides a history of configuration changes and compliance status over time. |
| Config Rule | A compliance policy in AWS Config that defines what a properly configured resource looks like. Resources are evaluated against rules and marked compliant or noncompliant. |
| Configuration Timeline | AWS Config's history view showing how a specific resource's configuration changed over time -- useful for audits and root cause analysis. |
- Config = CONFIGURATION changes + COMPLIANCE over time. 'Has this resource changed? Is it compliant?' -> Config.
- Config is NOT free. Be careful enabling it in practice.
- Config + CloudTrail together: Config tells you WHAT changed; CloudTrail tells you WHO changed it.
- Common Config rules: restricted-ssh (no open SSH), s3-bucket-public-access, rds-public-access.
- Config is per-region, but supports multi-region/multi-account aggregation.
Practice Questions
Q1. A security team wants to automatically detect whenever any security group in their AWS account is modified to allow unrestricted inbound SSH access (port 22 open to all IPs). Which service provides this capability?
- AWS CloudTrail -- to log who modified the security group
- AWS Config with the 'restricted-ssh' rule -- to continuously evaluate security group compliance and flag violations
- Amazon Inspector -- to scan EC2 instances for SSH vulnerabilities
- AWS Trusted Advisor -- to recommend security best practices
Answer: B
AWS Config's 'restricted-ssh' rule continuously evaluates security groups and marks any that allow unrestricted SSH access as noncompliant. Unlike CloudTrail (which logs the change after it happens), Config evaluates the resulting configuration state and flags violations proactively.
Q2. A compliance team needs to track all configuration changes to their Bedrock knowledge bases and SageMaker endpoints over the past 90 days. Which service provides this historical configuration data?
- AWS CloudTrail -- to see who made API calls
- AWS Config -- to view resource configuration history and compliance timeline
- Amazon Inspector -- to audit resource security posture
- AWS Trusted Advisor -- to get configuration recommendations
Answer: B
AWS Config continuously records resource configurations and maintains a historical timeline. You can view exactly how a resource's configuration changed over time, when changes occurred, and whether the resource remained compliant throughout. CloudTrail shows WHO called an API, but Config shows WHAT the configuration looked like.
Q3. What is the relationship between AWS Config and AWS CloudTrail?
- They are the same service with different names
- Config records WHAT changed; CloudTrail records WHO made the change
- CloudTrail replaces Config for newer AWS accounts
- Config is for compliance; CloudTrail is for billing
Answer: B
AWS Config and CloudTrail complement each other. Config tracks WHAT a resource's configuration looks like now versus before and whether it's compliant. CloudTrail tracks WHO made an API call, WHAT action they took, and WHEN. Together they provide complete visibility: who changed it and what changed.
Q4. An organization wants to ensure all their S3 buckets have server-side encryption enabled. How can they automatically verify this across all buckets?
- Manually check each bucket's properties monthly
- Use AWS Config with the 's3-bucket-server-side-encryption-enabled' rule to continuously evaluate all buckets
- Enable CloudTrail to log encryption status of all buckets
- Use Amazon Macie to scan for unencrypted buckets
Answer: B
AWS Config rules continuously evaluate resource configurations against compliance requirements. The 's3-bucket-server-side-encryption-enabled' rule automatically checks all S3 buckets and marks any without encryption as noncompliant, providing ongoing visibility without manual auditing.
Q5. Which statement about AWS Config is correct?
- AWS Config is free to use with no charges
- AWS Config is a global service that runs in all regions automatically
- AWS Config is a per-region service but supports multi-region aggregation
- AWS Config only tracks EC2 and S3 resources
Answer: C
AWS Config operates per-region, meaning you need to enable it in each region where you want to track resources. However, you can aggregate Config data from multiple regions and accounts into a central dashboard for unified visibility. Note that Config is NOT free -- charges apply per configuration item recorded.
Amazon Inspector
Amazon Inspector is an automated vulnerability scanning service for your compute resources. It continuously checks for known security flaws in your EC2 instances, container images, and Lambda functions.
What It Scans
EC2 Instances
How: Uses the AWS Systems Manager (SSM) agent installed on the instance
Checks:
- Unintended network accessibility (open ports, missing firewall rules)
- Known OS and software vulnerabilities (CVE database)
Timing: Continuous scanning
Container Images (Amazon ECR)
How: Scans Docker images as they are pushed to the Elastic Container Registry
Checks:
- Known vulnerabilities in container packages and dependencies
Timing: On push (event-driven)
Lambda Functions
How: Scans function code and package dependencies when deployed
Checks:
- Software vulnerabilities in function code and dependencies
Timing: On deployment (event-driven)
Output
- Findings sent to AWS Security Hub for centralized visibility
- Events sent to Amazon EventBridge for automation (e.g., notify team, trigger remediation)
- Each finding has a risk score for prioritization
- Re-scans automatically when the CVE database is updated
Important Constraints: Inspector ONLY covers EC2, ECR container images, and Lambda. It does NOT scan S3, RDS, or other services.
Ai Relevance: Scan Lambda functions used in ML pipelines and container images used for model serving to ensure they are free of known security vulnerabilities.
Key Terms
| Term | Definition |
|---|---|
| Amazon Inspector | An automated vulnerability scanning service that continuously checks EC2 instances, ECR container images, and Lambda functions for known security vulnerabilities and unintended network exposure. |
| CVE (Common Vulnerabilities and Exposures) | A public database of known software security vulnerabilities. Amazon Inspector continuously checks your resources against this database. |
- Inspector = automated VULNERABILITY scanning for EC2, ECR containers, and Lambda ONLY.
- Inspector is continuous -- not a one-time scan. Re-runs when CVE database updates.
- Inspector -> Security Hub (centralized findings) + EventBridge (automated responses).
- Inspector is NOT for S3 content, databases, or application logic -- only compute resources.
- Risk score assigned to each finding for prioritization.
Practice Questions
Q1. A DevOps team deploys ML inference containers to Amazon ECR. They want to automatically identify any security vulnerabilities in the container images' dependencies as part of the CI/CD pipeline. Which AWS service provides this?
- AWS Config -- to check container image configuration compliance
- AWS Macie -- to scan container images for sensitive data
- Amazon Inspector -- to automatically scan ECR container images for known vulnerabilities when pushed
- AWS CloudTrail -- to log all container image pushes to ECR
Answer: C
Amazon Inspector automatically scans container images pushed to Amazon ECR for known software vulnerabilities (CVE database). This integrates naturally into CI/CD pipelines -- each push triggers an Inspector scan, and findings are reported to Security Hub and EventBridge for automated response.
Q2. Which compute resources does Amazon Inspector scan for security vulnerabilities?
- EC2 instances, S3 buckets, and RDS databases
- EC2 instances, ECR container images, and Lambda functions
- All AWS services with security configurations
- Only EC2 instances with the Inspector agent installed
Answer: B
Amazon Inspector scans three types of compute resources: EC2 instances (via SSM agent), container images in Amazon ECR (on push), and Lambda functions (on deployment). It does NOT scan S3, RDS, or other non-compute services.
Q3. A company's ML inference Lambda functions use several third-party libraries. How can they automatically detect if any of these libraries have known security vulnerabilities?
- Manually review the CVE database for each library version
- Use Amazon Inspector which automatically scans Lambda function dependencies for known CVEs
- Use Amazon Macie to scan the Lambda code for vulnerabilities
- Use AWS Config to check if Lambda functions are compliant
Answer: B
Amazon Inspector automatically scans Lambda functions when deployed, checking both the function code and package dependencies against the CVE database. When vulnerabilities are found, Inspector generates findings with risk scores sent to Security Hub and EventBridge.
Q4. How does Amazon Inspector prioritize the security findings it generates?
- All findings are treated with equal priority
- Each finding is assigned a risk score for prioritization
- Findings are sorted alphabetically by vulnerability name
- Findings are prioritized by the resource's creation date
Answer: B
Amazon Inspector assigns a risk score to each vulnerability finding, helping security teams prioritize remediation efforts. Higher-risk vulnerabilities with greater potential impact are scored higher, enabling teams to address the most critical issues first.
Q5. What triggers Amazon Inspector to re-scan EC2 instances for vulnerabilities?
- Manual scans must be initiated by administrators
- Scans only occur once when Inspector is first enabled
- Inspector continuously scans and re-scans when the CVE database is updated
- Scans are triggered only when instances are restarted
Answer: C
Amazon Inspector provides continuous, automated scanning of EC2 instances. When the CVE database is updated with newly discovered vulnerabilities, Inspector automatically re-scans resources to detect if they are affected by the new CVEs, without requiring manual intervention.
AWS CloudTrail
CloudTrail is the audit log for your entire AWS account. It records every API call made by any user, service, or application -- providing a complete history of who did what, when, and from where.
Key Facts
- Enabled by default for all AWS accounts
- Records ALL API calls: console actions, SDK calls, CLI commands, service-to-service calls
- Retains 90 days of management event history in the console (free)
- For longer retention, send logs to S3 or CloudWatch Logs
- Can be configured for a single region or all regions simultaneously
- Works for BOTH successful and denied/unauthorized API calls
What It Captures Per Event
- Event name (which API was called)
- Event source (which service)
- AWS access key used
- Region where the call was made
- Source IP address
- Timestamp
- Request parameters and response
- Whether the call succeeded or was denied
Common Use Cases
- Audit who deleted a resource: 'Who terminated my EC2 instance?' -> CloudTrail shows the user and timestamp
- Security investigation: 'Has anyone accessed our ML training data in S3 recently?' -> CloudTrail S3 data events
- Compliance: Demonstrate to auditors that only authorized users accessed sensitive AI systems
- Unauthorized access detection: Identify users making repeated denied API calls to Bedrock
Cloudtrail And Bedrock
- Authorized
- When an authorized user calls the Bedrock API (e.g., ListCustomModels), CloudTrail logs a successful API event.
- Unauthorized
- When an unauthorized user attempts the same call and is denied by IAM, CloudTrail STILL logs the event -- recording the denial. This is how you detect unauthorized access attempts.
- Use
- Analyze CloudTrail logs for denied Bedrock API calls to identify which users are attempting to access AI resources without proper permissions.
Cloudtrail Vs Config
- Cloudtrail
- WHO made a change, WHAT action they took, and WHEN
- Config
- WHAT the resource configuration looks like now vs. before, and IS IT COMPLIANT
Key Terms
| Term | Definition |
|---|---|
| AWS CloudTrail | A service that records all API activity across an AWS account -- capturing who made each call, what action was taken, when, and from where. Used for auditing, compliance, and security investigations. |
| CloudTrail Event | A single record of an API call in CloudTrail. Contains the caller identity, API name, timestamp, region, and result (success or denied). |
| Management Events (CloudTrail) | Records of control-plane operations -- creating, modifying, or deleting AWS resources (e.g., creating an EC2 instance, modifying a security group). Enabled by default and retained 90 days. |
- CloudTrail = AUDIT LOG. 'Who called which API, when?' -> CloudTrail.
- CloudTrail logs BOTH successful AND denied API calls. Use it to detect unauthorized access attempts.
- Default 90-day retention in console. Send to S3 for longer-term storage.
- CloudTrail + Config: CloudTrail = WHO changed it. Config = WHAT changed and IS IT COMPLIANT.
- All Bedrock API calls are logged in CloudTrail -- use this for compliance and security monitoring of AI workloads.
Practice Questions
Q1. A security team suspects that an IAM user is repeatedly attempting to access Amazon Bedrock custom models without proper authorization. Which service can confirm this and provide details of each attempt?
- Amazon Inspector -- to scan the user's workstation for vulnerabilities
- AWS Config -- to check if the user's IAM permissions are compliant
- AWS CloudTrail -- to show all Bedrock API calls made by the user, including denied attempts
- Amazon Macie -- to scan S3 buckets the user accessed
Answer: C
AWS CloudTrail records all API calls to Amazon Bedrock, including calls that were denied by IAM. Each denied attempt creates a CloudTrail event recording the user's identity, the specific API they tried to call, the timestamp, and the denial reason -- providing exactly the evidence needed for this investigation.
Q2. An administrator needs to determine who deleted a SageMaker endpoint yesterday afternoon. Which service provides this information?
- AWS Config -- shows what changed on the endpoint
- AWS CloudTrail -- shows who called the DeleteEndpoint API and when
- Amazon Inspector -- scans for security issues with the endpoint
- AWS Trusted Advisor -- provides recommendations for endpoint configuration
Answer: B
AWS CloudTrail logs all API calls including DeleteEndpoint. The CloudTrail event shows exactly who made the call (IAM user or role identity), when it occurred (timestamp), from where (source IP), and the result. This is the audit trail for all AWS account activity.
Q3. How long does AWS CloudTrail retain management event history in the console by default?
- 30 days
- 90 days
- 365 days
- Events are not retained by default
Answer: B
CloudTrail retains 90 days of management event history in the console at no additional charge. This is automatically enabled for all AWS accounts. For longer retention, you must configure CloudTrail to send logs to an S3 bucket or CloudWatch Logs.
Q4. A company needs to detect when users make unauthorized attempts to invoke Bedrock foundation models. How should they configure monitoring?
- Enable Bedrock model invocation logging to S3
- Analyze CloudTrail logs for denied InvokeModel API calls using CloudWatch or EventBridge
- Use Amazon Macie to detect unauthorized model access
- Configure AWS Config rules to monitor Bedrock access
Answer: B
CloudTrail records all Bedrock API calls including denied requests. By analyzing CloudTrail logs with CloudWatch Logs Insights or configuring EventBridge rules to detect denied InvokeModel events, the company can identify and alert on unauthorized access attempts in near real-time.
Q5. What types of API calls does AWS CloudTrail record?
- Only successful API calls
- Only API calls made through the AWS Console
- Both successful and denied API calls from console, CLI, SDK, and service-to-service
- Only API calls made by IAM users, not roles
Answer: C
CloudTrail records ALL API calls regardless of how they were made (console, CLI, SDK, or service-to-service) and whether they succeeded or were denied. This comprehensive logging enables complete audit trails and security investigation capabilities.
AWS Artifact
AWS Artifact is a self-service portal providing on-demand access to AWS compliance documentation and legal agreements. It is not a technical security service -- it is a document and agreement management portal.
Two Components
Artifact Reports
Examples:
- ISO 27001 certifications
- PCI DSS compliance reports
- SOC 1, SOC 2, SOC 3 reports
- NIST framework assessments
Purpose: Use these reports as evidence in your own internal audits or to demonstrate AWS's compliance posture to your customers.
Artifact Agreements
Examples:
- Business Associate Addendum (BAA) -- required for HIPAA compliance
- GDPR Data Processing Addendum
- Regional data protection agreements
Scope: Can be accepted for individual accounts or for an entire AWS Organization.
Third Party Reports
- Description
- Artifact also hosts compliance reports from Independent Software Vendors (ISVs) who sell products on AWS Marketplace.
- Access
- Only available to customers who have contracted with that ISV through Marketplace Vendor Insights.
- Notifications
- Administrators can configure notifications to receive alerts when new compliance reports are published.
Exam Signal: Whenever a question mentions 'compliance documentation', 'audit reports', 'ISO/SOC/PCI reports from AWS', or 'HIPAA agreements' -> AWS Artifact.
Key Terms
| Term | Definition |
|---|---|
| AWS Artifact | A self-service portal providing on-demand access to AWS compliance reports (ISO, PCI, SOC) and legal agreements (BAA, GDPR addenda) to support audit and compliance activities. |
| Business Associate Addendum (BAA) | A legal agreement required under HIPAA when a business associate (like AWS) handles protected health information (PHI) on behalf of a covered entity. Signed via AWS Artifact. |
| SOC Reports | System and Organization Controls reports -- third-party audit reports confirming AWS's compliance with security and availability controls. Available for download in AWS Artifact. |
- Artifact = COMPLIANCE DOCUMENTS and AGREEMENTS. Not a security scanning service.
- Two parts: Reports (download AWS audit reports) and Agreements (accept legal agreements like BAA).
- 'Need HIPAA BAA for AWS account' -> AWS Artifact Agreements.
- 'Need AWS SOC/ISO/PCI report for auditors' -> AWS Artifact Reports.
- Artifact is a portal -- it does not monitor or enforce compliance.
Practice Questions
Q1. A healthcare company is deploying an AI-powered clinical documentation tool on AWS and needs to ensure they meet HIPAA requirements. As part of this, they need to sign a Business Associate Addendum with AWS. Where do they access this?
- AWS Audit Manager -- to generate HIPAA compliance evidence
- AWS Artifact Agreements -- to review and accept the HIPAA Business Associate Addendum
- AWS Trusted Advisor -- to get HIPAA compliance recommendations
- AWS Config -- to configure HIPAA compliance rules
Answer: B
AWS Artifact Agreements is where customers access, review, and accept legal agreements with AWS -- including the Business Associate Addendum (BAA) required for HIPAA compliance. The BAA is available for individual accounts or entire organizations.
Q2. An auditor requests AWS's SOC 2 and ISO 27001 compliance certifications to verify the company's cloud security posture. Where can these AWS compliance reports be obtained?
- AWS Artifact Reports -- to download AWS's third-party audit reports
- AWS Audit Manager -- to generate compliance reports
- AWS Security Hub -- to view compliance dashboards
- AWS Trusted Advisor -- to access security recommendations
Answer: A
AWS Artifact Reports provides on-demand access to AWS's compliance documentation produced by third-party auditors, including SOC reports, ISO certifications, PCI DSS compliance reports, and more. These documents can be downloaded and provided to auditors as evidence of AWS's compliance posture.
Q3. What are the two main components of AWS Artifact?
- Artifact Inspector and Artifact Scanner
- Artifact Reports and Artifact Agreements
- Artifact Monitor and Artifact Remediation
- Artifact Audit and Artifact Compliance
Answer: B
AWS Artifact has two components: Reports (download AWS security and compliance reports from third-party auditors) and Agreements (review and accept legal agreements like BAA for HIPAA and GDPR addenda). It's a document portal, not a technical security service.
Q4. A startup using AWS for their GenAI application needs to demonstrate to investors that AWS infrastructure meets PCI DSS requirements. What is the quickest way to obtain this documentation?
- Request a custom audit from AWS support
- Download the PCI DSS compliance report from AWS Artifact
- Generate a PCI compliance assessment using AWS Config
- Review PCI status in AWS Trusted Advisor
Answer: B
AWS Artifact provides immediate, self-service access to AWS's PCI DSS compliance reports. These pre-existing third-party audit reports can be downloaded instantly and shared with investors to demonstrate AWS's compliance with payment card industry standards.
Q5. Which statement about AWS Artifact is correct?
- Artifact automatically monitors and enforces compliance in your AWS account
- Artifact scans your resources for compliance violations
- Artifact is a self-service portal for downloading compliance documents and signing legal agreements
- Artifact generates compliance evidence from your AWS resources
Answer: C
AWS Artifact is a document and agreement management portal -- not a technical security or monitoring service. It provides access to AWS's compliance reports and legal agreements. It does NOT monitor, scan, or enforce compliance in your account.
AWS Audit Manager and Trusted Advisor
Audit Manager
Getting certified under frameworks like GDPR, HIPAA, PCI DSS, or SOC 2 requires gathering large amounts of documented evidence about your infrastructure. Doing this manually is time-consuming and error-prone.
How It Helps:
- Select the compliance framework you want to audit against (GDPR, HIPAA, PCI, SOC 2, etc.)
- Define the scope: which accounts, regions, and services to assess
- Automated Evidence Collection: continuously gathers screenshots, config data, and compliance reports across your resources
- Control Reviews: delegate specific controls to team members for validation
- Issue Resolution: identifies non-compliant controls and root causes
- Audit-Ready Reports: generates reports with collected evidence ready for external auditors
Audit Manager = continuous, automated EVIDENCE COLLECTION for framework audits. Config = resource configuration tracking. Artifact = download pre-existing AWS compliance documents.
Trusted Advisor
Six Categories
Cost Optimization
Examples:
- Unused EC2 instances
- Idle load balancers
- Unattached EBS volumes
Access Level: Business/Enterprise Support plan required for full checks
Performance
Examples:
- High EC2 utilization rates
- CloudFront configuration improvements
Access Level: Business/Enterprise Support plan required
Security
Examples:
- EBS public snapshots
- RDS public snapshots
- Root account MFA not enabled
- Security groups with unrestricted access
Access Level: Core checks available on all plans; additional checks require Business/Enterprise
Fault Tolerance
Examples:
- EC2 instances in single AZ
- RDS without Multi-AZ
- S3 versioning not enabled
Access Level: Business/Enterprise Support plan required
Service Limits
Examples:
- EC2 instance limits
- VPC limits
- DynamoDB capacity limits
Access Level: Available on all plans
Operational Excellence
Examples:
- CloudTrail not enabled
- Unused IAM access keys
Access Level: Business/Enterprise Support plan required
Support Plan Access
- Basic
- Core security checks and service limits only
- Business Or Enterprise
- Full set of all checks + programmatic access via AWS Support API
Key Terms
| Term | Definition |
|---|---|
| AWS Audit Manager | A service that continuously and automatically collects evidence of your AWS resource configurations to prepare audit-ready reports for compliance frameworks like GDPR, HIPAA, PCI, and SOC 2. |
| AWS Trusted Advisor | An account-level advisory tool that analyzes your AWS infrastructure and provides recommendations across cost optimization, performance, security, fault tolerance, service limits, and operational excellence. |
- Audit Manager = automated EVIDENCE COLLECTION for regulatory framework audits (GDPR, HIPAA, PCI, SOC 2).
- Trusted Advisor = 6 category RECOMMENDATIONS for your account. Not automated remediation -- just advice.
- Trusted Advisor security core checks: EBS/RDS public snapshots, root account usage, open security group ports.
- Full Trusted Advisor checks require Business or Enterprise Support plan.
- Audit Manager vs. Artifact: Audit Manager collects YOUR evidence. Artifact downloads AWS's own compliance reports.
- Trusted Advisor does NOT enforce changes -- it recommends them.
Practice Questions
Q1. A company is preparing for a PCI DSS audit for their AI-powered payment processing application on AWS. They need to automatically collect evidence of their infrastructure configurations across multiple accounts and generate a report ready for external auditors. Which service addresses this?
- AWS Artifact -- to download AWS's PCI DSS compliance report
- AWS Config -- to track configuration changes to payment resources
- AWS Audit Manager -- to continuously collect evidence mapped to PCI DSS controls and generate audit-ready reports
- AWS Trusted Advisor -- to check for PCI DSS best practice violations
Answer: C
AWS Audit Manager is specifically designed to automate evidence collection for compliance framework audits like PCI DSS. It continuously gathers configuration evidence across accounts and generates audit-ready reports with the collected evidence mapped to specific controls -- exactly what external auditors require.
Q2. What is the key difference between AWS Artifact and AWS Audit Manager?
- Artifact is for security; Audit Manager is for compliance
- Artifact downloads AWS's compliance reports; Audit Manager collects YOUR infrastructure's compliance evidence
- Artifact is free; Audit Manager requires payment
- Artifact is for HIPAA; Audit Manager is for GDPR
Answer: B
Artifact provides AWS's pre-existing compliance documentation and legal agreements. Audit Manager collects evidence from YOUR AWS resources and configurations to prepare YOUR organization's audit reports. Both support compliance, but they serve different purposes.
Q3. AWS Trusted Advisor provides recommendations across how many categories?
- 3 categories: Cost, Security, and Performance
- 4 categories: Cost, Security, Reliability, and Compliance
- 6 categories: Cost Optimization, Performance, Security, Fault Tolerance, Service Limits, and Operational Excellence
- 2 categories: Security and Cost
Answer: C
AWS Trusted Advisor analyzes your AWS account and provides recommendations across six categories: Cost Optimization, Performance, Security, Fault Tolerance, Service Limits, and Operational Excellence. Full access to all checks requires Business or Enterprise Support plans.
Q4. A company on the AWS Basic Support plan wants to use Trusted Advisor. Which checks are available to them?
- All Trusted Advisor checks are available on Basic Support
- No Trusted Advisor checks are available on Basic Support
- Core security checks and service limits checks only
- Only cost optimization checks
Answer: C
AWS Basic Support includes access to core Trusted Advisor checks: essential security checks (like S3 bucket permissions and security group open ports) and service limits checks. Full access to all Trusted Advisor checks requires Business or Enterprise Support plans.
Q5. Which statement correctly describes AWS Trusted Advisor?
- Trusted Advisor automatically remediates security issues it finds
- Trusted Advisor provides recommendations but does NOT automatically make changes
- Trusted Advisor is a compliance certification service
- Trusted Advisor scans S3 buckets for sensitive data
Answer: B
AWS Trusted Advisor is an advisory service that analyzes your account and provides recommendations. It does NOT automatically remediate issues or make changes to your resources -- it only advises. You must take action based on its recommendations.
VPC and Network Security
VPCs allow you to deploy AWS resources in isolated private networks. For AI/ML workloads, the key use case is deploying models privately and accessing AWS services (Bedrock, SageMaker, S3) without internet traffic.
Core Components
Vpc
- Definition
- A Virtual Private Cloud -- a logically isolated, private network within AWS where you deploy your resources. Each VPC is tied to one region.
- Cidr Range
- An IP address range defined for the VPC that all resources inside share.
Subnets
- Public Subnet
- A subnet that routes traffic to an Internet Gateway -- resources here are accessible from the internet (e.g., public-facing web servers).
- Private Subnet
- A subnet with no internet route -- resources here are isolated from the internet (e.g., ML training jobs, databases, internal analysis tools).
- High Availability
- Best practice: deploy across multiple AZs, with both public and private subnets in each AZ.
Internet Gateway
- Purpose
- Allows resources in a PUBLIC subnet to communicate with the internet -- both inbound and outbound.
- Directionality
- Bidirectional -- internet can reach public subnet resources
Nat Gateway
- Purpose
- Allows resources in a PRIVATE subnet to reach the internet for outbound calls (e.g., downloading updates, calling external APIs) WITHOUT being accessible from the internet.
- Placement
- Deployed in a PUBLIC subnet but serves the private subnet
- Directionality
- Outbound only -- internet CANNOT reach private subnet resources through NAT
Vpc Endpoints And Private Link
By default, AWS service APIs (Bedrock, SageMaker, S3) are accessed over the public internet. Resources in private subnets without internet access cannot reach these services.
VPC Endpoints -- allow private subnet resources to access AWS services WITHOUT leaving the AWS network. No internet gateway or NAT gateway required.
Powered By: AWS PrivateLink (you may see either term on the exam -- they refer to the same concept for most services).
Types
- Interface Endpoint
- Used for most AWS services (Bedrock, SageMaker, etc.). Creates an elastic network interface (ENI) in your subnet.
- Gateway Endpoint
- Used exclusively for Amazon S3 and DynamoDB. Free of charge. Configured at the route table level.
There's a special S3 Gateway Endpoint for accessing S3 privately. SageMaker notebooks and training jobs in private subnets use this to access training data in S3 without internet traffic.
Bedrock Vpcendpoint: Deploy a Bedrock VPC Endpoint so applications in private subnets can invoke Bedrock models without internet access.
Private subnet app -> VPC Endpoint (PrivateLink) -> AWS Service (Bedrock/S3/SageMaker). All traffic stays inside the AWS network.
Security Components
- Security Group
- Acts as a virtual firewall for EC2 instances and ENIs. Controls inbound and outbound traffic by port, protocol, and source IP.
- Endpoint Policy
- An IAM-based policy attached to a VPC endpoint that restricts which principals can use the endpoint and which resources they can access through it.
Key Terms
| Term | Definition |
|---|---|
| VPC (Virtual Private Cloud) | A logically isolated, private network in AWS. All subnets, instances, and resources reside within a VPC. Region-specific. |
| Public Subnet | A VPC subnet routed to an Internet Gateway, making resources within it accessible to and from the internet. |
| Private Subnet | A VPC subnet with no internet route. Resources here are isolated from external internet access -- used for databases, ML training, and internal workloads. |
| Internet Gateway | Allows bidirectional traffic between a public subnet and the internet. Required for resources that need to be publicly accessible. |
| NAT Gateway | Allows private subnet resources to make outbound internet requests without being directly accessible from the internet. Deployed in a public subnet. |
| VPC Endpoint / AWS PrivateLink | Allows resources in a VPC to access AWS services (Bedrock, SageMaker, S3) privately without routing traffic over the public internet. All traffic stays within the AWS network. |
| S3 Gateway Endpoint | A free VPC endpoint specifically for Amazon S3 and DynamoDB. Configured at the route table level. Used by SageMaker and Bedrock to access S3 data privately. |
- Public subnet = internet-accessible. Private subnet = isolated from internet.
- NAT Gateway: private subnet resources can reach the internet, but internet CANNOT reach them.
- VPC Endpoint / PrivateLink = access AWS services privately without internet traffic.
- For AI workloads: SageMaker in private subnet + S3 Gateway Endpoint = private ML training data access.
- For Bedrock: Bedrock VPC Endpoint = applications in private subnets invoke Bedrock without internet.
- Endpoint Policy = IAM-based access control on what can be accessed through a VPC endpoint.
- If exam says 'privately access Bedrock/SageMaker/S3 from within a VPC' -> VPC Endpoint / PrivateLink.
Practice Questions
Q1. A company deploys SageMaker training jobs in a private VPC subnet with no internet access. The training jobs need to read large training datasets from Amazon S3. How can this be achieved without routing traffic over the internet?
- Add a NAT Gateway to allow the training jobs to access S3 via the internet
- Move the training jobs to a public subnet so they can access S3 directly
- Create an S3 Gateway VPC Endpoint and configure the route table to route S3 traffic through it
- Use an Internet Gateway in the private subnet to route only S3 traffic
Answer: C
An S3 Gateway VPC Endpoint allows resources in a private subnet to access Amazon S3 directly through the AWS private network, without requiring internet access via NAT or an Internet Gateway. The route table is updated to direct S3-bound traffic through the endpoint, keeping all data transfer within AWS infrastructure.
Q2. A GenAI application in a private VPC subnet needs to invoke Amazon Bedrock models. The security team requires that no traffic leave the AWS network. What should be configured?
- A NAT Gateway in a public subnet to route Bedrock traffic
- A Bedrock VPC Interface Endpoint (PrivateLink) to access Bedrock privately
- An Internet Gateway with security group rules limiting traffic to Bedrock IPs only
- An S3 Gateway Endpoint since Bedrock uses S3 internally
Answer: B
A Bedrock VPC Interface Endpoint (powered by PrivateLink) allows applications in private subnets to invoke Bedrock APIs entirely within the AWS private network. No internet gateway or NAT gateway is needed, and all traffic stays on AWS infrastructure.
Q3. What is the difference between an Internet Gateway and a NAT Gateway?
- Internet Gateway is for public subnets (bidirectional); NAT Gateway is for private subnets (outbound only)
- Internet Gateway is for IPv6; NAT Gateway is for IPv4
- Internet Gateway is free; NAT Gateway is paid
- Internet Gateway is for AWS services; NAT Gateway is for external websites
Answer: A
An Internet Gateway enables bidirectional internet access for resources in public subnets. A NAT Gateway allows resources in private subnets to make outbound internet requests while remaining inaccessible from the internet. NAT Gateway is deployed in a public subnet but serves the private subnet.
Q4. An organization wants to restrict which S3 buckets can be accessed through their S3 VPC Endpoint. How can this be achieved?
- Configure security group rules on the VPC endpoint
- Attach an endpoint policy to the VPC endpoint specifying allowed buckets
- Use S3 bucket policies only -- VPC endpoints cannot be restricted
- Create separate VPC endpoints for each bucket
Answer: B
VPC Endpoint policies are IAM-based policies attached to VPC endpoints that restrict which principals can use the endpoint and which resources they can access through it. By specifying allowed S3 buckets in the endpoint policy, you limit access to only approved buckets.
Q5. Which type of VPC endpoint is used to access Amazon S3 and DynamoDB?
- Interface Endpoint (creates an ENI in your subnet)
- Gateway Endpoint (configured at the route table level)
- PrivateLink Endpoint (creates a private DNS entry)
- Direct Connect Endpoint (uses dedicated network connection)
Answer: B
S3 and DynamoDB use Gateway Endpoints, which are free and configured at the route table level. Most other AWS services (including Bedrock and SageMaker) use Interface Endpoints, which create elastic network interfaces (ENIs) in your subnet and use PrivateLink.
Security Services Summary and Exam Scenarios
Services Quick Reference
| Tool / Service | Purpose |
|---|---|
| IAM | Identity and access control. Users, groups, roles, policies. |
| EC2 | Virtual servers. GPU instances for ML training and inference. |
| Lambda | Serverless event-driven functions. No server management. |
| Amazon S3 | Object storage for training data, model artifacts, pipeline I/O. |
| Amazon Macie | ML-powered PII detection in S3 buckets. |
| AWS Config | Configuration change tracking and compliance rule evaluation. |
| Amazon Inspector | Vulnerability scanning for EC2, ECR containers, Lambda. |
| AWS CloudTrail | Complete API activity log for the entire account. |
| AWS Artifact | On-demand compliance reports and legal agreements. |
| AWS Audit Manager | Automated evidence collection for compliance framework audits. |
| AWS Trusted Advisor | Account-wide recommendations across 6 categories. |
| VPC Endpoints / PrivateLink | Private access to AWS services without internet traffic. |
Exam Scenarios
Bedrock fine-tuning job needs to access an encrypted S3 bucket
Create an IAM role for the Bedrock job with (1) S3 read permission and (2) KMS decrypt permission. Assign the role to the customization job.
Key Services:
- IAM
- S3
- KMS
SageMaker notebook in a private subnet needs to access S3 training data privately
Deploy an S3 Gateway VPC Endpoint. Update the route table. Optionally attach an endpoint policy to restrict access to specific buckets.
Key Services:
- VPC Endpoint
- S3
- IAM
Application in private subnet needs to invoke Bedrock model privately
Deploy a Bedrock Interface VPC Endpoint (PrivateLink). Configure security group on the endpoint. Attach endpoint policy to restrict which Bedrock resources can be accessed.
Key Services:
- VPC Endpoint
- PrivateLink
- IAM
Detect unauthorized Bedrock access attempts by IAM users
Solution: Analyze CloudTrail logs for denied Bedrock API calls (e.g., denied ListCustomModels events) filtered by user identity.
Key Services:
- CloudTrail
- IAM
Verify training dataset doesn't contain PII before model training
Solution: Run Amazon Macie on the S3 bucket containing the training data. Act on findings before proceeding to training.
Key Services:
- Macie
- S3
- EventBridge
Keyword Map
Who made this API call?
Answer: AWS CloudTrail
Is this resource compliant / has it changed?
Answer: AWS Config
Software vulnerability in EC2/ECR/Lambda
Answer: Amazon Inspector
PII in S3 bucket
Answer: Amazon Macie
AWS compliance reports / HIPAA BAA
Answer: AWS Artifact
Prepare for GDPR/PCI/SOC2 audit
Answer: AWS Audit Manager
Account best practice recommendations
Answer: AWS Trusted Advisor
Access AWS service without internet from VPC
Answer: VPC Endpoint / PrivateLink
S3 private access from VPC
Answer: S3 Gateway VPC Endpoint
Give EC2/Lambda/Bedrock permission to call AWS service
Answer: IAM Role
Restrict access in GenAI application
Answer: Bedrock Guardrails + IAM
- IAM Role = how AWS services get permissions. ALWAYS the answer when one service needs to access another.
- CloudTrail = WHO + WHAT API + WHEN. Config = WHAT changed + IS IT COMPLIANT.
- Inspector = vulnerabilities in COMPUTE (EC2, ECR, Lambda). Macie = PII in S3.
- Artifact = download reports + sign agreements. Audit Manager = collect YOUR own evidence.
- VPC Endpoint / PrivateLink = private AWS service access. No internet required.
- For Bedrock access scenarios: IAM role (permissions) + VPC Endpoint (network privacy) + CloudTrail (audit) + Guardrails (content control).
Practice Questions
Q1. A company's security team receives an alert that an IAM user repeatedly attempted to list all custom Bedrock models but was denied each time. Which combination of services captured this activity and sent the alert?
- AWS Config captured the denied API calls; SNS sent the alert
- AWS CloudTrail captured all denied Bedrock API calls; EventBridge or CloudWatch triggered the alert
- Amazon Inspector detected the unauthorized access pattern; Security Hub raised the alert
- Amazon Macie detected the unauthorized user; Trusted Advisor raised the alert
Answer: B
AWS CloudTrail logs ALL API calls to Amazon Bedrock -- including those that are denied by IAM. Each denied attempt creates a CloudTrail event. CloudWatch or EventBridge rules can be configured to detect denied Bedrock API calls and trigger alerts automatically.
Q2. A GenAI application is deployed in a private VPC subnet with no internet access. The application needs to invoke Amazon Bedrock foundation models. Which AWS networking feature enables this?
- Internet Gateway -- to allow outbound calls from the private subnet to Bedrock
- NAT Gateway -- to route Bedrock API calls through a public subnet
- Amazon Bedrock VPC Interface Endpoint (PrivateLink) -- to access Bedrock privately without internet traffic
- S3 Gateway Endpoint -- to route Bedrock API calls through the S3 network path
Answer: C
A Bedrock VPC Interface Endpoint (powered by PrivateLink) allows applications in private subnets to invoke Bedrock APIs entirely within the AWS private network -- no internet gateway or NAT gateway needed. All traffic between the application and Bedrock stays on AWS infrastructure.
Q3. A SageMaker endpoint needs to read model artifacts from an encrypted S3 bucket and call Bedrock for additional processing. What IAM configuration is required?
- Create an IAM user with S3 and Bedrock credentials embedded in the endpoint configuration
- Create an IAM role with S3 read, KMS decrypt, and Bedrock invoke permissions and assign it to the SageMaker endpoint
- Use the default SageMaker permissions which include all AWS service access
- Create separate roles for S3 access and Bedrock access
Answer: B
SageMaker endpoints require an IAM role that defines their permissions to access other AWS services. The role should include S3 GetObject permission, KMS Decrypt permission for the encrypted bucket, and Bedrock InvokeModel permission. IAM roles are always used for service-to-service permissions.
Q4. If an exam question asks 'How do you detect PII in S3 training data?', which service is the answer?
- Amazon Comprehend
- Amazon Macie
- AWS Config
- Amazon Inspector
Answer: B
Amazon Macie is the service specifically designed to scan S3 buckets and detect PII using machine learning. While Comprehend can detect PII in text input, Macie is the answer when the question specifically mentions S3 data or training datasets stored in buckets.
Q5. Which keyword mapping is CORRECT for AWS security services?
- 'Who made this API call?' -> AWS Config
- 'Software vulnerability in Lambda' -> Amazon Macie
- 'Download AWS SOC report' -> AWS Artifact
- 'PII in S3 bucket' -> Amazon Inspector
Answer: C
AWS Artifact is where you download AWS's compliance reports (SOC, ISO, PCI). The correct mappings are: 'Who made this API call?' -> CloudTrail, 'Software vulnerability in Lambda' -> Inspector, 'PII in S3 bucket' -> Macie.
AWS AI Practitioner - Table of Contents
Master all exam topics with comprehensive study guides and practice questions.