Skip to content

How to Manage Rule Lists

This guide shows you how to create, edit, and use rule lists in Peakhour to maintain reusable collections of IP addresses, text strings, or integers.

Before you begin: Review Rule Lists Concepts to understand the different types of rule lists and their applications.

Access Rule Lists

  1. Navigate to your domain dashboard in Peakhour
  2. Click on Rule Lists in the main navigation menu

Create a New Rule List

Create an IP List

For managing collections of IP addresses or CIDR ranges:

  1. Click Create New List
  2. Select IP List as the type
  3. Enter a descriptive name (e.g., trusted_admin_ips)
  4. Add IP addresses or ranges, one per line:
    10.0.0.0/8
    172.16.0.0/12
    192.168.0.0/16
    203.0.113.42
    
  5. Click Save List

Create a Text List

For managing collections of text strings:

  1. Click Create New List
  2. Select Text List as the type
  3. Enter a descriptive name (e.g., allowed_user_agents)
  4. Add text strings, one per line:
    MyApp/1.0
    PartnerBot/2.1
    LegacyClient/0.9
    
  5. Click Save List

Create an Integer List

For managing collections of numeric values:

  1. Click Create New List
  2. Select Integer List as the type
  3. Enter a descriptive name (e.g., trusted_asns)
  4. Add integer values, one per line:
    13335
    16509
    14618
    
  5. Click Save List

Edit Existing Rule Lists

Add Entries to a List

  1. Find your list in the Rule Lists section
  2. Click Edit next to the list name
  3. Add new entries at the end of the existing content
  4. Click Save Changes

Remove Entries from a List

  1. Click Edit on your rule list
  2. Delete the lines containing entries you want to remove
  3. Click Save Changes

Bulk Update a List

  1. Click Edit on your rule list
  2. Replace the entire content with your new list
  3. Click Save Changes

Note: Changes propagate globally within seconds.

Use Rule Lists in Configurations

Reference Lists in Firewall Rules

Use the $list_name syntax to reference your lists:

# Block traffic from suspicious IPs
ip.src in $suspicious_ips

# Allow specific user agents
http.user_agent in $allowed_user_agents

# Rate limit based on ASN
ip.geoip.asnum not in $trusted_asns

Reference Lists in Rate Limiting

# Create rate limiting rule using ASN list
if (ip.geoip.asnum not in $trusted_asns) {
  rate_limit.add_zone(
    zone: "general",
    key: ["ip"],
    rate: "100r/m"
  )
}

Reference Lists in Other Rules

Lists can be used in any rule phase that supports the referenced data type:

# URL rewriting based on IP list
if (ip.src in $beta_users) {
  url.rewrite("/beta/")
}

Manage List Lifecycle

Monitor List Usage

  1. Check which rules reference each list in the Usage tab
  2. Review impact before making changes to widely-used lists
  3. Test changes in a staging environment when possible

Delete Unused Lists

  1. Verify no rules reference the list in the Usage tab
  2. Click Delete next to the list name
  3. Confirm deletion when prompted

Warning: Deleting a list referenced by active rules will cause those rules to fail.

Common Use Cases and Examples

Administrative Access Control

# Create admin IP list
Name: admin_office_ips
Type: IP List
Content:
203.0.113.0/24
198.51.100.50
10.1.1.0/24

# Use in firewall rule
if (http.request.uri.path matches "/admin/" and ip.src not in $admin_office_ips) {
  firewall.deny
}

Bot Management

# Create good bot list
Name: verified_bots
Type: Text List  
Content:
Googlebot/2.1
Bingbot/2.0
Slackbot/1.0

# Use in rate limiting
if (http.user_agent not in $verified_bots) {
  rate_limit.add_zone(zone: "bot_protection", rate: "10r/m")
}

Partner Network Management

# Create partner ASN list
Name: partner_asns
Type: Integer List
Content:
13335
16509
8075

# Use for preferential treatment
if (ip.geoip.asnum in $partner_asns) {
  cache.ttl = 3600
} else {
  cache.ttl = 300
}

Best Practices

Naming Conventions

  • Use descriptive names that indicate purpose and content type
  • Use underscores for readability (e.g., trusted_admin_ips)
  • Include the environment if lists differ between staging/production

Content Management

  • Keep lists organized with related entries grouped together
  • Document complex entries with inline comments where supported
  • Regular review and cleanup of outdated entries

Operational Procedures

  • Test list changes in staging environments first
  • Monitor traffic patterns after making list updates
  • Keep backups of critical lists before major changes
  • Use descriptive names that make the list's purpose clear to other team members

Troubleshooting

Rule not matching after list update:

  • Verify the list was saved successfully
  • Check that rule syntax correctly references the list name
  • Wait up to 60 seconds for changes to propagate globally

Cannot delete list:

  • Check the Usage tab to see which rules reference the list
  • Remove or update references before attempting deletion

List not available in rule editor:

  • Ensure the list name follows valid naming conventions
  • Verify the list was saved successfully and propagated