OpenVPN tls-verify script hilfe

Status
Für weitere Antworten geschlossen.

MMD*

Gesperrt
Mitglied seit
26. Okt 2014
Beiträge
403
Punkte für Reaktionen
2
Punkte
24
Hallo,

Im moment beschaftige ich mich mit ein tls-verify script das die commonname von ein/ mehrere Client certificaat verifieren muss.

Das script seht so aus und beide Dateien liegen in /volume1/@appstore/VPNCenter/scripts/:
Rich (BBCode):
#!/bin/sh

#    ovpnCNcheck -- an OpenVPN tls-verify script
#    """""""""""""""""""""""""""""""""""""""""""
#    This script checks if the peer is in the allowed
#    user list by checking the CN (common name) of the
#    X509 certificate against a provided text file.
#    For example in OpenVPN, you could use the directive
#    (as one line):
#    tls-verify "/usr/local/sbin/ovpnCNcheck.py
#                /etc/openvpn/userlist.txt"
#    This would cause the connection to be dropped unless
#    the client common name is within the userlist.txt.
#    Special care has been taken to ensure that this script
#    also works on openwrt systems where only busybox is
#    available 
#    Written by Robert Penz <robert@penz.name> under the GPL 2
#    Parts are copied from the verify-cn sample OpenVPN
#    tls-verify script.

[ $# -eq 3 ] || { echo usage: ovpnCNcheck.sh userfile certificate_depth X509_NAME_oneline ; exit 255 ; }
# $2 -> certificate_depth
if [ $2 -eq 0 ] ; then
 # $3 -> X509_NAME_oneline
 # $1 -> cn we are looking for
 grep -q "^`expr match "$3" ".*/CN=\([^/][^/]*\)"`$" "$1" && exit 0
 exit 1
fi
exit 0


script-security 2 ist im Server config eingetragen.
ovpnCNcheck.sh und userlist.txt sind am Apparmor Profil hinzu gefugt.
Der CN vom user-certificaat ist eingetragen in userlist.txt:

Rich (BBCode):
/volume*/@appstore/VPNCenter/sbin/openvpn {
    #include <abstractions/base>
    #include <abstractions/base-cgi>

.........
.........
/volume1/@appstore/VPNCenter/scripts/ovpnCNcheck.sh           rix,
/volume1/@appstore/VPNCenter/scripts/userlist.txt             r,
.........
.........

Im openvpn.log bekomme ich volgende Meldung:

Rich (BBCode):
WARNING: Failed running command (--tls-verify script): external program exited with error status: 1

Jetzt bin ich mir nicht sicher ob das:
1. script ein 1 zurückschickt zum OVPN Server weil der CN nicht stimmt
2. script editiert werden muss um es compatibel zu machen fur die DS

Zu 1 habe ich geprüft ob die CN übereinstimmt, das tut es.
Zu 2 ich habe keine Ahnung von scripts

Oder vielleicht hat ovpnCNcheck.sh kein Zugang zum übertragene certificaat vom Client und muss das noch am Apparmor Profil hinzu gefugt werden?
Konnte jemand mal ein blick werfen?

Dank im voraus.
 
Status
Für weitere Antworten geschlossen.
 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat