AWS Security Architect https://awssecurityarchitect.com/ Experienced AWS, GCP and Azure Security Architect Thu, 20 Aug 2026 14:06:51 +0000 en-US hourly 1 https://wordpress.org/?v=7.1 214477604 AWS IAM in Detail: Users, Roles, Policies, Federation, SCPs, and Permission Boundaries https://awssecurityarchitect.com/aws-iam/531/ https://awssecurityarchitect.com/aws-iam/531/#respond Thu, 20 Aug 2026 13:43:41 +0000 https://awssecurityarchitect.com/?p=531 AWS IAM in Detail: Users, Roles, Policies, Federation, SCPs, and Permission Boundaries AWS Identity and Access Management (IAM) is the foundation of access control in Amazon Web Services. Almost every […]

The post AWS IAM in Detail: Users, Roles, Policies, Federation, SCPs, and Permission Boundaries appeared first on AWS Security Architect.

]]>
AWS IAM in Detail: Users, Roles, Policies, Federation, SCPs, and Permission Boundaries
AWS Identity and Access Management (IAM) is the foundation of access control in Amazon Web Services.
Almost every AWS architecture eventually depends on IAM to answer a very simple question:

Who is allowed to perform what action on which AWS resource, and under what conditions?

IAM can appear complicated because AWS provides several overlapping authorization mechanisms:
users, groups, roles, identity policies, resource policies, permissions boundaries, Service Control
Policies, trust policies, federation, and temporary credentials.

The easiest way to understand IAM is to begin with the basic authorization flow.

Identity
   |
   v
Authentication
   |
   v
Authorization
   |
   v
AWS Resource

When an AWS API request occurs, AWS evaluates the principal making the request, the requested
action, the target resource, applicable policies, and the context surrounding the request.

1. The Basic AWS IAM Model

Consider an application running on an EC2 instance that needs to read an object from an S3 bucket.

Application
    |
    v
EC2 Instance
    |
    | assumes
    v
IAM Role
    |
    | permissions policy
    v
Allow: s3:GetObject
    |
    v
S3 Bucket

The core concepts involved are:

IAM Concept Purpose Example
IAM User Long-term AWS identity alice-admin
IAM Group Collection of IAM users Developers
IAM Role Identity that can be assumed EC2-S3-ReadRole
Policy Defines permissions Allow s3:GetObject
Principal Identity making a request User, Role, Service
Resource AWS object being accessed S3 bucket
Action AWS API operation s3:GetObject
Condition Additional authorization requirement MFA, Source IP, VPC, Tag

2. IAM Users

An IAM user is a persistent identity created within an AWS account.

AWS Account
|
|-- IAM User: Alice
|-- IAM User: Bob
|-- IAM User: AutomationUser

An IAM user may have:

  • A console password
  • Access keys
  • Permissions assigned through policies
  • Membership in IAM groups

Historically, companies commonly created an IAM user for every employee.
Modern AWS security architecture generally favors federated identities and temporary
credentials
instead.

Employee
   |
   v
Corporate Identity Provider
   |
   | SAML / Federation
   v
IAM Identity Center
   |
   v
AWS Account
   |
   v
IAM Role

This reduces the number of long-lived AWS credentials that an organization must manage.

3. IAM Groups

An IAM group is simply a collection of IAM users.

Developers Group
      |
      |-- Alice
      |-- Bob
      |-- Charlie

Policies can be attached to the group so that all members inherit those permissions.

Developers
    |
    v
DeveloperPolicy
    |
    |-- S3 Read
    |-- CloudWatch Read
    |-- Lambda Deployment

One important distinction is:

Roles can be assumed. Groups cannot.

Groups are primarily an administrative mechanism for managing IAM users.

4. IAM Roles

IAM roles are among the most important concepts in AWS security architecture.

A role is an AWS identity with permissions but normally without long-term credentials.
Instead, another principal assumes the role and receives temporary credentials.

Principal
    |
    | AssumeRole
    v
IAM Role
    |
    v
AWS STS
    |
    v
Temporary Credentials

AWS Security Token Service (STS) can return credentials containing:

  • Access Key ID
  • Secret Access Key
  • Session Token
  • Expiration time

Roles can be assumed by many different types of principals.

IAM Role
   ^
   |
   |-- IAM User
   |-- EC2
   |-- Lambda
   |-- ECS Task
   |-- Another AWS Account
   |-- Federated User
   |-- OIDC Identity
   |-- SAML Identity

5. Trust Policies vs. Permissions Policies

An IAM role has two very different authorization concepts.

Trust Policy

A trust policy answers:

Who is allowed to assume this role?

For example:

{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Principal": {
      "Service": "ec2.amazonaws.com"
    },
    "Action": "sts:AssumeRole"
  }]
}

This tells AWS that EC2 is trusted to assume the role.

Permissions Policy

The permissions policy answers:

What can the role do after it has been assumed?

{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::financial-data/*"
  }]
}

Together:

EC2
 |
 | allowed by Trust Policy
 v
IAM Role
 |
 | allowed by Permissions Policy
 v
S3

6. IAM Policies

IAM policies are JSON documents that describe permissions.

A typical policy statement contains:

Effect
   +
Action
   +
Resource
   +
Condition (optional)

For example:

{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::company-data/*"
  }]
}

7. Allow, Deny, and Implicit Deny

IAM policy statements use two Effect values:

  • Allow
  • Deny

AWS begins with the concept of implicit deny.
If no applicable policy allows the action, the request is denied.

Implicit Deny
     |
     v
Explicit Allow?
     |
    Yes
     |
     v
Potentially Allowed
     |
     v
Explicit Deny?
  /       \
Yes       No
 |         |
DENY     ALLOW

An applicable explicit Deny generally overrides an Allow.

8. IAM Actions

An IAM action corresponds to an AWS API operation.

Examples include:

s3:GetObject
s3:PutObject

ec2:StartInstances
ec2:StopInstances

kms:Decrypt

secretsmanager:GetSecretValue

lambda:InvokeFunction

Wildcards are possible:

"Action": "s3:*"

This allows every S3 action covered by the policy.

An even broader permission is:

"Action": "*"

This should be used cautiously because it can dramatically increase the blast radius of a compromised identity.

9. Resources and ARNs

AWS policies identify resources through Amazon Resource Names (ARNs).

For example:

arn:aws:s3:::financial-data

An object inside that bucket might be:

arn:aws:s3:::financial-data/reports/report.pdf

A policy can therefore restrict access to a specific path:

"Resource": "arn:aws:s3:::financial-data/reports/*"

This enables very granular authorization.

10. IAM Conditions

Conditions make IAM policies significantly more powerful.

Instead of simply saying:

Alice may access S3.

you can create a policy that effectively says:

Alice may access S3 only when certain security conditions are satisfied.

Allow s3:GetObject

IF

MFA = true
AND
Source network = approved
AND
Resource tag = Production

IAM conditions can evaluate attributes such as:

  • Source IP address
  • VPC
  • VPC endpoint
  • MFA state
  • Principal ARN
  • Principal tags
  • Resource tags
  • AWS Region
  • AWS Organization ID
  • TLS usage
  • Request tags

This makes IAM an important component of Zero Trust architecture.

11. Identity-Based Policies

Identity-based policies are attached to:

  • IAM users
  • IAM groups
  • IAM roles
IAM Role
   |
   v
Identity Policy
   |
   v
Allow s3:GetObject

The policy tells AWS what actions that identity is allowed to perform.

12. Resource-Based Policies

Some AWS resources support policies attached directly to the resource.

Examples include:

  • S3 bucket policies
  • KMS key policies
  • SQS queue policies
  • SNS topic policies
  • Secrets Manager resource policies
  • API Gateway resource policies
IAM Role
    |
    v
S3 Bucket
    |
    v
Bucket Policy

Resource-based policies are particularly important for cross-account architectures.

13. Identity Policy vs. Resource Policy

Suppose an application in Account A needs to access an S3 bucket in Account B.

Account A                         Account B

Application
    |
    v
IAM Role  ---------------------> S3 Bucket
    |                               |
Identity Policy                 Bucket Policy

The role may have permission to call:

s3:GetObject

while the bucket policy permits a specific principal:

arn:aws:iam::111111111111:role/AppRole

The identity policy represents authorization from the caller side, while the resource policy
represents authorization from the resource side.

14. AWS-Managed and Customer-Managed Policies

AWS-Managed Policies

AWS creates and maintains these policies.

Examples include:

ReadOnlyAccess
AmazonS3ReadOnlyAccess

They are convenient but may occasionally be broader than a particular workload requires.

Customer-Managed Policies

Customer-managed policies are created and maintained by your organization.

For example:

ProductionS3InvoiceReadOnly

These policies can be designed specifically around least-privilege requirements.

15. Inline Policies

An inline policy is embedded directly inside a single IAM user, group, or role.

IAM Role
   |
   |-- Managed Policy
   |
   |-- Inline Policy

Inline policies have a one-to-one relationship with the identity.
Managed policies are usually easier to centrally maintain and reuse.

16. Permissions Boundaries

Permissions boundaries are frequently misunderstood.

A permissions boundary does not grant permissions.
Instead, it establishes the maximum identity-based permissions an IAM user or role may receive.

Suppose a role policy says:

Allow:

s3:*
ec2:*
lambda:*

but its permissions boundary only permits:

s3:*
lambda:*

The EC2 permissions are outside the boundary and therefore cannot be exercised through those identity-based permissions.

Identity Policy
      |
      v
Permissions Requested
      |
      intersect
      |
Permissions Boundary
      |
      v
Effective Maximum

Permissions boundaries are particularly useful when delegating IAM administration.

For example, developers may be allowed to create IAM roles while a required permissions boundary
ensures that those roles can never obtain unrestricted administrative permissions.

17. Service Control Policies (SCPs)

AWS Organizations provides another major authorization layer called Service Control Policies.

AWS Organization
      |
      v
Organizational Unit
      |
      v
SCP
      |
      v
AWS Account
      |
      v
IAM Roles

SCPs define organization-level permission guardrails.

For example, an SCP may prevent accounts from:

  • Disabling CloudTrail
  • Leaving the AWS Organization
  • Using unsupported AWS Regions
  • Changing security services

Even if a role inside the account has:

AdministratorAccess

an applicable explicit Deny in an SCP can still block the operation.

18. Identity Policies, Permissions Boundaries, and SCPs

Mechanism Main Question
Identity Policy What may this identity do?
Permissions Boundary What is the maximum this identity may be granted?
Service Control Policy What permissions are available within this organization or account boundary?

Conceptually:

AWS Organization
      |
      v
     SCP
      |
      v
AWS Account
      |
      v
Permissions Boundary
      |
      v
IAM Role
      |
      v
Identity Policy
      |
      v
AWS Resource

Resource policies, trust policies, and explicit Deny statements introduce additional evaluation layers.

19. AWS STS and Temporary Credentials

AWS Security Token Service is fundamental to role-based security.

User / Application
       |
       | AssumeRole
       v
      STS
       |
       v
Temporary Credentials
       |
       v
AWS APIs

For example:

aws sts assume-role \
  --role-arn arn:aws:iam::123456789012:role/ProductionReadRole \
  --role-session-name audit-session

STS returns temporary credentials that expire automatically.

This is significantly preferable to distributing long-lived access keys across servers and applications.

20. EC2 IAM Roles

Applications running on EC2 should generally not store AWS access keys in files or environment variables.

Avoid:

EC2
 |
 |-- access-key.txt

Prefer:

EC2
 |
 v
Instance Profile
 |
 v
IAM Role
 |
 v
Temporary Credentials
 |
 v
AWS APIs

AWS SDKs can automatically obtain and refresh the temporary credentials associated with the role.

21. Lambda Execution Roles

AWS Lambda uses the same principle.

Lambda Function
       |
       v
Execution Role
       |
       |-- CloudWatch Logs
       |-- DynamoDB
       |-- S3
       |-- Secrets Manager

The Lambda role should contain only the permissions actually required by the function.

For example:

secretsmanager:GetSecretValue
dynamodb:PutItem
logs:CreateLogStream
logs:PutLogEvents

rather than attaching unrestricted administrative permissions.

22. Cross-Account Access

IAM roles are the standard mechanism for cross-account AWS access.

Security Account
111111111111

       |
       | AssumeRole
       v

Production Account
222222222222
       |
       v
SecurityAuditRole

The role in the Production account contains a trust policy allowing a principal from the Security
account to assume it.

This pattern is common in enterprise multi-account architectures with accounts such as:

  • Security
  • Networking
  • Logging
  • Shared Services
  • Development
  • Testing
  • Production

23. IAM Federation

Large enterprises generally avoid maintaining IAM users for every employee.
Instead, users authenticate through an enterprise identity provider.

Employee
    |
    v
Enterprise Identity Provider
    |
    |-- Microsoft Entra ID
    |-- Okta
    |-- Other IdP
    |
    v
IAM Identity Center
    |
    v
Permission Set
    |
    v
AWS Account / IAM Role

Federation enables centralized controls such as:

  • Multi-factor authentication
  • Employee onboarding
  • Employee termination
  • Conditional access
  • Centralized password policies
  • Group-based access assignments

24. AWS IAM Identity Center

AWS IAM Identity Center, formerly known as AWS Single Sign-On, provides centralized workforce
access across AWS accounts.

Microsoft Entra ID
       |
       v
IAM Identity Center
       |
       |-- Developers
       |-- Security
       |-- Administrators
              |
              v
        Permission Sets
              |
        +-----+-----+
        |     |     |
        v     v     v
       DEV   TEST  PROD

Common permission sets may include:

  • DeveloperAccess
  • SecurityAudit
  • DatabaseAdmin
  • ProductionReadOnly

This model works particularly well with AWS Organizations and multi-account landing zones.

25. How AWS Evaluates an IAM Request

When an AWS request occurs, AWS evaluates multiple authorization layers.

              API Request
                   |
                   v
          Authentication Valid?
                   |
                   v
          Applicable Policies
                   |
        +----------+----------+
        |          |          |
        v          v          v
    Identity    Resource      SCP
    Policies    Policies
        |
        +---- Permissions Boundary
        |
        v
      Evaluate
        |
        v
   Explicit Deny?
     /       \
   Yes       No
    |         |
   DENY       v
        Sufficient Allow?
           /       \
         Yes       No
          |         |
        ALLOW      DENY

The exact IAM policy evaluation process has important nuances, particularly when cross-account
access, resource policies, role sessions, and permissions boundaries are involved.

However, the essential rule remains:

An applicable explicit Deny wins.

26. IAM and AWS KMS

AWS Key Management Service adds another important authorization layer.

For encrypted resources you frequently need permission to access both the resource and the encryption key.

Application
     |
     v
IAM Role
     |
     |-- s3:GetObject
     |
     |-- kms:Decrypt
             |
             v
           KMS Key

For example, a user may successfully retrieve an encrypted S3 object but still be unable to
decrypt the object because the user or role cannot use the relevant KMS key.

KMS key policies therefore deserve special attention in AWS security architectures.

27. Attribute-Based Access Control (ABAC)

AWS IAM supports tag-based authorization through Attribute-Based Access Control.

Instead of creating separate policies for every department:

FinanceUserPolicy
HRUserPolicy
EngineeringUserPolicy
MarketingUserPolicy

you can use principal and resource attributes.

For example:

Principal Tag:

Department = Finance

and:

Resource Tag:

Department = Finance

The authorization policy can then conceptually state:

Allow access when:

Principal.Department
        =
Resource.Department

ABAC can significantly reduce the number of static IAM policies required in large environments.

28. RBAC vs. ABAC

Traditional IAM architectures often rely heavily on Role-Based Access Control.

User
 |
 v
Finance Role
 |
 v
Finance Resources

ABAC makes authorization decisions based on attributes instead.

User
Department=Finance
      |
      v
Policy Evaluation
      |
      v
Resource
Department=Finance

Many mature cloud architectures combine RBAC and ABAC.

29. A Typical Enterprise AWS IAM Architecture

A large AWS organization may implement IAM roughly as follows:

                    Corporate Identity
                           |
                           v
                 IAM Identity Center
                           |
                           v
                    Permission Sets
                           |
                           v
                   AWS Organizations
                           |
                           v
                          SCPs
                           |
              +------------+------------+
              |            |            |
              v            v            v
             DEV          TEST         PROD
              |            |            |
              v            v            v
          IAM Roles     IAM Roles     IAM Roles
              |
              v
       Permissions Boundaries
              |
              v
         IAM Policies
              |
              v
       Resource Policies
              |
              v
         AWS Resources

This should normally be surrounded by security monitoring and governance services such as:

  • AWS CloudTrail
  • AWS Config
  • IAM Access Analyzer
  • AWS Security Hub
  • Amazon GuardDuty
  • AWS Organizations
  • AWS Control Tower

30. AWS IAM Security Best Practices

Use Federation for Human Users

Avoid creating hundreds of permanent IAM users when enterprise federation through an identity
provider and IAM Identity Center can provide temporary access.

Use IAM Roles for Workloads

EC2, Lambda, ECS, EKS, and applications should generally use temporary role-based credentials
instead of embedded access keys.

Apply Least Privilege

Avoid policies such as:

"Action": "*",
"Resource": "*"

unless they are genuinely required.

Use SCPs as Enterprise Guardrails

SCPs can prevent entire classes of risky behavior across AWS Organizations.

Use Permissions Boundaries for Delegated IAM Administration

They help prevent administrators or developers from accidentally creating identities with more
permissions than intended.

Use Resource Policies Carefully

Resource-based policies are especially powerful in cross-account architectures and therefore
deserve careful review.

Use IAM Conditions

Conditions involving MFA, AWS Organizations, tags, VPC endpoints, networks, and other context can
dramatically reduce unnecessary access.

Continuously Review Permissions

IAM should not be considered a one-time configuration exercise.
Permissions should continuously be reviewed against actual usage and business requirements.

A Simple Way to Remember AWS IAM

A useful mental model is to think of IAM as five questions.

1. WHO ARE YOU?

   User
   Role
   Federated Identity

          |
          v

2. CAN YOU BECOME THIS IDENTITY?

   Authentication
   Federation
   Trust Policy

          |
          v

3. WHAT ARE YOU TRYING TO DO?

   AWS Action

          |
          v

4. WHAT ARE YOU TRYING TO DO IT TO?

   AWS Resource

          |
          v

5. ARE YOU ALLOWED?

   Identity Policy
   Resource Policy
   Permissions Boundary
   SCP
   Conditions
   Explicit Deny

Conclusion

AWS IAM becomes much easier to understand once you separate identity, authentication, role
assumption, authorization, and organization-level guardrails.

The most important concepts to understand are:

  • IAM users represent long-lived identities.
  • IAM groups organize users.
  • IAM roles provide assumable identities with temporary credentials.
  • Trust policies determine who can assume a role.
  • Permissions policies determine what that role can do.
  • Resource policies control access from the resource side.
  • Permissions boundaries establish maximum identity permissions.
  • SCPs establish organization-level guardrails.
  • STS provides temporary credentials.
  • IAM Identity Center provides centralized workforce access.
  • ABAC allows authorization decisions based on attributes and tags.

For cloud and security architects, the next step is understanding how
IAM policies, resource policies, Service Control Policies, permissions boundaries, trust
policies, and KMS key policies interact during AWS policy evaluation
.
That is where many of the most interesting—and most difficult—real-world IAM problems occur.

The post AWS IAM in Detail: Users, Roles, Policies, Federation, SCPs, and Permission Boundaries appeared first on AWS Security Architect.

]]>
https://awssecurityarchitect.com/aws-iam/531/feed/ 0 531
https://awssecurityarchitect.com/aws-machine-learning/529/ https://awssecurityarchitect.com/aws-machine-learning/529/#respond Thu, 20 Aug 2026 13:40:57 +0000 https://awssecurityarchitect.com/?p=529 Building an AI-Powered Fraud Detection System on AWS Modern fraud detection should no longer be viewed as a single machine-learning model that returns a fraud score. A production fraud platform […]

The post appeared first on AWS Security Architect.

]]>
Building an AI-Powered Fraud Detection System on AWS
Modern fraud detection should no longer be viewed as a single machine-learning model that returns a fraud score.
A production fraud platform can combine real-time event processing, behavioral features, machine learning,
deterministic controls, anomaly detection and agentic AI
.

On AWS, such a platform can be built using services including:

  • Amazon API Gateway
  • Amazon Kinesis Data Streams
  • AWS Lambda
  • Amazon S3
  • Amazon SageMaker AI
  • SageMaker Feature Store
  • Amazon DynamoDB
  • Amazon Aurora
  • Amazon Athena
  • Amazon Bedrock
  • Amazon Bedrock AgentCore
  • Bedrock Knowledge Bases

The central architectural principle is simple:

SageMaker predicts.

Rules enforce.

Bedrock investigates and explains.

The large language model should therefore not become the system directly authorizing or rejecting financial transactions.
Instead, machine learning and deterministic policies remain in the transaction decision path while generative AI assists
fraud analysts with investigation, correlation and explanation.

1. High-Level AWS Fraud Detection Architecture

                  TRANSACTION SOURCES
                         |
                         v
                Amazon API Gateway
                         |
                         v
               Amazon Kinesis Streams
                         |
             +-----------+-----------+
             |                       |
             v                       v
         AWS Lambda                Amazon S3
             |                     Data Lake
             v
     SageMaker Feature Store
             |
             v
       SageMaker Model
             |
             v
        Fraud Score
             |
      +------+------+ 
      |      |      |
      v      v      v
   APPROVE REVIEW  HOLD
             |      |
             +---+--+
                 |
                 v
          Bedrock AgentCore
                 |
                 v
        AI Fraud Investigator
                 |
       +---------+----------+
       |         |          |
       v         v          v
   Customer   Transaction   Fraud
    History     History    Knowledge
       |         |          |
       +---------+----------+
                 |
                 v
        Investigation Report
                 |
                 v
            Fraud Analyst

2. Real-Time Transaction Ingestion

Transactions can originate from many systems:

  • Credit-card payments
  • ACH payments
  • Wire transfers
  • Mobile banking
  • Online banking
  • Account-profile changes
  • Login events
  • Device telemetry
  • IP-address and geolocation telemetry

Amazon API Gateway can expose transaction APIs, while Amazon Kinesis Data Streams provides a scalable mechanism
for streaming the events through the fraud platform.

AWS Lambda can perform lightweight enrichment before the transaction is evaluated by the machine-learning model.

3. Feature Engineering: Where Much of the Fraud Intelligence Lives

A fraud model should rarely evaluate a transaction using the transaction amount alone.
The important information often comes from how the transaction differs from the customer’s historical behavior.

Consider a transaction for $7,500 when the customer’s typical transaction is approximately $310.

Current transaction = $7,500

Average transaction = $310

7,500 / 310 = 24.2

The transaction is therefore more than 24 times the customer’s normal transaction size.
That derived value may be substantially more useful to the model than the original transaction amount.

Useful fraud features might include:

amount_deviation

transaction_velocity_10m

transaction_velocity_24h

distance_from_last_transaction

new_device

new_beneficiary

ip_country_changed

failed_logins_24h

password_changed_recently

account_age

merchant_fraud_rate

historical_average_spend

device_risk_score

These features can be stored and managed through Amazon SageMaker Feature Store.

4. The SageMaker Fraud Model

For many financial-fraud problems, an excellent place to begin is a supervised model such as
XGBoost.

Fraud data is usually highly structured and tabular, making boosted decision-tree models particularly appropriate.
More sophisticated neural architectures can be introduced later if the problem and data justify the additional complexity.

A transaction presented to the model might contain features similar to:

fraud_features = {
    "amount": 7500,
    "account_age_days": 840,
    "transactions_last_10_min": 8,
    "distance_from_last_location": 1800,
    "new_device": 1,
    "new_beneficiary": 1,
    "merchant_risk_score": 0.74,
    "average_transaction": 310
}

The SageMaker model could return:

{
  "fraud_probability": 0.932,
  "risk": "HIGH"
}

5. Combine Classification with Anomaly Detection

Fraud systems do not necessarily need to rely on a single model.
A supervised fraud classifier can be combined with an anomaly-detection model.

                 Transaction
                      |
          +-----------+-----------+
          |                       |
          v                       v
   Classification Model      Anomaly Model
          |                       |
       Fraud .91              Anomaly .84
          |                       |
          +-----------+-----------+
                      |
                      v
               Combined Risk
                      |
                      v
                     .93

The first model detects patterns learned from previously identified fraud.
The anomaly model helps identify behavior that is simply unusual, including patterns the supervised model may never
have encountered before.

6. Keep the Real-Time Decision Engine Deterministic

The high-speed transaction path should remain relatively simple and deterministic.

Transaction
    |
    v
API Gateway
    |
    v
Lambda
    |
    v
Retrieve Features
    |
    v
SageMaker Endpoint
    |
    v
Fraud Probability
    |
    v
Decision Engine

A simple policy could look like this:

if fraud_score >= 0.90:
    decision = "HOLD"

elif fraud_score >= 0.70:
    decision = "MANUAL_REVIEW"

else:
    decision = "APPROVE"

A production decision engine could combine several independent signals:

Machine-Learning Score
        +
Business Rules
        +
Anomaly Score
        +
Device Risk
        +
Account Risk
        |
        v
 Final Risk Score

7. Add an AI Fraud Investigation Agent

Once a transaction crosses a fraud threshold, the case can be routed to an agentic AI investigation layer built
with Amazon Bedrock and Amazon Bedrock AgentCore.

Suppose the fraud engine reports:

Transaction: TX-88121
Fraud Probability: 93.2%
Risk Level: HIGH

The fraud investigation agent can collect evidence from multiple systems.

Fraud Investigation Agent
          |
          +-- Retrieve transaction details
          |
          +-- Retrieve transaction history
          |
          +-- Retrieve customer behavior
          |
          +-- Retrieve device history
          |
          +-- Retrieve IP/geolocation history
          |
          +-- Retrieve model explanation
          |
          +-- Search similar fraud cases
          |
          +-- Retrieve relevant fraud policies

The agent can then convert technical signals into a concise investigation report.

FRAUD INVESTIGATION REPORT

Risk: HIGH
Fraud Probability: 93.2%

Primary Indicators

1. Transaction amount is 24x the customer's normal transaction.

2. The device has never previously accessed the account.

3. The transaction originated approximately 1,800 miles
   from the customer's previous transaction location.

4. A new beneficiary was created 11 minutes before
   the transfer.

5. Eight transactions were attempted during the
   previous ten minutes.

6. Similar patterns exist in previously confirmed
   fraud cases.

Recommended Action:

HOLD TRANSACTION

Require step-up authentication and analyst review.

8. Give the Agent Tools, Not Direct Database Access

One of the most important AI-security controls is preventing the LLM from having unrestricted database access.

The agent should instead receive narrowly scoped tools such as:

get_transaction()

get_customer_profile()

get_transaction_history()

get_device_history()

get_ip_history()

get_fraud_score()

retrieve_similar_cases()

retrieve_fraud_policy()

create_investigation()

These tools can invoke Lambda functions or controlled services that enforce authorization before accessing
DynamoDB, Aurora, Athena, SageMaker or internal APIs.

The preferred pattern is:

LLM
 |
 v
Agent Tool
 |
 v
Authorization
 |
 v
Retriever / Data Access Layer
 |
 +-- RBAC / ACL enforcement
 |
 +-- Sensitive-data filtering
 |
 +-- Query validation
 |
 +-- Audit logging
 |
 v
Enterprise Data

This is effectively the traditional Data Access Layer pattern applied to enterprise AI.

9. Build a Fraud Knowledge Base with RAG

Fraud investigators require more than transactional data.
They also need institutional knowledge.

A Bedrock Knowledge Base can contain information such as:

  • Fraud policies
  • Historical fraud investigations
  • Known attack patterns
  • Investigation playbooks
  • AML procedures
  • Device-risk guidance
  • Regulatory guidance
  • Internal security procedures
             Fraud Knowledge Base
                     |
       +-------------+-------------+
       |             |             |
       v             v             v
 Fraud Policies   Past Cases   Regulations
       |             |             |
       +-------------+-------------+
                     |
                     v
                Bedrock RAG
                     |
                     v
            Investigation Agent

Retrieval-Augmented Generation, or RAG, allows the model to reason against enterprise information instead of relying
entirely on the information embedded in the foundation model.

10. Explainable Fraud Detection

A fraud analyst needs more than a score.

Instead of returning only:

Fraud Probability = 93%

the system should capture the factors that contributed to that probability.

Risk Feature Contribution
New device +21%
New beneficiary +18%
Transaction velocity +17%
Geographic anomaly +15%
Transaction amount anomaly +13%
IP risk +6%

The generative AI layer can then translate these model signals into an explanation understandable by a fraud analyst,
customer-service representative or investigator.

11. The Fraud Analyst Interface

The analyst should receive a consolidated view of the case rather than searching across numerous systems.

--------------------------------------------------

            FRAUD INVESTIGATION

Transaction: TX-88121

Fraud Score                  93%
Risk                         HIGH
Recommended Action           HOLD

--------------------------------------------------

Top Risk Indicators

New Device                   HIGH
Geo Anomaly                  HIGH
Transaction Velocity         HIGH
New Beneficiary              HIGH
Amount Anomaly               MEDIUM

--------------------------------------------------

AI Investigation

The transaction differs significantly from the
customer's historical behavior...

[View Evidence]

--------------------------------------------------

     APPROVE      HOLD      CONFIRM FRAUD

--------------------------------------------------

12. Create a Continuous Fraud-Learning Loop

The fraud analyst’s decision should not disappear after the investigation is complete.
It represents extremely useful labeled training data.

AI Prediction
     |
     v
Analyst Decision
     |
     v
Confirmed Fraud
or
Legitimate Transaction
     |
     v
Training Dataset
     |
     v
Model Evaluation
     |
     v
SageMaker Retraining

Over time, analyst decisions create a feedback mechanism through which the fraud model can learn from new attack
techniques and changing customer behavior.

13. The Complete AWS Architecture

                   BANKING / PAYMENT SYSTEMS
                             |
                             v
                    Amazon API Gateway
                             |
                             v
                   Amazon Kinesis Streams
                             |
               +-------------+-------------+
               |                           |
               v                           v
           AWS Lambda                    Amazon S3
               |                         Data Lake
               v                            |
     SageMaker Feature Store                |
               |                            |
               v                            v
        SageMaker Endpoint             Glue / Athena
               |
               v
         Fraud Probability
               |
               v
         Decision Engine
               |
       +-------+--------+
       |       |        |
       v       v        v
    APPROVE  REVIEW    HOLD
               |        |
               +---+----+
                   |
                   v
          Amazon Bedrock AgentCore
                   |
                   v
           Fraud Investigator
                   |
       +-----------+------------+
       |           |            |
       v           v            v
   Agent Tools   Knowledge    SageMaker
                   Base       Explanation
       |
  +----+-----+------+
  |          |      |
  v          v      v
DynamoDB   Aurora  Athena
                   |
                   v
          Investigation Report
                   |
                   v
             Fraud Analyst
                   |
                   v
           Analyst Decision
                   |
                   v
             Training Data
                   |
                   v
         SageMaker Retraining

14. Three Layers of Fraud Intelligence

Perhaps the most useful way to understand the architecture is as three separate intelligence layers.

Layer 1: Deterministic Rules

New Beneficiary
+
Large Transfer
+
Recently Changed Password
=
Require Additional Verification

Rules provide predictable security controls for conditions the institution already understands.

Layer 2: Machine Learning

Customer Behavior
+
Transaction History
+
Device Signals
+
Velocity
+
Geography
       |
       v
SageMaker
       |
       v
Fraud Probability = 93%

Machine learning identifies combinations of signals that are too complex to represent through manually maintained rules.

Layer 3: Agentic AI

Fraud Alert
    |
    v
Bedrock Agent
    |
    +-- Why is this suspicious?
    |
    +-- What evidence supports the alert?
    |
    +-- Have we seen similar cases?
    |
    +-- What policy applies?
    |
    +-- What should the analyst investigate?

This layer is not intended to replace the fraud model.
Its role is to investigate, correlate, retrieve, summarize and explain.

15. Why the LLM Should Not Directly Approve Financial Transactions

It may be tempting to place a generative AI model directly in the transaction-decision path.
That would usually be a poor architecture.

Generative models are probabilistic systems.
Financial authorization controls frequently require deterministic behavior, clear thresholds, explainability,
auditability and repeatability.

A safer separation of responsibilities is:

Technology Primary Responsibility
Business Rules Enforce known fraud and financial controls
Amazon SageMaker Predict fraud probability and detect anomalies
Amazon Bedrock Reason over evidence and enterprise knowledge
Bedrock AgentCore Orchestrate investigation workflows and tools
Fraud Analyst Make high-risk investigation decisions requiring human judgment

16. Moving Toward a Multi-Agent Fraud Platform

The architecture can eventually evolve beyond a single fraud agent.
A financial institution could create specialized agents responsible for different categories of fraud.

                 FRAUD SUPERVISOR AGENT
                          |
          +---------------+---------------+
          |               |               |
          v               v               v
    Transaction       Account        Identity /
    Fraud Agent       Behavior       Takeover Agent
                      Agent
          |               |               |
          +---------------+---------------+
                          |
                          v
                Correlated Risk View
                          |
                          v
                 Fraud Investigation

For example:

  • Transaction Fraud Agent: Investigates unusual payments, transfers and merchant activity.
  • Account Behavior Agent: Looks for changes in transaction velocity, beneficiaries and account behavior.
  • Identity/Account-Takeover Agent: Investigates device, login, authentication and geolocation anomalies.
  • Fraud Supervisor Agent: Correlates findings and produces a unified case for the investigator.

This transforms the architecture from a traditional fraud-scoring system into an
agentic fraud operations platform.

Conclusion

The next generation of fraud detection is unlikely to be built around a single AI model.
Instead, it will combine multiple forms of intelligence.

Rules
  +
Machine Learning
  +
Anomaly Detection
  +
Enterprise Data
  +
RAG
  +
Agentic AI
  +
Human Investigation

Amazon SageMaker can determine whether a transaction resembles fraudulent behavior.
Traditional rules can enforce known financial controls.
Amazon Bedrock and AgentCore can investigate why the transaction was flagged, correlate evidence,
retrieve relevant institutional knowledge and explain the case to an analyst.

The architectural principle remains:

SageMaker predicts. Rules enforce. Bedrock investigates.

That separation creates a system that can take advantage of modern generative and agentic AI without placing
a probabilistic language model directly in control of financial authorization decisions.

 

The post appeared first on AWS Security Architect.

]]>
https://awssecurityarchitect.com/aws-machine-learning/529/feed/ 0 529
AWS API Gateway vs AWS WAF: Features, Differences and Architecture https://awssecurityarchitect.com/apis-on-aws/aws-api-gateway-vs-aws-waf-features-differences-and-architecture/ https://awssecurityarchitect.com/apis-on-aws/aws-api-gateway-vs-aws-waf-features-differences-and-architecture/#respond Mon, 17 Aug 2026 17:54:45 +0000 https://awssecurityarchitect.com/?p=526 AWS API Gateway vs AWS WAF: Features, Differences and Architecture AWS API Gateway vs. AWS WAF: What’s the Difference? AWS API Gateway and AWS WAF are both commonly found at […]

The post AWS API Gateway vs AWS WAF: Features, Differences and Architecture appeared first on AWS Security Architect.

]]>
AWS API Gateway vs AWS WAF: Features, Differences and Architecture

AWS API Gateway vs. AWS WAF: What’s the Difference?

AWS API Gateway and AWS WAF are both commonly found at the front of modern AWS applications. Because both can control incoming HTTP traffic—and both provide some form of rate limiting—they are sometimes confused with each other.

However, they solve fundamentally different problems:

AWS API Gateway manages APIs. AWS WAF protects applications and APIs from malicious or unwanted HTTP traffic.

In a well-designed architecture, they are often used together rather than as alternatives.


What Is AWS API Gateway?

Amazon API Gateway is a managed service for creating, publishing, securing, monitoring, and operating APIs.

It acts as the front door to your application’s backend services.

A simple serverless architecture might look like this:

Client
   │
   │ HTTPS
   ▼
AWS API Gateway
   │
   ├── Authenticate
   ├── Authorize
   ├── Validate API request
   ├── Apply throttling
   ├── Log request
   └── Route request
   │
   ▼
AWS Lambda
   │
   ▼
DynamoDB

API Gateway can expose APIs backed by services such as:

  • AWS Lambda
  • HTTP services
  • Applications running on EC2
  • Containerized applications
  • Other AWS services

API Gateway supports REST APIs, HTTP APIs, and WebSocket APIs.


Major AWS API Gateway Features

Feature API Gateway
REST APIs ✅
HTTP APIs ✅
WebSocket APIs ✅
Backend routing ✅
Lambda integration ✅
IAM authorization ✅
Cognito authorization ✅
Lambda authorizers ✅
JWT authorization ✅, depending on API type
API keys ✅
Usage plans ✅, REST APIs
Client quotas ✅
Request throttling ✅
Request/response transformation ✅
API stages ✅
Canary deployments ✅
Custom domains ✅
CloudWatch monitoring ✅
X-Ray integration ✅
Response caching ✅, REST APIs

The important point is that API Gateway understands the concept of an API consumer and API operation.

For example:

Customer A
    │
 API Key
    │
    ▼
API Gateway
    │
    ├── Authenticate
    ├── Authorize
    ├── Check quota
    ├── Check throttle
    └── POST /orders
           │
           ▼
        Lambda

API Gateway can therefore enforce rules associated with how clients consume an API.


What Is AWS WAF?

AWS WAF (Web Application Firewall) is a Layer-7 security service designed to inspect HTTP/S traffic and determine whether requests should be allowed, blocked, counted, challenged, or presented with CAPTCHA.

Its primary concern is not:

“Which backend should receive this API call?”

Instead, WAF is asking:

“Should I allow this HTTP request through at all?”

For example:

Internet
   │
   ▼
AWS WAF
   │
   ├── Source IP?
   ├── Country?
   ├── SQL injection?
   ├── XSS?
   ├── Malicious bot?
   ├── Suspicious request?
   └── Excessive traffic?
   │
   ▼
Application / API

Major AWS WAF Features

AWS WAF provides capabilities such as:

Feature AWS WAF
IP blocking ✅
IP allowlists ✅
Geo-blocking ✅
Header inspection ✅
URI inspection ✅
Query-string inspection ✅
Request-body inspection ✅
Regex/string matching ✅
SQL injection protection ✅
Cross-site scripting protection ✅
AWS Managed Rules ✅
Custom security rules ✅
Rate-based rules ✅
Bot protection ✅
CAPTCHA ✅
Browser challenge ✅
Request monitoring/counting ✅

For example, an organization could create WAF rules that say:

IF request originates from blocked country
    → BLOCK

IF request contains SQL injection pattern
    → BLOCK

IF request originates from known malicious IP
    → BLOCK

IF suspicious client exceeds rate threshold
    → BLOCK / CHALLENGE

This is fundamentally different from API management.


AWS API Gateway vs. AWS WAF

The easiest way to understand the difference is to compare their responsibilities.

Capability API Gateway AWS WAF
Expose an API ✅ ❌
Route API requests ✅ ❌
REST API management ✅ ❌
Authentication ✅ ❌
Authorization ✅ ❌
API keys ✅ ❌
Usage plans ✅ ❌
Client quotas ✅ ❌
API throttling ✅ ❌
Security rate-based rules ❌ ✅
IP filtering Limited via policies ✅
Geo-blocking ❌ ✅
SQL injection protection ❌ ✅
XSS protection ❌ ✅
Bot protection ❌ ✅
CAPTCHA/challenge ❌ ✅
Managed attack rules ❌ ✅
Backend integration ✅ ❌
Lambda integration ✅ ❌
Request transformation ✅ ❌
API lifecycle/deployment ✅ ❌

There is, however, one area where the distinction can become confusing: rate limiting.


API Gateway Throttling vs. WAF Rate Limiting

Both services can limit requests, but they do so for different reasons.

API Gateway Throttling

API Gateway throttling is primarily concerned with API consumption and backend capacity.

For example:

Customer A
    │
    │ API Key
    │
    │ 100 requests/sec
    ▼
API Gateway

The business requirement might be:

Customer A should be permitted to consume approximately 100 requests per second.

You may also have different consumption limits for different customers or API products.

Basic Customer
      │
      └── Lower quota

Premium Customer
      │
      └── Higher quota

Enterprise Customer
      │
      └── Highest quota

This is API consumption management.


WAF Rate Limiting

WAF rate-based rules are primarily a security control.

Suppose one IP suddenly generates thousands of requests:

Suspicious Client
      │
      │
      │ 10,000 requests
      │
      ▼
    AWS WAF
      │
      ├── Rate threshold exceeded
      │
      └── BLOCK / CHALLENGE

The question WAF is answering isn’t:

“What API subscription does this customer have?”

Instead, it is:

“Does this traffic pattern represent something I should block or challenge?”

This makes WAF rate-based rules useful for mitigating abusive traffic, bots, scraping, credential attacks, and certain application-layer denial-of-service patterns.


A Simple Way to Remember the Difference

Think about the questions each service is trying to answer.

AWS WAF asks:

Is this request safe and acceptable?

It looks at things such as:

  • Source IP
  • Geography
  • Request patterns
  • SQL injection
  • XSS
  • Bots
  • Suspicious request rates

API Gateway asks:

Who is calling my API,
what are they allowed to call,
how much may they consume,
and where should the request go?

It handles things such as:

  • Authentication
  • Authorization
  • API keys
  • Usage plans
  • Quotas
  • Throttling
  • API routing
  • Backend integration

API Gateway and WAF Are Usually Used Together

For a public-facing API, a stronger architecture uses both services.

                     Internet
                        │
                        ▼
                ┌───────────────┐
                │    AWS WAF    │
                │               │
                │ SQLi / XSS    │
                │ IP filtering  │
                │ Geo blocking  │
                │ Bot control   │
                │ Rate rules    │
                └───────┬───────┘
                        │
                        ▼
               ┌─────────────────┐
               │   API Gateway   │
               │                 │
               │ Authentication  │
               │ Authorization   │
               │ API Keys        │
               │ Usage Plans     │
               │ Throttling      │
               │ Routing         │
               └────────┬────────┘
                        │
                        ▼
                     Lambda
                        │
                        ▼
                    DynamoDB

This creates multiple layers of protection.


What Happens When a Request Arrives?

Conceptually, the security flow becomes:

Incoming Request
       │
       ▼
    AWS WAF
       │
       ├── Is source IP allowed?
       ├── Is geography allowed?
       ├── SQL injection?
       ├── XSS?
       ├── Malicious bot?
       └── Excessive traffic?
       │
       ▼
  API Gateway
       │
       ├── Who are you?
       ├── Are you authenticated?
       ├── Are you authorized?
       ├── Which API are you calling?
       ├── Are you within your quota?
       └── Where should this request go?
       │
       ▼
    Backend

This is a good example of defense in depth.

WAF performs application-layer traffic filtering before the request reaches the API-management and application layers.

API Gateway then applies API-specific controls before forwarding the request to the backend.


What About Authentication?

Another important distinction is that WAF is not an identity system.

You should not think of WAF as replacing IAM, Cognito, JWT validation, or an API authorizer.

Authentication might instead look like:

Internet
   │
   ▼
AWS WAF
   │
   │ Security filtering
   ▼
API Gateway
   │
   ├── Cognito
   ├── IAM
   ├── JWT
   └── Lambda Authorizer
   │
   ▼
Application

This separates three important security responsibilities:

WAF
 │
 └── Is the HTTP request acceptable?

API Gateway
 │
 └── Is the API request valid and permitted?

Application
 │
 └── Is the requested business operation allowed?

That separation becomes increasingly important in enterprise architectures.


Where Does CloudFront Fit?

For internet-facing applications, another common architecture introduces Amazon CloudFront:

Internet
   │
   ▼
CloudFront
   │
   ▼
AWS WAF
   │
   ▼
API Gateway
   │
   ▼
Lambda
   │
   ▼
DynamoDB

CloudFront provides global edge delivery and caching, while WAF provides Layer-7 filtering and API Gateway provides API management.

The responsibilities remain distinct:

CloudFront
     │
     └── Global delivery / edge

AWS WAF
     │
     └── Application security

API Gateway
     │
     └── API management

Lambda
     │
     └── Application logic

DynamoDB
     │
     └── Data

AWS vs. GCP Equivalent Services

For architects working across AWS and Google Cloud, the high-level mapping is:

AWS Google Cloud Purpose
AWS WAF Cloud Armor Layer-7 application protection
Amazon API Gateway Google Cloud API Gateway Managed API gateway
Amazon API Gateway / broader API-management patterns Apigee Enterprise API management
AWS Lambda Cloud Run / Cloud Functions Serverless compute
CloudWatch Cloud Logging / Cloud Monitoring Observability

The equivalent GCP architecture might therefore look like:

AWS                           GCP

Internet                     Internet
   │                            │
   ▼                            ▼
AWS WAF                    Cloud Armor
   │                            │
   ▼                            ▼
API Gateway            API Gateway / Apigee
   │                            │
   ▼                            ▼
Lambda                Cloud Run / Functions

Which One Should You Use?

The answer is usually not API Gateway or WAF.

If you need to expose and manage APIs, use API Gateway.

If you need to protect HTTP applications and APIs against malicious or unwanted traffic, use AWS WAF.

For important public-facing APIs, consider using both:

Internet
   │
   ▼
WAF
   │
   │ Security boundary
   ▼
API Gateway
   │
   │ API management boundary
   ▼
Application
   │
   │ Business authorization boundary
   ▼
Data

Each layer solves a different problem.


Final Takeaway

The simplest distinction is:

AWS WAF determines whether an HTTP request should be allowed to reach your application.

AWS API Gateway determines how an API request should be authenticated, authorized, controlled, and routed to a backend.

API Gateway is an API management service.

AWS WAF is an application security service.

Used together, they provide a much stronger architecture than either service provides by itself.

The post AWS API Gateway vs AWS WAF: Features, Differences and Architecture appeared first on AWS Security Architect.

]]>
https://awssecurityarchitect.com/apis-on-aws/aws-api-gateway-vs-aws-waf-features-differences-and-architecture/feed/ 0 526
ALBs with EC2 instances https://awssecurityarchitect.com/albs-on-aws/albs-with-ec2-instances/ https://awssecurityarchitect.com/albs-on-aws/albs-with-ec2-instances/#respond Mon, 12 Jan 2026 18:50:24 +0000 https://awssecurityarchitect.com/?p=509 <!doctype html>   AWS ALB to Protect Instances with Public IPs (Elaborated) If your EC2 instances have public IPs, an AWS Application Load Balancer (ALB) can help — but the […]

The post ALBs with EC2 instances appeared first on AWS Security Architect.

]]>
<!doctype html>

 

AWS ALB to Protect Instances with Public IPs (Elaborated)

If your EC2 instances have public IPs, an AWS Application Load Balancer (ALB) can help
— but the strongest security improvement is using the ALB to eliminate direct internet reachability
to those instances.

Best practice: Make the ALB the only internet-facing endpoint and place compute in
private subnets with no public IPs.

1) Best-Practice Architecture: Public ALB, Private Instances

  • ALB: internet-facing, deployed in public subnets
  • Targets (EC2/ECS/EKS): deployed in private subnets, no public IPs
  • Security Groups:
    • ALB SG: allow 443 (and optionally 80 for redirect) from approved sources
    • Instance SG: allow app port(s) only from the ALB SG

Protection You Gain

  • No direct scanning/exploitation of instances from the internet (instances are not reachable)
  • Centralized TLS termination (ACM certs, modern cipher policies, redirects)
  • Single ingress choke-point for WAF, routing rules, and logging
  • Health checks reduce exposure to unhealthy nodes

2) If Instances Already Have Public IPs: How ALB Still Helps

You can still place an ALB in front of instances that have public IPs, but you must ensure those instances are
not directly reachable by tightening security groups.

Pattern: “ALB in Front, Public IPs Exist but Are Useless”

  • Keep public IPs on instances (not ideal, but sometimes required temporarily)
  • Instance SG inbound rules:
    • Remove inbound from 0.0.0.0/0 (and ::/0) to app ports
    • Allow app port(s) only from the ALB Security Group
  • Administrative access: do not expose SSH/RDP to the internet. Use:
    • AWS Systems Manager Session Manager (preferred)
    • or a bastion host with strict IP allowlist
    • or VPN/Direct Connect
Key point: A public IP is not “safe” just because an ALB exists. It becomes safe when
security groups (and NACLs, if used) block all direct inbound except from the ALB.

3) What ALB Protects You From (and Enables)

3.1 Architectural Protection: Remove Direct Exposure

  • Forces a single entry point (ALB)
  • Reduces attack surface by preventing direct-to-instance traffic

3.2 TLS Termination & Policy Enforcement

  • Centralized certificate management with AWS Certificate Manager (ACM)
  • HTTP to HTTPS redirects
  • Consistent TLS policies across apps

3.3 Attach AWS WAF to ALB

WAF is usually where “web protection” lives (not the ALB alone).

  • Managed rule groups (OWASP-style, known patterns and bots)
  • Rate limiting / throttling
  • Geo restrictions / allowlists
  • Custom rules for paths, headers, payload patterns

3.4 Observability & Audit Trails

  • ALB access logs to S3
  • CloudWatch metrics (4xx/5xx, target response time)
  • Centralized view of traffic and anomalies (especially with WAF logs)

3.5 Safer Deployments

  • Health checks and target group routing
  • Blue/green and canary releases via weighted target groups

4) What ALB Does NOT Protect You From

  • Compromise via other vectors (stolen credentials, SSRF, supply chain issues)
  • Non-HTTP(S) protocols (ALB is Layer 7; for TCP/UDP you typically need an NLB)
  • Direct-to-instance access if inbound rules still allow it
  • Large-scale DDoS by itself (use AWS Shield + WAF + architecture)

5) Recommended Secure Internet Application Stack

  • CloudFront (optional but strong) → WAFALBPrivate compute
  • Instances: no public IPs
  • Admin access: SSM Session Manager
  • Centralized logging: CloudTrail, ALB/WAF logs → S3 (with retention/immutability controls)

6) Quick Checklist

  • EC2 targets in private subnets with no public IPs
  • Instance SG inbound allows app ports only from ALB SG
  • No SSH/RDP from the internet; use SSM or VPN/bastion
  • Attach AWS WAF to ALB (or CloudFront)
  • Enable ALB access logs (and WAF logs if used)
  • Enforce HTTPS (redirect + hardened TLS policy)

7) Example Security Group Intent (Conceptual)

ALB Security Group (Inbound)
- TCP 443 from approved sources (0.0.0.0/0 or stricter allowlist)
- TCP 80 optional (redirect to 443)

Instance Security Group (Inbound)
- App Port (e.g., TCP 80/443/8080) ONLY from ALB Security Group
- Admin ports: NONE from internet (use SSM/VPN/Bastion)

Outbound (Both)
- As required (prefer least privilege; consider egress controls/proxy)

 

The post ALBs with EC2 instances appeared first on AWS Security Architect.

]]>
https://awssecurityarchitect.com/albs-on-aws/albs-with-ec2-instances/feed/ 0 509
Shared VPCs for Production and Non Production Assets https://awssecurityarchitect.com/shared-vpcs/shared-vpcs-for-production-and-non-production-assets/ https://awssecurityarchitect.com/shared-vpcs/shared-vpcs-for-production-and-non-production-assets/#respond Fri, 05 Dec 2025 18:25:49 +0000 https://awssecurityarchitect.com/?p=504 Overview A Shared VPC lets one AWS account (the Host) own a VPC and subnets and share those subnets with other AWS accounts (the Participants). This pattern centralizes networking while […]

The post Shared VPCs for Production and Non Production Assets appeared first on AWS Security Architect.

]]>

Overview

A Shared VPC lets one AWS account (the Host) own a VPC and subnets and share those subnets with other AWS accounts (the Participants). This pattern centralizes networking while keeping workload control in the participant accounts.

High-level approach

  • Create separate subnet groups for prod and non-prod inside the host VPC.
  • Participant accounts deploy workloads (EC2, RDS, EKS, etc.) which attach ENIs into those shared subnets.
  • Host account manages routing, firewalls, NAT, endpoints, DNS and logging — not application compute.

What belongs in the Host VPC account

This account is your centralized networking account. Typical items:

  • The VPC and its CIDR(s).
  • Subnets — clearly labeled and separated for prod vs non-prod (e.g. Prod-App-Subnet-A, NonProd-DB-Subnet-A).
  • Route tables, IGW, VGW/TGW attachments.
  • Network appliances: NAT gateways, centralized firewall (AWS Network Firewall or 3rd party), IDS/IPS, etc.
  • VPC endpoints (S3, DynamoDB, Systems Manager) and endpoint policies.
  • DNS (Route 53 Resolver endpoints) and centralized logging/flow-logs.

Do not run application compute in the Host account — keep it a networking services account to reduce blast radius and permission complexity.

What belongs in the Participant accounts

Participant accounts own the workloads and most of the application-level controls:

  • Compute: EC2, ECS tasks, EKS worker nodes & pods (that create ENIs), Lambda functions (if VPC-enabled), etc.
  • Managed database resources such as RDS / Aurora (service ENIs attach to shared subnets).
  • Security groups — participants create and manage their own SGs.
  • Deployment pipelines, application IAM roles, monitoring/alerting agents.

Participants cannot modify VPC-level objects (subnets, route tables, IGW/TGW) — this restriction provides network control and safety.

Segmenting Production vs Non-Production

Key controls to host both environments safely in one shared VPC:

  • Subnet separation: distinct subnets for Prod and Non-Prod, ideally across multiple AZs.
  • Routing: Prod subnets route to prod-specific firewalls / TGW attachments; non-prod routes to non-prod appliances.
  • Network-level filtering: security groups, NACLs, and firewall policies that strictly control cross-environment traffic.
  • Org policy & IAM: use AWS Organizations SCPs, IAM role boundaries and least privilege to prevent privilege escalation between envs.
  • Separate logging & monitoring: keep prod logs and metrics isolated or labeled and access-controlled.

Example subnet layout (recommended)

Subnet Purpose Shared To
Prod-App-Subnet-A/B/C Production application tier (multi-AZ) Production participant accounts
Prod-DB-Subnet-A/B Production databases (private) Production participant accounts
NonProd-App-Subnet-A/B/C Dev/Test application tier Dev/Test participant accounts
NonProd-DB-Subnet-A/B Non-prod databases Dev/Test participant accounts
Shared-Services-Subnet Centralized services: logging, bastion, SSM endpoints Shared-services account + selected participants

Routing & NAT recommendations

  • Use separate NAT Gateways for prod and non-prod to avoid accidental traffic mixing and to charge-back costs accurately.
  • Route prod traffic through prod firewall or dedicated TGW attachment.
  • Consider Transit Gateway + route tables to control cross-account connectivity at scale.

Governance & security controls

  • Enforce AWS Organizations SCPs to block participant accounts from creating or modifying VPC infrastructure.
  • Use IAM and resource-based policies to restrict who can share/attach subnets.
  • Apply strict endpoint policies for VPC endpoints (S3, Secrets Manager, etc.) to control access by environment.
  • Use separate monitoring/alerting channels and RBAC for prod vs non-prod.

When NOT to share a VPC

Consider separate VPCs if any of the following are true:

  • You require absolute network separation for compliance (PCI-DSS, FedRAMP, HIPAA) with independent audit trails.
  • The environments have fundamentally different routing/firewall/peering needs that are hard to satisfy with one VPC.
  • You lack governance to centrally control network configuration and access.

Recommended organization structure (example)

The post Shared VPCs for Production and Non Production Assets appeared first on AWS Security Architect.

]]> https://awssecurityarchitect.com/shared-vpcs/shared-vpcs-for-production-and-non-production-assets/feed/ 0 504 DNS Isolation on AWS https://awssecurityarchitect.com/aws-network-security/dns-isolation-on-aws/ https://awssecurityarchitect.com/aws-network-security/dns-isolation-on-aws/#respond Tue, 25 Nov 2025 20:11:40 +0000 https://awssecurityarchitect.com/?p=500 DNS Isolation on AWS: Route 53 Resolver, DNS Firewall & Private DNS DNS Isolation on AWS DNS isolation on AWS refers to designing your Amazon Web Services environment so that […]

The post DNS Isolation on AWS appeared first on AWS Security Architect.

]]>
DNS Isolation on AWS: Route 53 Resolver, DNS Firewall & Private DNS


dns isolation aws
dns isolation aws

DNS Isolation on AWS

DNS isolation on AWS refers to designing your Amazon Web Services environment so that certain workloads or networks can only resolve DNS names you explicitly allow, while blocking or segregating access to all other DNS sources—internal or external.

It is often used for security-sensitive, regulated, or multi-tenant architectures where you want to strictly control what resources can discover each other via DNS.

What DNS Isolation Means

DNS isolation ensures that a workload or subnet does not automatically inherit DNS visibility from the broader VPC or the internet. Instead, you tightly control where it gets DNS answers from (e.g., Route 53 Resolver rules, inbound/outbound resolvers, private hosted zones).

  • Isolates DNS Resolution Paths: Prevents workloads from resolving public DNS names or internal/private AWS names not intended for them.
  • Controls Resource Discovery: Restricts which internal services can be discovered by name.
  • Prevents Data Exfiltration via DNS: Cuts off malware from using DNS to exfiltrate data.

How to Implement DNS Isolation in AWS

1. Disable the Default VPC Resolver

At the subnet level, set enableDnsSupport = false or override DNS servers via DHCP option sets to force workloads to use only your DNS servers.

2. Use Custom DNS Servers or Route 53 Resolver Endpoints

Point instances/subnets to custom DNS appliances or Route 53 outbound resolver endpoints with controlled forwarding rules.

3. Use Route 53 Resolver Rules for Fine-Grained Control

Define conditional forwarding rules, e.g.:

  • corp.local → internal DNS server
  • serviceA.internal → specific resolver
  • Block everything else

4. Private Hosted Zones (PHZs) for Segregation

Attach PHZs only to specific VPCs to achieve multi-tenant DNS isolation and environment separation (dev vs prod).

5. Use Security Groups or Route 53 Resolver DNS Firewall

Create DNS firewall rule groups to:

  • Allow only approved domains
  • Block malware/TLDs
  • Prevent access to external DNS servers

Common Use Cases for DNS Isolation

  • Zero-Trust Network Design: Only authorized services resolve each other.
  • Regulated Workloads: Ensures workloads resolve only internal names (HIPAA, FedRAMP, PCI).
  • Multi-Tenant SaaS Platforms: Each tenant/VPC uses separate PHZs and resolver rules.
  • Highly-Sensitive Internal Apps: Prevents accidental communication.
  • Preventing Data Exfiltration: Blocks DNS tunneling by design.

Example Architecture for Isolated DNS

VPC (DNS Support Disabled)
   |
   +-- DHCP Option Set: DNS = Custom DNS Servers
   |
   +-- Route 53 Outbound Resolver Endpoint
           |
           |-- RULE: *.corp.local → Internal Data Center DNS
           |-- RULE: *.aws.local → AmazonProvidedDNS (private endpoints only)
           |-- RULE: BLOCK everything else

Workloads in this VPC cannot resolve public DNS, cannot query VPC private DNS unless allowed, and cannot access external resolvers.

 

The post DNS Isolation on AWS appeared first on AWS Security Architect.

]]>
https://awssecurityarchitect.com/aws-network-security/dns-isolation-on-aws/feed/ 0 500
How to tell whether an endpoint is public facing? https://awssecurityarchitect.com/apis-on-aws/how-to-tell-whether-an-endpoint-is-public-facing/ https://awssecurityarchitect.com/apis-on-aws/how-to-tell-whether-an-endpoint-is-public-facing/#respond Tue, 25 Nov 2025 16:34:04 +0000 https://awssecurityarchitect.com/?p=498   Interpreting a JSON 404 Response Context: you received a JSON response with status: 404 detail: "no static resource /api/v2/users/myapp" Quick answer This does not prove the API endpoint is […]

The post How to tell whether an endpoint is public facing? appeared first on AWS Security Architect.

]]>
 

Interpreting a JSON 404 Response

Context: you received a JSON response with

status: 404
detail: "no static resource /api/v2/users/myapp"

Quick answer

This does not prove the API endpoint is publicly accessible. It only shows your request reached a web server or proxy which could not find a matching static resource or route.

What this response does indicate

  • The request reached a server or reverse proxy. The phrase “no static resource” is commonly emitted by web servers or frameworks when a path is not mapped to a file or route.
  • The server attempted to treat the path as a static/file request and didn’t find a corresponding file or route.
  • You hit an upstream layer (NGINX, CDN, API Gateway, Spring Boot static handler, Express static middleware, etc.) that answered on behalf of the infrastructure.

What this response does not mean

  • It does not mean the endpoint is public. Protected or internal endpoints often return 404 (instead of 401/403) to avoid revealing existence.
  • It does not prove you reached the backend API handler. You may be stopped at a routing/gateway/static file layer before auth or controller logic runs.

Likely causes

  • Wrong HTTP method (e.g., using GET when the API expects POST).
  • Missing URL prefix, incorrect path, or path is only accessible behind authentication or a different route.
  • Gateway/router misconfiguration or the backend service is not registered or not healthy.
  • Security configuration that masks endpoints (returns 404 for unauthorized callers).

How to investigate further (practical checks)

  1. Try an OPTIONS request (CORS preflight):
    OPTIONS /api/v2/users/myapp

    If public/web-facing, OPTIONS often returns 200/204 and CORS headers. A 404 for OPTIONS suggests the route isn’t exposed at the public layer.

  2. Compare several paths:If both a known-valid endpoint and random paths return the same no static resource text, the gateway is likely returning a generic fallback instead of routing to APIs.
  3. Inspect response headers:
    Access-Control-Allow-Origin: *
    Server: nginx
    x-envoy-response-flags: ...
    

    Headers like Access-Control-Allow-Origin or absence/presence of proxy headers (x-envoy, x-amzn-) give clues about whether you’re hitting a public API gateway or internal proxy.

  4. Validate method and payload: Ensure you used the correct HTTP verb, required headers (Authorization, Content-Type), and correct URL encoding.
  5. Check authentication behavior: Try an authenticated request (if permitted). If the server then returns a different error (401/403/200), the earlier 404 was likely a security masking behavior.
  6. Test another known endpoint on the same domain: If other documented endpoints respond normally, the issue is likely the specific path. If none respond, routing or gateway is the problem.

Example diagnostic flow

// 1. Preflight
OPTIONS /api/v2/users/myapp

// 2. Simple GET (no auth)
GET /api/v2/users/myapp
→ 404 "no static resource /api/v2/users/myapp"

// 3. GET with Authorization (if you have creds)
GET /api/v2/users/myapp
Authorization: Bearer 
→ 200 / 401 / 403 / other

// 4. Try a different known endpoint
GET /api/v2/health
→ 200  (gateway routing ok) OR 404 (gateway not routing)
Bottom line: The message indicates you reached a server layer that did not find a matching static resource or route — but it does not prove the API is public. Additional checks (OPTIONS, headers, authenticated requests, and testing known endpoints) will help determine whether the route is exposed or is being intentionally hidden behind authentication/routing logic.
If you want, paste the full HTTP response headers (no secrets) and I’ll analyze them and suggest next steps.

The post How to tell whether an endpoint is public facing? appeared first on AWS Security Architect.

]]>
https://awssecurityarchitect.com/apis-on-aws/how-to-tell-whether-an-endpoint-is-public-facing/feed/ 0 498
Control Tower Integrated SSO and Permission Sets https://awssecurityarchitect.com/aws-iam/control-tower-integrated-sso-and-permission-sets/ https://awssecurityarchitect.com/aws-iam/control-tower-integrated-sso-and-permission-sets/#respond Fri, 21 Nov 2025 18:34:23 +0000 https://awssecurityarchitect.com/?p=491 AWS Permission Sets vs Control Tower SSO: What’s the Difference? AWS Permission Sets vs Control Tower SSO 1. AWS Control Tower SSO Purpose: Provides a managed way to centrally set […]

The post Control Tower Integrated SSO and Permission Sets appeared first on AWS Security Architect.

]]>
AWS Permission Sets vs Control Tower SSO: What’s the Difference?

AWS Permission Sets vs Control Tower SSO

1. AWS Control Tower SSO

Purpose: Provides a managed way to centrally set up and govern multiple AWS accounts with pre-configured security and governance best practices.

Integration: Built on top of AWS IAM Identity Center (formerly AWS SSO).

Primary Use Case:

  • Centralized identity management across all AWS accounts in your organization.
  • Simplifies user access management in a multi-account environment.

Features:

  • Users log in via a single portal to access multiple AWS accounts.
  • Integrates with existing identity providers (IdPs) like Azure AD, Okta, etc.
  • Works with Control Tower to automatically apply baseline guardrails and account structures.

2. AWS Permission Sets

Purpose: Define what permissions users get when they access an AWS account via IAM Identity Center (SSO).

Integration: Used within Control Tower SSO / IAM Identity Center to assign access to AWS accounts.

Primary Use Case:

  • Assign role-based permissions to groups or users.
  • Can define permissions using AWS managed policies, custom policies, or a combination.

Features:

  • Can be reused across multiple accounts.
  • Can assign session duration, permission boundaries, and MFA requirements.
  • Supports fine-grained control over user permissions in multi-account setups.

Key Differences

Aspect Control Tower SSO Permission Sets
Function Centralized identity access across multiple accounts Defines permissions/roles for users within SSO
Scope Multi-account user login and governance Specific permissions in each account
Setup Part of Control Tower landing zone Created and assigned inside IAM Identity Center
Granularity Account-level access Role/permission-level access inside accounts

How They Work Together

  1. Control Tower SSO provides the portal and identity integration for all users.
  2. Permission Sets are assigned to users or groups to define exactly what they can do in each AWS account they have access to.
  3. Example:
    • Control Tower SSO gives Alice access to accounts Dev and Prod.
    • Permission Sets assign AdministratorAccess in Dev and ReadOnlyAccess in Prod.

 

aws controltower SSO
aws controltower SSO

The post Control Tower Integrated SSO and Permission Sets appeared first on AWS Security Architect.

]]>
https://awssecurityarchitect.com/aws-iam/control-tower-integrated-sso-and-permission-sets/feed/ 0 491
Backup Policies for Servers migrated to AWS https://awssecurityarchitect.com/aws-backups/backup-policies-for-servers-migrated-to-aws/ https://awssecurityarchitect.com/aws-backups/backup-policies-for-servers-migrated-to-aws/#respond Fri, 21 Nov 2025 17:03:40 +0000 https://awssecurityarchitect.com/?p=488   Backup Policy for Windows Servers on AWS Policy ID: IT-BACKUP-001 Version: 1.0 Effective Date: [Insert Date] Owner: IT Operations / Cloud Infrastructure Team 1. Purpose This policy defines standardized […]

The post Backup Policies for Servers migrated to AWS appeared first on AWS Security Architect.

]]>
 

Backup Policy for Windows Servers on AWS

Policy ID: IT-BACKUP-001

Version: 1.0

Effective Date: [Insert Date]

Owner: IT Operations / Cloud Infrastructure Team

1. Purpose

This policy defines standardized procedures for backing up Windows servers hosted on AWS, ensuring data integrity, availability, and recoverability in the event of hardware failure, application issues, or disaster.

2. Scope

  • All Windows Server instances running in AWS (EC2) that host production applications.
  • All attached EBS volumes containing system or application data.
  • Critical databases and application files hosted on these instances.

3. Policy Statements

3.1 Backup Frequency

  • Full backups: Weekly, capturing the entire system volume (EBS snapshot).
  • Incremental backups: Daily, capturing changed data on EBS volumes.
  • Application-specific backups: Database backups (SQL Server, Exchange) must occur at least daily.

3.2 Backup Methodology

  • AWS Backup will be the primary mechanism for automated backups.
  • VSS (Volume Shadow Copy Service) must be enabled for application-consistent snapshots.
  • File-level backups of configuration files and critical application data should be copied to S3 for redundancy.

3.3 Retention

  • Daily backups: Retain for 14 days.
  • Weekly backups: Retain for 90 days.
  • Monthly backups: Retain for 1 year.
  • Offsite / Cross-region backups: Critical systems must have at least one copy in a different AWS region.

3.4 Roles and Responsibilities

  • IT Operations / Cloud Infrastructure Team: Configure and monitor AWS Backup and snapshots, ensure SSM agents are installed, validate application-consistent backups.
  • Application Owners: Confirm backup schedules meet business RPO/RTO requirements and provide scripts for pre/post backup processes if required.

3.5 Monitoring and Reporting

  • Use CloudWatch metrics and alarms to track backup success/failure and disk space usage.
  • Generate AWS Backup compliance reports weekly and review with IT management.
  • Investigate and remediate any failed or missed backups within 24 hours.

3.6 Testing and Validation

  • Quarterly restore tests must be performed to ensure backups are recoverable.
  • Document results, including issues, corrective actions, and improvements.

3.7 Security

  • All backup data must be encrypted at rest and in transit.
  • Limit access to backups using IAM roles and policies.
  • Audit access logs periodically for compliance.

4. Exceptions

Any deviation from this policy requires formal approval from IT management and must be documented with reasons, risks, and mitigation measures.

5. References

AWS Backup Plan for Windows Servers

The following JSON template can be used in AWS Backup to implement this policy:

{
  "BackupPlanName": "Windows-Prod-Backup-Plan",
  "Rules": [
    {
      "RuleName": "Daily-Incremental-Backup",
      "TargetBackupVaultName": "Default",
      "ScheduleExpression": "cron(0 2 * * ? *)",
      "StartWindowMinutes": 60,
      "CompletionWindowMinutes": 180,
      "Lifecycle": {
        "MoveToColdStorageAfterDays": 30,
        "DeleteAfterDays": 14
      },
      "RecoveryPointTags": {
        "Environment": "Production",
        "Application": "WindowsServer"
      }
    },
    {
      "RuleName": "Weekly-Full-Backup",
      "TargetBackupVaultName": "Default",
      "ScheduleExpression": "cron(0 3 ? * 1 *)",
      "StartWindowMinutes": 120,
      "CompletionWindowMinutes": 360,
      "Lifecycle": {
        "MoveToColdStorageAfterDays": 60,
        "DeleteAfterDays": 90
      },
      "RecoveryPointTags": {
        "Environment": "Production",
        "Application": "WindowsServer"
      }
    },
    {
      "RuleName": "Monthly-Archive-Backup",
      "TargetBackupVaultName": "Default",
      "ScheduleExpression": "cron(0 4 1 * ? *)",
      "StartWindowMinutes": 240,
      "CompletionWindowMinutes": 720,
      "Lifecycle": {
        "MoveToColdStorageAfterDays": 90,
        "DeleteAfterDays": 365
      },
      "RecoveryPointTags": {
        "Environment": "Production",
        "Application": "WindowsServer"
      }
    }
  ]
}

 

The post Backup Policies for Servers migrated to AWS appeared first on AWS Security Architect.

]]>
https://awssecurityarchitect.com/aws-backups/backup-policies-for-servers-migrated-to-aws/feed/ 0 488
Aurora Postgres versus RDS Postgres https://awssecurityarchitect.com/aws-migration/aurora-postgres-versus-rds-postgres/ https://awssecurityarchitect.com/aws-migration/aurora-postgres-versus-rds-postgres/#respond Thu, 20 Nov 2025 21:36:55 +0000 https://awssecurityarchitect.com/?p=484 Migrate SQL Server to AWS Aurora PostgreSQL Using DMS and Schema Conversion Phase 1 — Assessment & Planning Choose target engine Aurora PostgreSQL (recommended for PostgreSQL features & ecosystem). Aurora […]

The post Aurora Postgres versus RDS Postgres appeared first on AWS Security Architect.

]]>
Migrate SQL Server to AWS Aurora PostgreSQL Using DMS and Schema Conversion

Phase 1 — Assessment & Planning

  1. Choose target engine
    • Aurora PostgreSQL (recommended for PostgreSQL features & ecosystem).
    • Aurora MySQL if your app is already MySQL-based.
  2. Inventory & compatibility assessment
    • Catalog databases, tables, indexes, constraints, stored procedures, triggers, views, jobs, and linked servers.
    • Identify MSSQL-specific items: T-SQL procedures, CLR assemblies, SQL Server Agent jobs, IDENTITY, DATETIME2, MONEY, NVARCHAR(MAX), temp-table patterns, use of WITH (NOLOCK), etc.
  3. Select migration tools
    • AWS Schema Conversion Tool (SCT) — converts schema & flags manual work.
    • AWS Database Migration Service (DMS) — full load + change data capture (CDC) for minimal downtime migration.
    • Supplemental: custom scripts, logical replication, or third-party ETL tools for complex transformations.
  4. Define success criteria
    • Data correctness (row counts, checksums), application functional tests, latency/throughput targets, and acceptable cutover window.

Phase 2 — Schema Conversion

  1. Run AWS SCT
    • Point SCT at MSSQL source and Aurora PostgreSQL target. Export conversion report and generated DDL.
    • Review automated conversions (green) and manual items (yellow/red).
  2. Refactor database code
    • Rewrite stored procedures, functions and triggers in PL/pgSQL where SCT cannot convert automatically.
    • Replace T-SQL constructs: IIFCASE, TOPLIMIT, OUTPUT semantics → RETURNING, etc.
    • Convert identity/sequence logic: MSSQL IDENTITY → Postgres SERIAL / GENERATED / sequences.
  3. Create schema on Aurora
    • Apply cleaned SCT DDL to a staging Aurora cluster. Validate constraints, indexes and privileges.
  4. Plan datatype & timezone handling
    • Decide canonical types (e.g., MSSQL DATETIMEOFFSET → Postgres timestamptz).

Phase 3 — Data Migration (DMS)

  1. Initial full load
    • Use AWS DMS in full load + ongoing replication mode to seed data and keep source/target in sync.
  2. Incremental / CDC
    • Enable CDC so DMS continually replicates changes during cutover prep.
  3. Validation
    • Row counts, checksums (e.g., hashed checks per table), sample record comparison, and referential integrity checks.
    • Resolve encoding, numeric precision, or timezone mismatches encountered during validation.
  4. Performance & tuning during load
    • Consider temporarily disabling non-critical indexes during full load and re-creating them after to speed up load.
    • Monitor DMS task logs, CPU, memory, and replication lag.

Phase 4 — Cutover

  1. Prepare applications
    • Ensure connection strings can point to Aurora endpoints and that driver/ORM supports PostgreSQL dialect.
    • Deploy application query changes (T-SQL → Postgres SQL) to staging beforehand.
  2. Final sync & freeze
    • Schedule a brief write freeze on MSSQL. Allow DMS to apply remaining CDC events until lag is zero.
  3. Switch traffic
    • Update application connection endpoints to Aurora; perform smoke tests and critical-path transactions.
    • Monitor errors, latencies, and DB metrics closely.
  4. Fallback plan
    • Have a rollback checklist — how to point apps back to MSSQL and any data reconciliation steps.

Post-cutover & Decommission

  • Keep both systems read-only for a short verification window if feasible.
  • Run full application test suite and load tests to validate performance.
  • After stabilization, schedule decommission of MSSQL resources and archive backups as required by compliance.

Checklist / Validation Items

  • Data correctness: row counts, CRCs/checksums for key tables.
  • Application functional tests & business process validation.
  • Performance tests: latency, throughput, read/write patterns.
  • Monitoring & alerts configured on Aurora (CPU, connections, replication lag, storage).
  • Backups & PITR verified.
  • Security: users, roles, parameter groups, VPC/subnet groups, KMS encryption keys.

Aurora PostgreSQL vs RDS PostgreSQL — Side-by-side

Feature Aurora PostgreSQL RDS PostgreSQL
Architecture Decoupled compute & distributed storage. Six copies across 3 AZs, auto-healing storage. Traditional single-instance with EBS-backed storage; optional Multi-AZ standby for HA.
Replication & readers Up to 15 low-latency reader instances using shared storage (fast failover & scaling). Up to 5 replicas using physical/logical replication; typically more lag than Aurora readers.
Failover time Typically sub-30 seconds (fast automated failover). Usually 1–2+ minutes depending on Multi-AZ configuration.
Performance Optimized storage/engine — often 2–3× higher throughput vs vanilla Postgres for similar hardware. Standard PostgreSQL performance characteristics.
Storage scaling Auto-scales up to 128 TB without downtime. Pre-allocated EBS; resizing may require downtime or I/O changes.
Backups & PITR Continuous backup to S3-backed storage with minimal impact. Automated snapshots and PITR using WAL archives; can have higher I/O impact.
Feature parity & versions Aurora may lag behind upstream PostgreSQL for new major releases; Aurora adds proprietary enhancements. Closer to upstream PostgreSQL; often quicker to support newest Postgres versions.
Cost Typically higher (engine/IO/replica benefits). Cost-effective for high-scale workloads where performance offsets price. Generally lower; predictable for standard workloads.
Best fit High-scale, low-latency, read-heavy, enterprise apps needing fast failover and large auto-scaling storage. Conventional workloads, smaller DBs, or teams wanting tight upstream Postgres compatibility and lower cost.

Aurora tips

  • Use parameter groups to tune Aurora for your workload (connection limits, work_mem, maintenance_work_mem, etc.).
  • For heavy writes, benchmark commit behavior — Aurora’s storage engine handles commit differently than typical Postgres on EBS.
  • Test long-running queries and background jobs (cron/pg_cron) after migration; scheduling may change semantics.
  • Consider using logical replication or pglogical for some specialized patterns if DMS/SCT aren’t appropriate.

The post Aurora Postgres versus RDS Postgres appeared first on AWS Security Architect.

]]>
https://awssecurityarchitect.com/aws-migration/aurora-postgres-versus-rds-postgres/feed/ 0 484