Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Commit b7dbd41

Browse files
Gusarichreveloper
andauthored
Split: update docs/v3/guidelines/nodes/running-nodes/secure-guidelines.mdx (from ai-fixes-big vs main) (#1653)
* Split: update docs/v3/guidelines/nodes/running-nodes/secure-guidelines.mdx (from ai-fixes-big vs main) * fixes --------- Co-authored-by: AlexG <[email protected]>
1 parent f95155a commit b7dbd41

File tree

1 file changed

+43
-18
lines changed

1 file changed

+43
-18
lines changed

docs/v3/guidelines/nodes/running-nodes/secure-guidelines.mdx

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
import Feedback from '@site/src/components/Feedback';
22

3-
# Secure guidelines for nodes
3+
# Security guidelines for nodes
44

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 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:
66

7-
### 1. Use the server exclusively to operate the TON node:
7+
### 1. Use the server exclusively to operate the node
88

99
- Using the server for additional tasks presents a potential security risk.
1010

11-
### 2. Update and patch regularly:
11+
### 2. Update and patch regularly
1212

1313
- Keep your system updated with the latest security patches.
1414

1515
- Regularly use package management tools like apt (Debian/Ubuntu) or yum/dnf (CentOS/Fedora) to perform updates.
1616

1717
```bash
18-
#Debian/Ubuntu
19-
sudo apt update && sudo apt upgrade -y
18+
# Debian/Ubuntu
19+
sudo apt update && sudo apt upgrade -y
2020

21-
#CentOS
22-
sudo yum update && sudo yum upgrade -y
21+
# CentOS
22+
sudo yum update -y
2323

24-
#Fedora
25-
sudo dnf update && sudo dnf upgrade -y
24+
# Fedora
25+
sudo dnf upgrade -y
2626
```
2727

2828
- Consider automating security updates by enabling unattended upgrades for your system.
2929

30-
### 3. Ensure a robust SSH configuration:
30+
### 3. Ensure a robust SSH configuration
3131

3232
- **Disable root login:** Prevent root access through SSH by editing the `/etc/ssh/sshd_config` file.
3333

@@ -43,6 +43,11 @@ Ensuring the security of nodes, particularly in decentralized networks such as b
4343
```bash
4444
Port 2222
4545
```
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+
:::
4651
- **Restrict SSH access:** Allow SSH connections only from trusted IP addresses by implementing firewall rules.
4752

4853
### 4. Implement a firewall
@@ -53,53 +58,73 @@ Ensuring the security of nodes, particularly in decentralized networks such as b
5358
sudo ufw allow 22/tcp # Allow SSH
5459
sudo ufw allow 80/tcp # Allow HTTP
5560
sudo ufw allow 443/tcp # Allow HTTPS
61+
sudo ufw default deny incoming
62+
sudo ufw default allow outgoing
5663
sudo ufw enable # Enable firewall
5764
```
5865

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+
5968
### 5. Monitor logs
6069

6170
- Regularly monitor system logs to detect suspicious activities:
62-
- `/var/log/auth.log` (for authentication attempts)
71+
- `/var/log/auth.log` (authentication attempts on Debian/Ubuntu)
72+
- `/var/log/secure` (authentication attempts on RHEL/CentOS)
6373
- `/var/log/syslog` or `/var/log/messages`
6474
- Consider implementing centralized logging.
6575

6676
### 6. Limit user privileges
6777

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.
6979

7080
- Regularly review user accounts and remove any unnecessary or inactive users.
7181

7282
### 7. Utilize SELinux or AppArmor
7383

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.
7585

7686
### 8. Install security tools
7787

7888
- Utilize tools such as **Lynis** to conduct regular security audits and identify potential vulnerabilities:
7989

8090
```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
8298
sudo lynis audit system
8399
```
84100

85101
### 9. Disable unnecessary services
86102

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:
88104

89105
```bash
90-
sudo systemctl disable service_name
106+
sudo systemctl disable <service_name>
91107
```
92108

93109
### 10. Implement intrusion detection and prevention systems (IDS/IPS)
94110

95111
- Use tools like **Fail2ban** to block IP addresses after multiple failed login attempts:
96112

97113
```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
99119
```
100120

101121
- Utilize **AIDE (Advanced Intrusion Detection Environment)** to monitor file integrity and identify any unauthorized changes.
102122

123+
### Unattended updates
124+
125+
- Debian/Ubuntu: `sudo apt install unattended-upgrades`
126+
- RHEL/Fedora: `sudo dnf install dnf-automatic -y && sudo systemctl enable --now dnf-automatic.timer`
127+
103128
:::caution
104129
Please remain vigilant and ensure that your node is secure at all times.
105130
:::

0 commit comments

Comments
 (0)