Configuring a Trusted IP Address to Access LDAP
Scenario
By default, the LDAP service deployed in the OMS and cluster can be accessed by any IP address. To enable the LDAP service to be accessed by only trusted IP addresses, you can configure the INPUT policy in the iptables filtering list.
This topic is available for MRS 3.x or later.
Impact on the System
After the configuration, the LDAP service cannot be accessed by IP addresses that are not configured. Before the expansion, the added IP addresses need to be configured as trusted IP addresses.
Prerequisites
- You have collected the management plane IP addresses and service plane IP addresses of all nodes in the cluster and all floating IP addresses.
- You have obtained the root user account for all nodes in the cluster.
Configuring a Trusted IP Address to Access LDAP
Configuring trusted IP addresses for the LDAP service on the OMS
- Log in to FusionInsight Manager.
- Choose and choose to view the OMS LDAP port number, that is, the value of LDAP Listening Port, which is 21750 by default.
- Log in to the active management node as user root using the IP address of the active management node.
- Run the following command to check the INPUT policy in the iptables filtering list:
iptables -L
For example, if no rule is configured, the INPUT policy is displayed as follows:
Chain INPUT (policy ACCEPT) target prot opt source destination
- Run the following command to trust all IP addresses used by the cluster. Each IP address needs to be added once.
iptables -A INPUT -s Trusted IP address -p tcp --dport Port number -j ACCEPT
For example, to configure 10.0.0.1 as a trusted IP address and enable it to access port 21750, you need to run the following command:
iptables -A INPUT -s 10.0.0.1 -p tcp --dport 21750 -j ACCEPT
- Run the following command to untrust all IP addresses. Trusted IP addresses are not affected by this rule.
iptables -A INPUT -p tcp --dport Port number -j DROP
For example, to disable all IP addresses to access port 21750, run the following command:
iptables -A INPUT -p tcp --dport 21750 -j DROP
- Run the following command to view the modified INPUT policy in the iptables filtering list:
iptables -L
For example, after a trusted IP address is configured, the INPUT policy is displayed as follows:
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- 10.0.0.1 anywhere tcp dpt:21750 DROP tcp -- anywhere anywhere tcp dpt:21750
- Run the following command to view the rules and rule numbers in the iptables filtering list:
iptables -L -n --line-number
Chain INPUT (policy ACCEPT) num target prot opt source destination 1 DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:21750
- Run the following command to delete the desired rule from the iptables filtering list based on site requirement:
iptables -D INPUT Number of the rule to be deleted
For example, to delete rule 1, run the following command:
iptables -D INPUT 1
- Log in to the standby management node as user root using the standby IP address. Repeat 4 to 9.
Configuring trusted IP addresses for the LDAP service in the cluster
- Log in to FusionInsight Manager.
- Choose Cluster > Services > LdapServer. Click Instance and view the LDAP nodes.
- Go to the Configurations page, and view the LDAP port number of the cluster, that is, the value of LDAP_SERVER_PORT, which is 21780 by default.
- Log in to the LDAP node as user root using the LDAP service IP address.
- Run the following command to view the INPUT policy in the iptables filtering list:
iptables -L
For example, if no rule is configured, the INPUT policy is displayed as follows:
Chain INPUT (policy ACCEPT) target prot opt source destination
- Run the following command to configure all IP addresses used by the cluster as trusted IP addresses. Each IP address needs to be added independently.
iptables -A INPUT -s Trusted IP address -p tcp --dport Port number -j ACCEPT
For example, to configure 10.0.0.1 as a trusted IP address and enable it to access port 21780, you need to run the following command:
iptables -A INPUT -s 10.0.0.1 -p tcp --dport 21780 -j ACCEPT
- Run the following command to untrust all IP addresses. Trusted IP addresses are not affected by this rule.
iptables -A INPUT -p tcp --dport Port number -j DROP
For example, to disable all IP addresses to access port 21780, run the following command:
iptables -A INPUT -p tcp --dport 21780 -j DROP
- Run the following command to view the modified INPUT policy in the iptables filtering list:
iptables -L
For example, after a trusted IP address is configured, the INPUT policy is displayed as follows:
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- 10.0.0.1 anywhere tcp dpt:21780 DROP tcp -- anywhere anywhere tcp dpt:21780
- Run the following command to view the rules and rule numbers in the iptables filtering list:
iptables -L -n --line-number
Chain INPUT (policy ACCEPT) num target prot opt source destination 1 DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:21780
- Run the following command to delete the desired rule from the iptables filtering list based on site requirement:
iptables -D INPUT Number of the rule to be deleted
For example, to delete rule 1, run the following command:
iptables -D INPUT 1
- Log in to the LDAP node as user root using the IP address of another LDAP service, and repeat 15 to 20.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot