Code RoomSecurity group opens database
MediumPrep Room Coding #4120

Security group opens database

Vibe & agenticSecurityMid–Senior~15 min

An AI agent generated this security group for a Postgres RDS instance after you said "let the app servers reach the database." It applies and the app connects fine in staging. What's the problem?

Implement
internet_exposed_ports(rules: list[str]) → list[int]
Examples
in[["5432|0.0.0.0/0"]]out[5432]
in[["5432|10.0.1.0/24","5432|10.0.2.0/24"]]out[]
in[["5432|172.16.0.0/12","5432|172.32.0.0/12"]]out[5432]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 15 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.