Issue
How to add multiple IPs to the White List in Imunify360?
Environment
- Any panel
- Any OS compatible with Imunify360
- Imunify360 Firewall
Solution
- Put these IPs into the
list.txt
file and execute the following command:
<list.txt | xargs -n 1 imunify360-agent ip-list local add --purpose white
- Another way is to create an external whitelist and add it with the following:
-
Make sure that the necessary directory exists:
mkdir -p /etc/imunify360/whitelist
-
Create an external list using any name and ".txt" extension. All such files will be combined to the whitelist:
touch /etc/imunify360/whitelist/ext.txt
-
Populate the file with IP addresses or subnet addresses with a mask, e.g.:
cat /etc/imunify360/whitelist/ext.txt
192.168.246.90
192.168.246.0/24 - Reload lists so that changes will be applied:
imunify360-agent reload-lists
- An alternative would be using bash:
1. Add the list of IP addresses to the file:
cat ip_list
37.120.131.40
5.134.119.194
165.227.116.222
92.38.139.226
...
2. Execute the following command:
for i in $(cat ip_list); do imunify360-agent ip-list local add --purpose white $i --comment "IP from the list"; done
Comments
0 comments
Please sign in to leave a comment.