Generated Rule
Rule Inputs
Enter your rule details, then press Submit to generate commands and scores.
Example data table
These examples show common rule patterns and expected outputs.
| Name | Action | Direction | Proto | Source | Destination | Dst Ports | Log | Priority | Output snippet |
|---|---|---|---|---|---|---|---|---|---|
| Allow Web | allow | in | tcp | 0.0.0.0/0 | 10.1.0.10/32 | 80,443 | yes | 100 | INPUT tcp dport 80,443 ACCEPT |
| Block SSH Internet | deny | in | tcp | 0.0.0.0/0 | 10.1.0.0/24 | 22 | yes | 50 | INPUT tcp dport 22 DROP |
| Allow DNS Egress | allow | out | udp | 10.2.0.0/24 | 8.8.8.8/32 | 53 | no | 200 | OUTPUT udp dport 53 ACCEPT |
Formula used
Specificity score (0–100): Starts at 100 and subtracts points for wildcards. It rewards logging, state tracking, and time-bounding.
- Subtract 25 if source is any or 0.0.0.0/0.
- Subtract 25 if destination is any or 0.0.0.0/0.
- Subtract 10 for protocol any.
- Subtract 10 each for source ports any and destination ports any.
- Add 5 for logging, add 5 for state tracking, add 5 for non-always schedule.
Exposure score (0–100): Estimates how risky an allow-rule is, based on scope and common high-risk ports.
- Allow adds more exposure than deny or reject.
- Broad CIDRs, protocol Any, and port Any increase exposure.
- Logging and limited schedules reduce exposure slightly.
How to use
- Enter rule name, action, direction, protocol, and traffic scope.
- Use any only when required by design.
- Add ports as single values, comma lists, or ranges.
- Select output format and add justification notes.
- Press Submit, review scores, then export CSV or PDF.
Rule scope and least privilege
Least‑privilege starts with scope. Prefer /32 for single hosts, and restrict sources to subnets, VPN pools, or monitoring nodes. Using 0.0.0.0/0 should be a deliberate business decision, not a default. This builder validates IPv4 and CIDR masks 0–32, normalizes plain IPs to /32, and highlights scope in the exposure score so reviewers see risk clearly. Segment public, app, and admin paths.
Port and protocol precision
Protocol and port precision reduce attack surface. Choose TCP for web and databases, UDP for DNS and telemetry, and ICMP only for controlled diagnostics. Keep destination ports narrow, such as 80,443 for HTTPS front doors or a single admin port. Ranges like 1024-65535 are supported but increase complexity and review effort. The calculator validates ports 1–65535, de‑duplicates lists, and ignores ports when ICMP is selected. Document required flows with service owners.
Priority ordering and conflict control
Priority controls conflict resolution. Lower numbers should represent stricter rules, including explicit blocks for high‑risk services like 22 or 3389 when policy requires it. Place narrow denies above broad allows to prevent shadowing. Direction separates inbound service protection from outbound egress governance. If you enter multiple CIDRs, treat generated commands as a template and replicate per CIDR pair where platforms lack set syntax. Complexity summarizes expected operational load. Use comments consistently for faster troubleshooting.
Audit readiness and change documentation
Audit readiness depends on clarity and evidence. Use a meaningful rule name, record justification, and enable logging when feasible, then tune downstream filters instead of losing visibility. State tracking usually reduces rule count by allowing return traffic without extra entries, lowering misconfiguration risk. If access is temporary, pick a non‑always schedule and document the maintenance window in notes. The ticket output standardizes these fields for change control and review sign‑off. Capture approver, date, and rollback steps.
Platform output and validation workflow
Implementation should follow validation steps. Generate outputs for your target platform, then test with a packet probe, service health check, and log verification. For allow‑only models such as many cloud security groups, plan separate controls for denies. After deployment, confirm observed flows match direction, protocol, and ports, and watch for unexpected sources. Export CSV for policy repositories and PDF for change records to keep governance consistent across teams and environments. Reassess scores after each change.
FAQs
1) What does the specificity score measure?
It estimates how narrowly the rule targets traffic. Wildcards like any, 0.0.0.0/0, protocol Any, and port Any reduce the score, while logging, state tracking, and time limits improve it.
2) Why can an allow rule show high exposure?
Exposure rises when traffic scope is broad or sensitive ports are open. Allow with wide CIDRs, protocol Any, or port Any increases potential reach. Logging and non‑always schedules reduce exposure slightly.
3) How do I enter multiple CIDRs correctly?
Provide comma‑separated IPv4 CIDRs or IPs, such as 10.0.0.0/24, 203.0.113.10. Plain IPs are normalized to /32. Use any only when the rule must match all sources or destinations.
4) Can I use port lists and ranges together?
Yes. Enter single ports, comma lists, and ranges like 1024-2048. Ports are validated from 1 to 65535 and duplicates are removed. If the protocol is ICMP, port inputs are ignored.
5) Why do some outputs mention duplicating rules?
Some platforms require one rule per source or destination entry, while others support sets or object groups. When multiple CIDRs are provided, treat the generated command as a template and expand it to match your target system.
6) How should I use the notes and exports?
Write a short justification, affected services, and a rollback plan. Export CSV for policy inventories and audits, and export PDF for change tickets. Keeping consistent records speeds reviews and incident response.