run as root and correct validator
This commit is contained in:
15
debian/fail2ban-p2p.service
vendored
15
debian/fail2ban-p2p.service
vendored
@@ -1,25 +1,14 @@
|
||||
[Unit]
|
||||
Description=fail2ban-p2p distributed ban exchange daemon
|
||||
Documentation=man:systemd.service(5)
|
||||
Description=fail2ban-p2p service
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
Group=root
|
||||
EnvironmentFile=-/etc/default/fail2ban-p2p
|
||||
ExecStart=/usr/bin/python3 /usr/bin/fail2ban-p2p.py -c /etc/fail2ban-p2p $DAEMON_OPTS
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
ProtectSystem=full
|
||||
ProtectHome=true
|
||||
ReadWritePaths=/etc/fail2ban-p2p /var/log/fail2ban-p2p.log
|
||||
WorkingDirectory=/var/lib/fail2ban-p2p
|
||||
StateDirectory=fail2ban-p2p
|
||||
RuntimeDirectory=fail2ban-p2p
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -9,7 +9,7 @@ import socket
|
||||
import sys
|
||||
from time import time
|
||||
|
||||
import M2Crypto
|
||||
from M2Crypto import EVP
|
||||
|
||||
sys.path.insert(1, "./fail2ban-p2p")
|
||||
sys.path.insert(2, "/usr/share/fail2ban-p2p/fail2ban-p2p")
|
||||
@@ -74,7 +74,7 @@ elif args.b:
|
||||
|
||||
signed_message = json.dumps(serializable_dict)
|
||||
|
||||
signer = M2Crypto.EVP.load_key(c.privkey)
|
||||
signer = EVP.load_key(c.privkey)
|
||||
signer.sign_init()
|
||||
signer.sign_update(signed_message.encode("utf-8"))
|
||||
string_signature = signer.sign_final().hex()
|
||||
|
||||
Reference in New Issue
Block a user