PaaS Security Archives - AWS Security Architect https://awssecurityarchitect.com/category/paas-security/ Experienced AWS, GCP and Azure Security Architect Fri, 17 Oct 2025 15:51:16 +0000 en-US hourly 1 https://wordpress.org/?v=6.9 214477604 EC2 Agents – URLs and IPs allowlist https://awssecurityarchitect.com/ec2-security/ec2-agents-urls-and-ips-allowlist/ https://awssecurityarchitect.com/ec2-security/ec2-agents-urls-and-ips-allowlist/#respond Fri, 17 Oct 2025 15:38:25 +0000 https://awssecurityarchitect.com/?p=357   EC2 Agents: CIDR vs FQDN (Wildcard) Allowlists — with Ansible & Rapid7 Examples + SG/NACL Capabilities Executive Summary CIDR allowlists control who (IPs) can talk to your instances, ideal […]

The post EC2 Agents – URLs and IPs allowlist appeared first on AWS Security Architect.

]]>
 

EC2 Agents: CIDR vs FQDN (Wildcard) Allowlists — with Ansible & Rapid7 Examples + SG/NACL Capabilities

Executive Summary

CIDR allowlists control who (IPs) can talk to your instances, ideal for inbound automation traffic you own (Ansible control nodes, bastions, VPN egress).

FQDN / wildcard allowlists control where (domains) your instances/agents can call out to — essential for SaaS backends that sit behind CDNs/anycast (e.g., *.rapid7.com) whose IPs change.

Rule of thumb: Use Security Groups for precise, stateful, instance-level CIDR control (inbound + outbound). Use NACLs for coarse, subnet-level gates. Use a DNS-aware firewall/proxy (or AWS Network Firewall) for domain/wildcard egress control. SGs/NACLs cannot match hostnames.

Security Groups vs NACLs — What They Allow (and Don’t)

Feature Security Groups (SG) Network ACLs (NACL)
Type Stateful, attached to ENIs/instances Stateless, applied to subnets
Direction Inbound + Outbound; return traffic auto-allowed Inbound + Outbound; return traffic must be explicitly allowed
Matching By CIDR/IP or SG references (same VPC); no FQDN By CIDR/IP only; no FQDN, no SG refs
Evaluation Set-based, implicit deny if no match Numbered rules, first match wins
Granularity Fine-grained per-instance/role Coarse, per-subnet boundary
Logging No native decision logs (use VPC Flow Logs to observe traffic) No per-rule logs (use VPC Flow Logs)
What They’re Great At Microsegmentation, app tiers, restricting admin ports (SSH/WinRM) Global subnet allow/deny baselines (e.g., block known-bad CIDRs)
Limitations No FQDN/wildcards, no DPI/TLS intercept, no user-aware auth No FQDN/wildcards, stateless complexity, subnet-wide scope

Security Groups — You Can:

  • Restrict inbound SSH/WinRM to known CIDRs or referenced SGs.
  • Limit outbound by port and CIDR (e.g., only 80/443 to NAT).
  • Express tier-to-tier rules with SG references (web → app → db).

Security Groups — You Cannot:

  • Match FQDNs/wildcards (e.g., *.rapid7.com).
  • Do DPI, TLS inspection, or user/session-aware decisions.
  • Produce per-rule decision logs (observe via VPC Flow Logs instead).

NACLs — You Can:

  • Set coarse subnet boundaries (deny/allow by CIDR/port).
  • Block obvious inbound vectors at the subnet edge.
  • Use rule numbering for deterministic first-match behavior.

NACLs — You Cannot:

  • Match FQDNs/wildcards or reference SGs.
  • Rely on state; explicitly allow return traffic/ephemeral ports.
  • Target individual instances (NACLs affect the whole subnet).

When to Use CIDR vs FQDN (Wildcard)

CIDR/IP Allowlists — Use When

  • Controlling inbound admin access to EC2 (SSH/WinRM/RPC).
  • Your control plane has static egress (bastion, VPN, Ansible Tower).
  • You need deterministic peer-to-peer app tier microsegmentation.

FQDN/Wildcard Allowlists — Use When

  • Agents must call outbound to SaaS/CDN (dynamic IPs, anycast).
  • Vendor publishes hostnames and requires HTTPS/TLS without interception.
  • You need stable policy that survives provider IP rotation.

Example A — Ansible (Agentless)

Traffic Pattern

  • Linux targets: Ansible control node → EC2 over SSH 22/tcp.
  • Windows targets: control node → EC2 over WinRM 5986/tcp (TLS) (or SSH on supported builds).

What to Allow

  • Target EC2 Security Group (Inbound):
    • Allow 22/tcp from your control-node/bastion CIDR(s) (Linux).
    • Allow 5986/tcp from your control-node/bastion CIDR(s) (Windows).
  • Outbound on targets: allow to OS/package mirrors (or route via your internal repo/proxy).
  • Control node egress: optionally allow to Galaxy/PyPI or pin to internal mirrors.

Why CIDR Fits

Ansible is push-based and agentless. You own the control-plane IPs; the key is restricting inbound management ports on targets. No vendor SaaS domains are required for the automation channel itself.

Checklist (Opinionated)

  • [ ] Target SG: 22/tcp (Linux) from control-node CIDR(s) only.
  • [ ] Target SG: 5986/tcp (WinRM TLS) from control-node CIDR(s) only.
  • [ ] Prohibit 0.0.0.0/0 on management ports; prefer bastion + SG referencing.
  • [ ] Outbound to package mirrors (via NAT/proxy or internal repos).

Example B — Rapid7 Insight Agent (Agent-Based)

Traffic Pattern

  • EC2 → Rapid7 cloud over HTTPS 443 to region-specific hostnames (beaconing, telemetry, updates, uploads).
  • Optional Collector: EC2 → Collector on 5508, 6608, 8037; Collector → Rapid7 over 443.
  • Vendors commonly require no SSL interception (preserve certificate chain/TLS pinning).

What to Allow

  • Outbound (from EC2 or through your proxy/NAT): allow 443/tcp to documented Rapid7 endpoints for your region (often expressed as wildcards such as *.endpoint.ingress.rapid7.com, *.insight.rapid7.com).
  • If using Collector: allow EC2 → Collector ports 5508/6608/8037, and Collector egress 443 to Rapid7.

Why FQDN/Wildcard Fits

The Rapid7 backend is SaaS and frequently CDN/anycast fronted; IPs change. IP-based allowlists are brittle. Enforce hostname/wildcard egress on a DNS-aware proxy or AWS Network Firewall. SGs/NACLs can’t match FQDNs.

Checklist (Opinionated)

  • [ ] Outbound SG: permit 443/tcp to Internet via NAT/proxy.
  • [ ] Egress firewall/proxy policy: allow Rapid7 hostnames/wildcards; exclude from SSL inspection per vendor guidance.
  • [ ] If Collector: open 5508/6608/8037 to the Collector; allow Collector egress 443.

AWS-Native Controls — Putting It Together

For Ansible

  • Security Groups: precise inbound CIDR to 22 / 5986.
  • NACLs: optional subnet baseline (coarse allow/deny).
  • Egress: to repos/mirrors via NAT/proxy (optional domain control there).

For Rapid7 (and similar SaaS agents)

    <l

The post EC2 Agents – URLs and IPs allowlist appeared first on AWS Security Architect.

]]>
https://awssecurityarchitect.com/ec2-security/ec2-agents-urls-and-ips-allowlist/feed/ 0 357
Accessing PaaS Services on AWS via Endpoints https://awssecurityarchitect.com/paas-security/accessing-paas-services-on-aws-via-endpoints/ https://awssecurityarchitect.com/paas-security/accessing-paas-services-on-aws-via-endpoints/#respond Sun, 25 Sep 2022 06:51:29 +0000 https://awssecurityarchitect.com/?p=71 Also read, which PaaS services require VPCs Accessing PaaS Services on AWS AWS services like EC2, RDS, and ElastiCache come with an Elastic Network Interface (ENI), which enables communication from […]

The post Accessing PaaS Services on AWS via Endpoints appeared first on AWS Security Architect.

]]>
Also read, which PaaS services require VPCs

Accessing PaaS Services on AWS

AWS services like EC2, RDS, and ElastiCache come with an Elastic Network Interface (ENI), which enables communication from within your VPCs.

However, many AWS services do not come with an ENI and provide only a REST API (accessed over the Internet only).  These include: S3, DynamoDB, CloudWatch, SQS, and Kinesis.

There are three options to make these services accessible from private subnets:

  • Gateway Endpoints is free of charge, but are only available for S3 and DynamoDB.
  • An Interface Endpoint costs $7.20 per month and AZ plus $0.01 per GB and is available for most AWS services.
  • NAT Gateway can be used to access AWS services or any other services with a public API. Costs are $32.40 per month and AZ plus $0.045 per GB.

Accessing PaaS Services – Summary

Depending on the service, there may be one or more options for access to these services (from private subnets).  This post describes three possible options along with their costs.

For an advanced AWS security consultation, please Contact AWS Security Architect

The post Accessing PaaS Services on AWS via Endpoints appeared first on AWS Security Architect.

]]>
https://awssecurityarchitect.com/paas-security/accessing-paas-services-on-aws-via-endpoints/feed/ 0 71
AWS – Which PaaS services require a VPC? https://awssecurityarchitect.com/paas-security/aws-which-paas-services-require-a-vpc/ https://awssecurityarchitect.com/paas-security/aws-which-paas-services-require-a-vpc/#comments Sat, 24 Sep 2022 08:52:24 +0000 https://awssecurityarchitect.com/?p=18 Several PaaS services use the compute platform (compute engine on GCP and EC2 on AWS). These services ARE actually part of your VPC – even though it may seem like […]

The post AWS – Which PaaS services require a VPC? appeared first on AWS Security Architect.

]]>
Several PaaS services use the compute platform (compute engine on GCP and EC2 on AWS). These services ARE actually part of your VPC – even though it may seem like they are not (due to the misconception that PaaS means global…)

On GCP, these would include:

App Engine, App Engine Flex, Cloud SQL, DataProc among others.

On AWS, these would include

  • AWS Elastic Beanstalk
  • Amazon RDS
  • Amazon EMR
  • Amazon Redshift

So, which PaaS Services DO NOT belong in a VPC?

  •  Cloud Storage on GCP , S3 on AWS are storage services that are always accessible from the Internet (there IS a way to block off the public IP).
  • You never have to spin up an S3 instance – like you do an RDS instance.  It does not belong on the VPC.  Compute Instances and EC2 instances need to be able to access the internet – or access VPC endpoints for the S3 / Cloud Storage.
  • Serverless Functions (lambda on AWS) / Cloud functions on GCP – CAN be connected to a VPC (by default, they are not). If connected to a VPC, then they can only access resources within the VPC (or use a NAT Gateway for access to the Internet).  If not connected to a VPC, Internet access is direct.

Summary

The post AWS – Which PaaS services require a VPC? appeared first on AWS Security Architect.

]]>
https://awssecurityarchitect.com/paas-security/aws-which-paas-services-require-a-vpc/feed/ 1 18