Skip to content

Cloud Security Groups and Network Access Controls

Routing decides whether a network path exists. Security controls decide whether traffic is allowed to use that path.

Welcome to Lab 05 of the CompTIA Cloud+ practical lab sequence.

In the previous lab, you configured:

  • route tables
  • default routes
  • internet connectivity
  • private outbound access
  • NAT concepts
  • subnet associations
  • traffic-path validation

You can now answer:

Can traffic reach the destination?

This lab introduces the next question:

Should that traffic be allowed?

You will build and validate cloud network-security controls around the architecture created in the previous labs.

The target environment is:

Internet
↓
Public / Web Tier
↓
Application Tier
↓
Database Tier

Your goal is to transform that architecture into:

Internet
↓
HTTPS Only
↓
Web Tier
↓
Required Application Port Only
↓
Application Tier
↓
Required Database Port Only
↓
Database Tier
Item Details
Lab 05 β€” Cloud Security Groups and Network Access Controls
Difficulty Beginner β†’ Intermediate
Estimated Time 60–90 Minutes
Certification Alignment CompTIA Cloud+
Primary Focus Cloud Network Security
Previous Lab 04 β€” Configure Cloud Routing and Internet Access
Career Alignment Cloud Administrator, Cloud Engineer, Cloud Security Engineer
Major Skills Security Groups, Inbound/Outbound Rules, Least Privilege, Troubleshooting
Deliverable Least-Privilege Cloud Network Policy + Validation Report

Your organization has completed the basic cloud-network design.

The application contains:

  • public web workloads

  • private application workloads

  • private database workloads

Routing is already configured.

However, the current network-security rules are too broad.

Your manager asks you to implement a least-privilege access model.

The requirements are:

Internet
↓
HTTPS
↓
Web Tier
Web Tier
↓
Application Service
↓
Application Tier
Application Tier
↓
Database Service
↓
Database Tier

Everything else should be reviewed and restricted unless there is a documented requirement.

By completing this lab, you should be able to:

  • explain cloud security groups

  • understand virtual-firewall concepts

  • distinguish inbound and outbound rules

  • define source and destination controls

  • use protocol and port restrictions

  • implement least-privilege network access

  • restrict administrative access

  • identify excessive public exposure

  • understand stateful firewall behavior conceptually

  • distinguish security groups from routing

  • distinguish network controls from host firewalls

  • validate allowed and denied traffic

  • troubleshoot broken security rules

  • document traffic requirements

  • explain cloud-network security during interviews

A route such as:

0.0.0.0/0
↓
Internet Gateway

creates a network path.

But that does not mean every port should be reachable.

A weak design might allow:

Internet
↓
ANY
↓
Web Server

A better design starts with:

Internet
↓
TCP 443
↓
Web Server

The principle is:

Allow only the communication required for the workload to function.

Cloud providers commonly provide virtual network-security controls attached to:

  • instances

  • network interfaces

  • subnets

  • workloads

Provider terminology varies.

Conceptually:

Traffic
↓
Cloud Security Policy
↓
Allow / Deny
↓
Workload

For CompTIA Cloud+, focus on:

Source
+
Destination
+
Protocol
+
Port
+
Direction
=
Security Decision

Inbound rules control traffic entering a protected resource.

Example:

Source:
Internet
Protocol:
TCP
Port:
443
Destination:
Web Server
Action:
Allow

Outbound rules control traffic leaving a protected resource.

Example:

Source:
Application Server
Destination:
Database
Protocol:
TCP
Port:
Database Service
Action:
Allow

The exact control model depends on the provider.

Many cloud security-group implementations behave statefully.

Conceptually:

Client
↓
Allowed Request
↓
Server
↓
Return Traffic

The return traffic may be automatically recognized as part of the established connection.

Do not assume every cloud network control behaves exactly the same.

Some controls may be:

  • stateful

  • stateless

  • workload-level

  • subnet-level

Always understand the provider’s implementation.

Confirm:

10.10.0.0/16
|
β”œβ”€β”€ Public
β”‚ 10.10.10.0/24
|
β”œβ”€β”€ Application
β”‚ 10.10.20.0/24
|
└── Database
10.10.30.0/24

Before creating security rules, use the traffic matrix from Lab 03.

A recommended starting point:

Source Destination Service Required?
Internet Web HTTPS Yes
Internet Web SSH Restricted
Internet App Any No
Internet DB Any No
Web App Application Service Yes
Web DB Database No
App DB Database Service Yes
Admin Workloads Management Controlled

Use:

Business Requirement
↓
Required Traffic
↓
Security Rule

not:

Allow Everything
↓
Application Works
↓
Try to Secure Later

Create a security policy for the public web workload.

Example name:

cloudplus-lab-sg-web-01

Apply your standard tags.

Create:

Direction:
Inbound
Source:
Internet / Approved Sources
Protocol:
TCP
Port:
443
Action:
Allow

HTTPS commonly uses:

TCP 443

This allows encrypted web traffic.

Ask:

Does the application require TCP 80?

If HTTP is required only for redirecting users to HTTPS, document that requirement.

If not:

do not open it unnecessarily.

Administrative access should be restricted.

Prefer:

Trusted Admin Source
↓
TCP 22
↓
Web VM

Avoid:

0.0.0.0/0
↓
TCP 22
↓
Web VM

where a narrower source is practical.

Example:

Direction Source Protocol Port Purpose
Inbound Internet TCP 443 HTTPS
Inbound Trusted Admin IP TCP 22 Administration

Ask what the web workload actually needs outbound.

Possible requirements:

  • application-tier communication

  • DNS

  • software updates

  • logging

Avoid assuming:

unrestricted outbound access is always necessary.

Create:

cloudplus-lab-sg-app-01

The application tier should not accept direct arbitrary internet traffic.

Suppose your lab application uses a test service on:

TCP 8080

Then conceptually allow:

Source:
Web Tier
Destination:
Application Tier
Protocol:
TCP
Port:
8080

Use the actual port required by your application.

Do not copy port 8080 into production designs simply because it appears in this lab.

15 β€” Prefer Security-Group Referencing Where Supported

Section titled β€œ15 β€” Prefer Security-Group Referencing Where Supported”

Some cloud platforms allow one security group or workload identity to be used as the source instead of a broad IP range.

Conceptually:

Web Security Group
↓
TCP 8080
↓
Application Security Group

This can be easier to maintain than hard-coding many workload IPs.

Validate that the application tier does not have a rule like:

Internet
↓
ANY
↓
Application Server

The target design is:

Internet
X
Application Tier

for direct inbound access.

17 β€” Review Administrative Access to the App Tier

Section titled β€œ17 β€” Review Administrative Access to the App Tier”

The private application VM should ideally use a controlled management path.

For example:

Administrator
↓
Bastion / VPN / Managed Session
↓
Application VM

not:

Internet
↓
SSH
↓
Private App VM

Create:

cloudplus-lab-sg-db-01

This should be the most restrictive tier in the current design.

For a lab database, identify the actual service port.

Examples may include database technologies using ports such as:

  • TCP 3306

  • TCP 5432

  • TCP 1433

Use only the one required by your chosen test environment.

Do not open every database port.

Conceptually:

Application Tier
↓
Required Database Port
↓
Database Tier

Example:

Source:
Application Security Group
Protocol:
TCP
Port:
Database Service

Your desired architecture is:

Web
X
Database

unless the application design explicitly requires direct communication.

If a public web workload is compromised, direct database access creates a shorter attack path.

Prefer:

Web
↓
Application
↓
Database

Verify:

Internet
X
Database

There should be no unnecessary public database exposure.

Your desired architecture becomes:

Internet
|
| TCP 443
v
+----------------+
| Web Tier |
+----------------+
|
| App Port
v
+----------------+
| App Tier |
+----------------+
|
| DB Port
v
+----------------+
| Database Tier |
+----------------+

Administrative traffic should be treated separately from application traffic.

Example:

Administrator
↓
Trusted Management Path
↓
Web / App / DB

Avoid mixing:

Application Traffic
+
Administrative Traffic

without reason.

Suppose SSH access is needed.

Weak rule:

Source:
0.0.0.0/0
Port:
22

Better:

Source:
Trusted Administrator IP
Port:
22

Better enterprise architecture may use:

Admin Identity
↓
VPN / Bastion / Session Service
↓
Private Workloads

Outbound security policy should also consider:

where workloads need to communicate.

Example:

App Server
↓
Database Only

may be stronger than unrestricted access to all internal systems.

Common protocols include:

TCP
UDP
ICMP

Do not select:

all protocols

unless required.

A security policy may allow:

TCP 443

or a range.

Avoid broad ranges such as:

TCP 1-65535

without documented justification.

Prefer:

Required Source
+
Required Destination
+
Required Protocol
+
Required Port

Some cloud environments create default security policies.

Review whether they allow:

  • all internal traffic

  • all outbound traffic

  • broad inbound traffic

Do not assume:

default = least privilege.

From an approved external client, test:

HTTPS

to the web workload.

Expected:

Allowed.

Use a safe test port where no service is expected.

Expected:

blocked or unreachable.

Do not merely inspect the configuration.

Test the expected behavior.

Attempt SSH from:

  • approved source

  • unapproved source where safely possible

Expected:

Approved Source
↓
Allowed

and:

Unapproved Source
↓
Blocked

From the web workload, test the required application port.

For example:

Terminal window
nc -vz <app-private-ip> 8080

if nc is available and your test service is listening.

Use the actual configured test service.

From the web workload, attempt the database service connection.

Expected:

denied or unreachable.

From the application workload, test the required database service.

Expected:

allowed.

Confirm there is no direct public inbound path to the application tier.

Check:

  • public IP

  • route design

  • security-group rules

Confirm:

Internet
X
Database
Test Expected Result
Internet β†’ Web HTTPS Allow
Internet β†’ Web SSH from trusted source Allow
Internet β†’ Web SSH from untrusted source Deny
Internet β†’ App Deny
Internet β†’ DB Deny
Web β†’ App Allow
Web β†’ DB Deny
App β†’ DB Allow

This distinction is critical.

Answers:

Where does traffic go?

Answers:

Is traffic allowed?

You can have:

Valid Route
+
Blocked Security Rule
=
No Connectivity

You can also have:

Allowed Security Rule
+
Missing Route
=
No Connectivity

Your workload may also have an operating-system firewall.

Conceptually:

Network
↓
Cloud Security Rule
↓
OS Firewall
↓
Application

All layers must support the intended communication.

If the cloud security group allows TCP 443 but the OS firewall blocks it:

the service remains unreachable.

On a Linux test workload, inspect:

Terminal window
ss -tuln

Confirm the expected service is actually listening.

For HTTPS:

Internet Client
↓
DNS
↓
Public IP
↓
Route
↓
Cloud Security Rule
↓
OS Firewall
↓
TCP 443 Listener
↓
Web Application

In the isolated lab, temporarily remove the inbound HTTPS rule.

Test again.

Expected:

HTTPS fails.

Use:

Route?
↓
Security Group?
↓
OS Firewall?
↓
Service?

Identify:

missing security-group rule.

Recreate the required rule.

Test again.

Expected:

service restored.

Record:

Problem:
Web application unreachable.
Expected Traffic:
Internet β†’ TCP 443 β†’ Web
Observed Behavior:
Root Cause:
Missing/incorrect security-group rule.
Remediation:
Validation:

In the lab only, temporarily create something broad such as:

Source:
Anywhere
Protocol:
All

Review how much access this potentially creates.

Then remove it.

Do not leave the broad rule active.

The objective is to understand:

why broad rules create unnecessary attack surface.

For every public workload ask:

Which Ports Are Open?
↓
Why?
↓
From Which Sources?
↓
Is Each One Required?

Review:

Web β†’ App
App β†’ DB
Web β†’ DB

The goal is not merely:

internal = trusted.

Internal traffic also requires policy.

If one workload is compromised, excessive east-west access can allow attackers to move toward other systems.

The database tier should ideally satisfy:

Internet:
No
Web:
No
Application:
Required DB Port Only
Administration:
Controlled

For each workload ask:

What external destinations are required?

Does it need:

  • repositories

  • APIs

  • logging destinations?

Does it need external access at all?

Inbound security receives most attention, but uncontrolled outbound access can also create risk.

Document:

Source Destination Protocol Port Action Business Reason
Internet Web TCP 443 Allow User Access
Admin Web TCP 22 Allow Administration
Web App TCP App Port Allow Application
App DB TCP DB Port Allow Database
Web DB Any Any Deny Not Required
Internet App Any Any Deny Private Tier
Internet DB Any Any Deny Private Tier

Where your provider supports descriptions or rule names, use meaningful labels.

Example:

allow-https-from-internet
allow-ssh-from-admin
allow-web-to-app
allow-app-to-db

Avoid:

rule1
rule2
test

For each rule document:

  • purpose

  • owner

  • source

  • destination

  • service

Six months later, someone should be able to answer:

Why does this rule exist?

Suppose a rule exists for:

TCP 8080

but the application moved to:

TCP 8443

The old rule may now be unnecessary.

Use:

Create
↓
Use
↓
Review
↓
Modify
↓
Remove

Temporary administrative rules should not become permanent by accident.

Document:

Temporary Rule:
Owner:
Reason:
Created:
Expiration:

Some providers also support subnet-level network controls or ACL-style mechanisms.

Conceptually:

Subnet Traffic
↓
Network ACL / Equivalent
↓
Workload Security Group
↓
Host Firewall

Cloud environments may use multiple layers:

Routing
+
Subnet-Level Controls
+
Workload-Level Controls
+
Host Firewall
+
Application Security

Understand the broad distinction.

Tracks connection state.

Evaluates traffic independently according to rules.

With stateless controls, you may need to consider:

both directions explicitly.

59 β€” Troubleshooting Scenario β€” HTTPS Does Not Work

Section titled β€œ59 β€” Troubleshooting Scenario β€” HTTPS Does Not Work”

Use:

DNS
↓
Public IP
↓
Route
↓
Security Group
↓
OS Firewall
↓
Application Listener

60 β€” Troubleshooting Scenario β€” App Cannot Reach DB

Section titled β€œ60 β€” Troubleshooting Scenario β€” App Cannot Reach DB”

Check:

Source IP
↓
Source Security Rule
↓
Route
↓
DB Security Rule
↓
Host Firewall
↓
DB Listener
↓
Return Path

61 β€” Troubleshooting Scenario β€” Rule Looks Correct

Section titled β€œ61 β€” Troubleshooting Scenario β€” Rule Looks Correct”

Suppose the rule says:

Source:
10.10.10.0/24
Port:
8080

but the web workload actually resides in:

10.10.11.0/24

The rule is technically valid but does not match the real source.

Always compare:

intended architecture

with:

actual deployed state.

Suppose the security group allows:

TCP 8080

but the application listens on:

TCP 8443

No amount of route-table changes will solve the problem.

63 β€” Troubleshooting Scenario β€” OS Firewall Blocking

Section titled β€œ63 β€” Troubleshooting Scenario β€” OS Firewall Blocking”

Cloud rule:

TCP 443 Allowed

but service remains unavailable.

Review the host firewall.

64 β€” Troubleshooting Scenario β€” Service Not Listening

Section titled β€œ64 β€” Troubleshooting Scenario β€” Service Not Listening”

Both network and host firewall allow the traffic.

Still unavailable.

Check:

Terminal window
ss -tuln

If no service listens on the expected port:

the issue is application/service related.

65 β€” Troubleshooting Scenario β€” Everything Open but App Still Fails

Section titled β€œ65 β€” Troubleshooting Scenario β€” Everything Open but App Still Fails”

Avoid opening more ports.

Review:

  • application

  • dependencies

  • DNS

  • authentication

  • logs

Use:

Source
↓
Route
↓
Cloud Network Control
↓
Host Firewall
↓
Listening Port
↓
Application
↓
Return Path

Check:

[ ] HTTPS required
[ ] Administrative access restricted
[ ] No unnecessary ports
[ ] Source restrictions documented
[ ] Outbound requirements reviewed

Check:

[ ] No direct public exposure
[ ] Web-to-app traffic limited
[ ] Admin access controlled
[ ] Outbound requirements reviewed

Check:

[ ] No public IP
[ ] No direct internet access
[ ] App-to-db only
[ ] Web-to-db blocked
[ ] Administrative access controlled

Your final design should show both routes and security policy.

Internet
|
TCP 443
|
v
+------------------+
| Web Tier |
| 10.10.10.0/24 |
+------------------+
|
App Port
|
v
+------------------+
| Application Tier |
| 10.10.20.0/24 |
+------------------+
|
DB Port
|
v
+------------------+
| Database Tier |
| 10.10.30.0/24 |
+------------------+

Document:

Web Security Group:
cloudplus-lab-sg-web-01
Application Security Group:
cloudplus-lab-sg-app-01
Database Security Group:
cloudplus-lab-sg-db-01
Public HTTPS:
Allowed
Public SSH:
Trusted Sources Only
Internet β†’ App:
Blocked
Internet β†’ DB:
Blocked
Web β†’ App:
Required Port Only
Web β†’ DB:
Blocked
App β†’ DB:
Required Port Only

Add:

Resource Type Purpose Status
cloudplus-lab-sg-web-01 Security Group Web Tier Active
cloudplus-lab-sg-app-01 Security Group App Tier Active
cloudplus-lab-sg-db-01 Security Group DB Tier Active

Capture sanitized evidence of:

  • web security rules

  • application security rules

  • database security rules

  • validation tests

  • denied traffic tests

Do not capture:

  • secrets

  • private keys

  • sensitive account identifiers

Verify:

Internet β†’ Web HTTPS
ALLOW
Internet β†’ App
DENY
Internet β†’ DB
DENY
Web β†’ App
ALLOW
Web β†’ DB
DENY
App β†’ DB
ALLOW
Validation Status
Web security group created
App security group created
DB security group created
HTTPS allowed
SSH restricted
Internet-to-app blocked
Internet-to-db blocked
Web-to-app allowed
Web-to-db blocked
App-to-db allowed
Public exposure reviewed
Host firewall considered
Listening services validated
Broad rule tested and removed
Security matrix documented
Troubleshooting case completed
Resource inventory updated

Keep these security groups if you are continuing the Cloud+ lab sequence.

They will be useful for later:

  • DNS

  • three-tier architecture

  • load balancing

  • monitoring

  • incident investigation

Remove only temporary test rules.

Cloud+ questions may ask:

A VM has correct routing but remains unreachable.

Think:

Route
↓
Network Security Rule
↓
Host Firewall
↓
Service

Another scenario may ask:

Which control best reduces unnecessary exposure?

Look for:

Least Privilege
+
Specific Source
+
Specific Port

instead of broad ANY access.

Practice without notes.

9. Why separate web, application, and database security policies?

Section titled β€œ9. Why separate web, application, and database security policies?”

19. How can excessive internal access enable lateral movement?

Section titled β€œ19. How can excessive internal access enable lateral movement?”

20. How would you troubleshoot a blocked cloud connection?

Section titled β€œ20. How would you troubleshoot a blocked cloud connection?”

A web server has HTTPS open to the internet and SSH open to 0.0.0.0/0.

What would you change?

Keep:

HTTPS
Internet β†’ TCP 443

Review and restrict:

SSH
Trusted Admin Source β†’ TCP 22

The application server is reachable directly from the internet even though it should be private.

Review:

  • public IP

  • routing

  • security rules

  • workload placement

Do not treat this as only a firewall issue.

Web users cannot reach the application.

Use:

Route
↓
Web Security Group
↓
App Security Group
↓
App Host Firewall
↓
Listening Port

The web tier can access the database directly.

Ask:

Is that required by the architecture?

If not, remove the path and require:

Web
↓
Application
↓
Database

A developer requests ANY protocol from ANY source because the application is not working.

Do not immediately approve it.

Determine:

Required Source
+
Required Destination
+
Required Port
+
Actual Failure

The cloud rule allows TCP 443, but HTTPS still fails.

Check:

  • route

  • host firewall

  • service status

  • listening port

  • application health

The database security group allows only the app tier, but connectivity still fails.

Check whether:

  • the app is using the expected source identity/IP

  • the database listener uses the expected port

  • host firewall permits it

  • routes and return paths are valid

Use:

Business Requirement
↓
Source
↓
Destination
↓
Protocol
↓
Port
↓
Network Path
↓
Security Rule
↓
Validation

Avoid:

β€œI would open the port and see if it works.”

A stronger answer is:

β€œI would first confirm the required source, destination, protocol, and port from the application architecture. I would verify the routing path, review workload and subnet-level security controls, check the host firewall and listening service, and then implement the narrowest rule required before validating both allowed and denied traffic.”

That demonstrates Cloud Security Engineer thinking.

Keep sanitized versions of:

Show:

Internet
↓ HTTPS
Web
↓ App Port
Application
↓ DB Port
Database

Document every required communication flow.

Include:

  • source

  • destination

  • protocol

  • port

  • business reason

Show which services are externally accessible and why.

Document one intentionally broken security rule and its remediation.

Instead of:

Configured cloud security groups.

Use:

Implemented least-privilege cloud network-security controls across public web, private application, and database tiers using source restrictions, protocol and port filtering, controlled administrative access, and validated allowed/denied traffic paths.

Or:

Troubleshot cloud connectivity across routing, workload security groups, host firewalls, listening services, and application dependencies while documenting root cause and remediation.

You should now be able to:

  • explain cloud security groups

  • understand inbound and outbound rules

  • define source restrictions

  • define port restrictions

  • apply least privilege

  • restrict administrative access

  • secure public web workloads

  • protect private application tiers

  • protect database tiers

  • distinguish routing from network security

  • distinguish cloud controls from host firewalls

  • understand stateful firewall concepts

  • review public exposure

  • review east-west communication

  • identify broad security rules

  • validate allowed traffic

  • validate denied traffic

  • troubleshoot security-rule failures

  • document security policy professionally

You have now progressed from:

Routing
↓
Traffic Has a Path

to:

Security Policy
↓
Only Required Traffic Uses That Path

Your current environment now reflects a much stronger cloud design:

Internet
↓
HTTPS
↓
Web
↓
Application Service
↓
Application
↓
Database Service
↓
Database

The key lesson is:

Good cloud security is not about blocking everything. It is about permitting exactly what the workload requires and being able to explain why every access path exists.

Your compute, subnets, routing, and network-security controls are now established.

The next lab focuses on DNS and cloud name resolution.

You will work with:

  • DNS architecture

  • hostname-to-IP resolution

  • public DNS

  • private DNS

  • DNS records

  • resolver concepts

  • workload name resolution

  • DNS testing

  • broken DNS troubleshooting

  • distinguishing DNS failures from routing failures

You will move from:

10.10.20.15

to:

app.cloudplus.lab

and understand how that name is resolved to the correct destination.

➑️ Next: Lab 06 β€” Cloud DNS and Name Resolution