Interview Prep/Networking/Security: Firewalls, SGs, NACLs & VPN

Your database tier must be reachable only from the app tier. How do you implement it across layers?

IntermediateScenarioSecurity: Firewalls, SGs, NACLs & VPN
Answer

Situation read → Defense in depth: routing, SG, NACL and DB auth.

What I'd do →

  1. Put the DB in private subnets without internet routes
  2. Security group allows 5432 only from the app SG
  3. Optional NACL allows 5432 from the app subnet CIDRs and ephemeral ports back
  4. Require TLS and a DB user per application
  5. Test from an unrelated instance, which must time out, and from the app, which must connect

Why → Each layer should block on its own so one mistake does not expose the data.

Interview tip → Say you test the negative case; people only test that the app works.

All Networking questions Roadmap: Networking for DevOps

More on Security: Firewalls, SGs, NACLs & VPN