Bin grade dabei einen openvpn Server abzusichern.
Centos
Habe folgendes gemacht:
Habe apache deinstalliert,brauche ich nicht. Dann habe ich sendmail in allen RUNLEVEL auf off gestellt.
Für ssh installiere ich denyhost welches die ipś in die denyhost schreibt.
Ich brauche nur den port 22=sshd und 443=openvpn, beides tcp.
Alles andere muss dicht sein!
Iptables regeln:
Geht das so in Ordnung?
Mehr brauche ich ja eigentlich nicht machen oder?
Centos
Habe folgendes gemacht:
Code:
chkconfig --list
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
gpm 0:off 1:off 2:on 3:off 4:on 5:on 6:off
haldaemon 0:off 1:off 2:off 3:off 4:off 5:off 6:off
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
kudzu 0:off 1:off 2:off 3:off 4:off 5:off 6:off
lm_sensors 0:off 1:off 2:on 3:off 4:on 5:on 6:off
lvm2-monitor 0:off 1:on 2:off 3:off 4:off 5:off 6:off
mcstrans 0:off 1:off 2:on 3:off 4:on 5:on 6:off
messagebus 0:off 1:off 2:off 3:off 4:on 5:on 6:off
multipathd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netfs 0:off 1:off 2:off 3:off 4:on 5:on 6:off
netplugd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
nscd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
openvpn 0:off 1:off 2:off 3:on 4:off 5:on 6:off
portmap 0:off 1:off 2:off 3:off 4:on 5:on 6:off
rawdevices 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off
restorecond 0:off 1:off 2:on 3:off 4:on 5:on 6:off
saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off
snmpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
snmptrapd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
xinetd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
Für ssh installiere ich denyhost welches die ipś in die denyhost schreibt.
Ich brauche nur den port 22=sshd und 443=openvpn, beides tcp.
Alles andere muss dicht sein!
Iptables regeln:
Code:
iptables -P INPUT DROP
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -m state --state RELATED
iptables -t nat -A POSTROUTING -s 10.10.9.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o venet0 -j SNAT --to-source xx.xxx.xx.xx
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
Code:
net.ipv4.ip_forward = 1
Code:
netstat -npl
tcp 0 0 xx.xx.xxx.xx:443 0.0.0.0:* LISTEN 22052/openvpn
tcp 0 0 :::22 :::* LISTEN 22064/sshd
Mehr brauche ich ja eigentlich nicht machen oder?
Last edited by a moderator: