Skip to content

AI prompt · Infrastructure and AD pentesting

Prompt: firewall rule set review

Prompt that reviews an exported firewall rule set: permissive rules, any/any, shadowed rules, exposed admin services, missing logging, risk-ranked advice.

By Steven Carrier Published

Works with: Claude, other chat assistants

You are an infrastructure security auditor. Review the firewall rule set exported below, as part of an authorised configuration audit.

Device and export format: {{device}}
Firewall role and zones: {{role_zones}}
Expected security policy: {{policy}}
Exported rules:
{{exported_rules}}

Analyse the rules in evaluation order and flag:
1. overly permissive rules: "any" source, destination or service, wide address ranges, broad port ranges;
2. shadowed rules (never reached because an earlier rule already covers their traffic) and redundant or duplicate rules;
3. exposed administration services (SSH, RDP, web administration interfaces, SNMP, database management protocols) from less trusted zones or from the Internet;
4. rules without logging, especially denials and broad rules;
5. disabled rules, and rules with no description, no owner or that are clearly temporary;
6. deviations from the stated security policy.

For each point, quote the rule number or name and explain the risk. Finish with recommendations ranked by decreasing risk, with a confidence level for each. State what the export cannot tell you (unresolved objects, evaluation order, rules on other devices). Propose no change to apply without the client's validation.

Replace the highlighted variables before use.

This prompt helps you review a large firewall rule export, where flaws hide in the evaluation order and in rules accumulated over the years. It offers a first pass of spotting, which you then confirm on the device or through authorised flow tests.

Fill in the variables

Variable Example
{{device}} CSV export of a perimeter firewall policy, rules listed in evaluation order
{{role_zones}} filtering between the Internet, a web DMZ (198.51.100.0/24), the internal network and the administration network
{{policy}} no administration access from the Internet, default deny, every allow rule logged
{{exported_rules}} number, source, destination, service, action, logging, state and comment of each rule

Keep the rule order and the named objects (address groups, services) with their contents, otherwise the shadowed-rule analysis is unreliable. Replace real addresses with consistent fictitious ones.

Review the output

  • Check each rule quoted against the export: a model may get a number wrong or misread a named object.
  • Shadowed rules depend on evaluation order and policy sections: confirm them with the vendor’s analysis tool or on the device.
  • A broad rule is not necessarily a flaw: ask the client for the business justification before rating it.
  • An export shows neither address translation, nor security profiles, nor the rules on other firewalls: do not infer actual exposure without flow testing within the authorised scope.
  • To confirm service exposure from the outside, see the Nmap cheatsheet, within the agreed framework.
  • Do not paste into the prompt any client information (addresses, object names, rule descriptions) that your engagement agreement does not allow you to share with an AI service; anonymise the export.

Sources

Related resources

  • Methodology · Infrastructure and AD pentesting · Red teaming

    Active Directory config review

    Defensive Active Directory review checklist for audits: privileged accounts, krbtgt, delegation, LAPS, legacy protocols, GPOs, ADCS and logging.

    Published

  • Cheatsheet · Infrastructure and AD pentesting · Red teaming

    Active Directory enumeration

    Authenticated AD enumeration for an internal test: domain, accounts, groups, password policy, shares, LDAP queries and BloodHound collection.

    Published

  • AI prompt · Infrastructure and AD pentesting · OSINT · Cloud

    Attack surface prompt

    Prompt that analyses an asset inventory from the authorised scope (domains, IPs, services, cloud) to prioritise testing: exposure, criticality, checks.

    Published

BEAROPS

Need a penetration test?

BEAROPS experts test your applications, infrastructure and cloud, black box or grey box, following OWASP, NIST and ANSSI guidance.