Application IP Lists
Directory Structure
|-- ip_lists/
|-- ip_lists.yaml
The YAML file can contain one or more application IP lists.
Configuration Description
Each IP list is an object containing the following parameters:
Parameter | Data Type | Required | Description |
---|---|---|---|
name | string | Yes | The name of the IP list, which is also its unique identifier |
type | string | Yes | IP address type, currently only supports “ipv4” |
items | array | Yes | List of IP addresses |
items Configuration
Parameter | Data Type | Required | Description |
---|---|---|---|
ip | string | Yes | IP address |
Configuration Example
- name: app-ip-list1
type: ipv4
items:
- ip: 1.1.1.1
- ip: 1.1.1.11
- name: app-ip-list2
type: ipv4
items:
- ip: 1.1.1.1
- ip: 1.1.1.2
This configuration defines five IP lists, each containing two IPv4 addresses.
Usage Example
Update configuration to OpenResty Edge:
edge-config https://192.168.1.1 -s -t 2051e780-1897-4ea0-92b4-2c2f0169aa94 -l ip_lists -i /root/oredge-configs -d test.com
Export configuration from OpenResty Edge:
edge-config -u https://192.168.1.1 -s -t 2051e780-1897-4ea0-92b4-2c2f0169aa94 -E -l ip_lists -d test.com
Cleanup IP Lists from OpenResty Edge:
edge-config -u https://192.168.1.1 -s -t 2051e780-1897-4ea0-92b4-2c2f0169aa94 -c -l ip_lists -d test.com
The above examples all use -l ip_lists
to specify that only configurations related to the application IP list will be operated.
Notes
Each IP list must have a unique name.
Currently, only IPv4 address types are supported.
When adding or updating IP lists, the tool will check the validity of IP addresses.
When updating configurations, the tool will compare new and old configurations to determine if an update is necessary.
When importing configurations, the tool will first check the validity of the configuration before performing add or update operations.
If an IP list is deleted from the configuration, the tool will automatically remove it from the application.
the tool will format the YAML content to include only the necessary information (name, type, and IP addresses) when exporting configurations.
other features, such as WAF rules, access control, etc can reference IP lists.
If an error occurs during configuration processing, the tool will automatically clear any changes made to maintain configuration consistency.
When exporting configurations, if the application does not exist, the tool will provide a warning message.