You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 19, 2025. It is now read-only.
Ensuring the security of nodes, particularly in decentralized networks such as blockchain or distributed systems, is essential for maintaining data integrity, confidentiality, and availability. The guidelines for securing nodes should cover several layers, including network communication, hardware, and software configurations. Below are a set of guidelines to enhance node security:
5
+
Ensuring the security of nodes, particularly in decentralized networks such as blockchain or distributed systems, is essential for maintaining data integrity, confidentiality, and availability. The guidelines for securing nodes should cover several layers, including network communication, hardware, and software configurations. Below is a set of guidelines to enhance node security:
6
6
7
-
### 1. Use the server exclusively to operate the TON node:
7
+
### 1. Use the server exclusively to operate the node
8
8
9
9
- Using the server for additional tasks presents a potential security risk.
10
10
11
-
### 2. Update and patch regularly:
11
+
### 2. Update and patch regularly
12
12
13
13
- Keep your system updated with the latest security patches.
14
14
15
15
- Regularly use package management tools like apt (Debian/Ubuntu) or yum/dnf (CentOS/Fedora) to perform updates.
16
16
17
17
```bash
18
-
#Debian/Ubuntu
19
-
sudo apt update && sudo apt upgrade -y
18
+
#Debian/Ubuntu
19
+
sudo apt update && sudo apt upgrade -y
20
20
21
-
#CentOS
22
-
sudo yum update && sudo yum upgrade -y
21
+
#CentOS
22
+
sudo yum update -y
23
23
24
-
#Fedora
25
-
sudo dnf update && sudo dnf upgrade -y
24
+
#Fedora
25
+
sudo dnf upgrade -y
26
26
```
27
27
28
28
- Consider automating security updates by enabling unattended upgrades for your system.
29
29
30
-
### 3. Ensure a robust SSH configuration:
30
+
### 3. Ensure a robust SSH configuration
31
31
32
32
-**Disable root login:** Prevent root access through SSH by editing the `/etc/ssh/sshd_config` file.
33
33
@@ -43,6 +43,11 @@ Ensuring the security of nodes, particularly in decentralized networks such as b
43
43
```bash
44
44
Port 2222
45
45
```
46
+
- After editing `/etc/ssh/sshd_config`, apply changes with `sudo systemctl reload ssh` (Debian/Ubuntu) or `sudo systemctl reload sshd` (RHEL/CentOS/Fedora).
47
+
48
+
:::caution
49
+
Before disabling password authentication or changing the SSH port, ensure you can sign in with SSH keys and that firewall rules allow the new port to avoid lockout.
50
+
:::
46
51
-**Restrict SSH access:** Allow SSH connections only from trusted IP addresses by implementing firewall rules.
47
52
48
53
### 4. Implement a firewall
@@ -53,53 +58,73 @@ Ensuring the security of nodes, particularly in decentralized networks such as b
53
58
sudo ufw allow 22/tcp # Allow SSH
54
59
sudo ufw allow 80/tcp # Allow HTTP
55
60
sudo ufw allow 443/tcp # Allow HTTPS
61
+
sudo ufw default deny incoming
62
+
sudo ufw default allow outgoing
56
63
sudo ufw enable# Enable firewall
57
64
```
58
65
66
+
- Note: Replace `22` with your configured SSH port (e.g., `2222`). Also, if running a full node, ensure the required UDP port is allowed/forwarded. See [port forwarding](guidelines/nodes/running-nodes/full-node#port-forwarding).
67
+
59
68
### 5. Monitor logs
60
69
61
70
- Regularly monitor system logs to detect suspicious activities:
-`/var/log/auth.log` (authentication attempts on Debian/Ubuntu)
72
+
-`/var/log/secure` (authentication attempts on RHEL/CentOS)
63
73
-`/var/log/syslog` or `/var/log/messages`
64
74
- Consider implementing centralized logging.
65
75
66
76
### 6. Limit user privileges
67
77
68
-
- Grant root or sudo privileges only to trusted users. Use the sudo command carefully and audit the `/etc/sudoers` file to limit access.
78
+
- Grant root or sudo privileges only to trusted users. Use the sudo command carefully and use `visudo` to audit/edit the `/etc/sudoers` file to limit access.
69
79
70
80
- Regularly review user accounts and remove any unnecessary or inactive users.
71
81
72
82
### 7. Utilize SELinux or AppArmor
73
83
74
-
-**SELinux** (on RHEL/CentOS) and **AppArmor** (on Ubuntu/Debian) provide mandatory access control, adding an extra layer of security by restricting programs from accessing specific system resources.
84
+
-**SELinux** (on RHEL/CentOS/Fedora) and **AppArmor** (on Ubuntu/Debian) provide mandatory access control, adding an extra layer of security by restricting programs from accessing specific system resources.
75
85
76
86
### 8. Install security tools
77
87
78
88
- Utilize tools such as **Lynis** to conduct regular security audits and identify potential vulnerabilities:
79
89
80
90
```bash
81
-
sudo apt install lynis
91
+
# Debian/Ubuntu
92
+
sudo apt install lynis -y
93
+
94
+
# RHEL/CentOS/Fedora
95
+
sudo dnf install lynis -y
96
+
97
+
# Run audit
82
98
sudo lynis audit system
83
99
```
84
100
85
101
### 9. Disable unnecessary services
86
102
87
-
- To minimize the attack surface, disable or remove any unused services. For instance, if FTP or mail services are not needed, ensure to disable them:
103
+
- To minimize the attack surface, disable or remove any unused services. For instance, if FTP or mail services are not needed, ensure you disable them:
88
104
89
105
```bash
90
-
sudo systemctl disable service_name
106
+
sudo systemctl disable <service_name>
91
107
```
92
108
93
109
### 10. Implement intrusion detection and prevention systems (IDS/IPS)
94
110
95
111
- Use tools like **Fail2ban** to block IP addresses after multiple failed login attempts:
96
112
97
113
```bash
98
-
sudo apt install fail2ban
114
+
# Debian/Ubuntu
115
+
sudo apt install fail2ban -y
116
+
117
+
# RHEL/CentOS/Fedora
118
+
sudo dnf install fail2ban -y
99
119
```
100
120
101
121
- Utilize **AIDE (Advanced Intrusion Detection Environment)** to monitor file integrity and identify any unauthorized changes.
0 commit comments