Compare commits
10 Commits
313aa93ce5
...
7b49de98c0
| Author | SHA1 | Date |
|---|---|---|
|
|
7b49de98c0 | |
|
|
8fe7bf4924 | |
|
|
e9cb377d54 | |
|
|
dfea6d76dc | |
|
|
6675b6fd51 | |
|
|
2afa3e3657 | |
|
|
0457852f6f | |
|
|
58b7e59e52 | |
|
|
d2c08b6390 | |
|
|
49be541e75 |
|
|
@ -1,3 +1,4 @@
|
||||||
*.log
|
*.log
|
||||||
*.pwd
|
*.pwd
|
||||||
*.pyc
|
*.pyc
|
||||||
|
ccd/
|
||||||
|
|
|
||||||
33
README.md
33
README.md
|
|
@ -40,6 +40,14 @@ Noch ein paar Zusatzpakete:
|
||||||
# yum install tcpdump -y
|
# yum install tcpdump -y
|
||||||
# yum install python3-bcrypt -y
|
# yum install python3-bcrypt -y
|
||||||
# yum install tar -y
|
# yum install tar -y
|
||||||
|
|
||||||
|
|
||||||
|
Firewalld disablen (WICHTIG!!!)
|
||||||
|
# systemctl disable --now firewalld
|
||||||
|
|
||||||
|
Tiefere Sicherheitsstufe, siehe https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/security_hardening/using-the-system-wide-cryptographic-policies_security-hardening
|
||||||
|
|
||||||
|
# update-crypto-policies --set LEGACY
|
||||||
```
|
```
|
||||||
|
|
||||||
Wegen Entropy:
|
Wegen Entropy:
|
||||||
|
|
@ -132,11 +140,12 @@ MAILTO=root
|
||||||
Startup mit Systemd einrichten:
|
Startup mit Systemd einrichten:
|
||||||
gemaess /opt/openvpn/systemd/README
|
gemaess /opt/openvpn/systemd/README
|
||||||
|
|
||||||
Verzeichnis /opt/openvpn/users ccd und status muss angelegt werden:
|
Verzeichnis /opt/openvpn/users ccd, log und status muss angelegt werden:
|
||||||
```
|
```
|
||||||
# mkdir /opt/openvpn/users
|
# mkdir /opt/openvpn/users
|
||||||
# mkdir /opt/openvpn/ccd
|
# mkdir /opt/openvpn/ccd
|
||||||
# mkdir /opt/openvpn/status
|
# mkdir /opt/openvpn/status
|
||||||
|
# mkdir /opt/openvpn/log
|
||||||
```
|
```
|
||||||
|
|
||||||
User anlegen:
|
User anlegen:
|
||||||
|
|
@ -148,6 +157,13 @@ User anlegen:
|
||||||
# groupadd sysoper
|
# groupadd sysoper
|
||||||
# useradd -m -g sysoper -s /opt/openvpn/sysoper/sysoper_shell sysoper
|
# useradd -m -g sysoper -s /opt/openvpn/sysoper/sysoper_shell sysoper
|
||||||
# passwd sysoper
|
# passwd sysoper
|
||||||
|
|
||||||
|
# chown sysoper:sysoper /opt/openvpn/users /opt/openvpn/ccd
|
||||||
|
|
||||||
|
# cat /etc/sudoers.d/sysoper
|
||||||
|
sysoper ALL=NOPASSWD: /usr/bin/systemctl start myopenvpn
|
||||||
|
sysoper ALL=NOPASSWD: /usr/bin/systemctl stop myopenvpn
|
||||||
|
sysoper ALL=NOPASSWD: /usr/bin/systemctl status myopenvpn
|
||||||
```
|
```
|
||||||
Git Config:
|
Git Config:
|
||||||
```
|
```
|
||||||
|
|
@ -206,3 +222,18 @@ $2b$12$OkJpfcPt7Uk8DMVjBbuStedJ63rahYw05E7vNAg9PQigL97ox18Am
|
||||||
ccd/testuser
|
ccd/testuser
|
||||||
::::::::::::::
|
::::::::::::::
|
||||||
ifconfig-push 10.3.6.254 255.255.0.0
|
ifconfig-push 10.3.6.254 255.255.0.0
|
||||||
|
|
||||||
|
|
||||||
|
Einrichten von Aide
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# dnf install aide
|
||||||
|
# aide init
|
||||||
|
# mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
|
||||||
|
Zum Testen:
|
||||||
|
# aide --check
|
||||||
|
|
||||||
|
Zum Updaten:
|
||||||
|
# aide --update
|
||||||
|
# mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
|
||||||
|
```
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@ writepid /var/run/openvpn-server/myopenvpn-443.pid
|
||||||
|
|
||||||
; ciphers
|
; ciphers
|
||||||
tls-cipher "DEFAULT:@SECLEVEL=0"
|
tls-cipher "DEFAULT:@SECLEVEL=0"
|
||||||
|
tls-version-min 1.0
|
||||||
|
providers legacy default
|
||||||
|
data-ciphers AES-256-GCM:AES-128-GCM:AES-256-CBC:BF-CBC
|
||||||
|
|
||||||
; tunnel configuration
|
; tunnel configuration
|
||||||
dev tap1
|
dev tap1
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@ writepid /var/run/openvpn-server/myopenvpn.pid
|
||||||
|
|
||||||
; ciphers
|
; ciphers
|
||||||
tls-cipher "DEFAULT:@SECLEVEL=0"
|
tls-cipher "DEFAULT:@SECLEVEL=0"
|
||||||
|
tls-version-min 1.0
|
||||||
|
providers legacy default
|
||||||
|
data-ciphers AES-256-GCM:AES-128-GCM:AES-256-CBC:BF-CBC
|
||||||
|
|
||||||
; tunnel configuration
|
; tunnel configuration
|
||||||
dev tap0
|
dev tap0
|
||||||
|
|
@ -38,8 +41,8 @@ management localhost 6666
|
||||||
; certificates and authentication
|
; certificates and authentication
|
||||||
dh /opt/openvpn/private/dh2048.pem
|
dh /opt/openvpn/private/dh2048.pem
|
||||||
ca /opt/openvpn/ca/cacert.pem
|
ca /opt/openvpn/ca/cacert.pem
|
||||||
cert /opt/openvpn/certs/hostcert.pem
|
cert /opt/openvpn/certs/ewon.rychiger.com-cert.pem
|
||||||
key /opt/openvpn/private/hostkey.pem
|
key /opt/openvpn/private/ewon.rychiger.com-key.pem
|
||||||
verify-client-cert none
|
verify-client-cert none
|
||||||
username-as-common-name
|
username-as-common-name
|
||||||
auth-user-pass-verify /opt/openvpn/scripts/openvpn-auth.py via-env
|
auth-user-pass-verify /opt/openvpn/scripts/openvpn-auth.py via-env
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ if not password:
|
||||||
|
|
||||||
file = open('/opt/openvpn/users/'+username+'.pwd', 'r')
|
file = open('/opt/openvpn/users/'+username+'.pwd', 'r')
|
||||||
hashed=file.read().rstrip()
|
hashed=file.read().rstrip()
|
||||||
if bcrypt.hashpw(password, hashed) == hashed:
|
if bcrypt.hashpw(password.encode('utf-8'), hashed.encode('utf-8')) == hashed.encode('utf-8'):
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,6 @@ if not password:
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
# Hash a password for the first time, with a randomly-generated salt
|
# Hash a password for the first time, with a randomly-generated salt
|
||||||
hashed = bcrypt.hashpw(password, bcrypt.gensalt())
|
hashed = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt())
|
||||||
|
|
||||||
print "%s" % (hashed)
|
print("%s" % (hashed.decode("utf-8")))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue