# Botul Guard - rulează permanent, conectat la TeamSpeak prin ServerQuery. # Instalare: cp deploy/sharks-guard.service /etc/systemd/system/ && systemctl daemon-reload && systemctl enable --now sharks-guard # # Recomandare de securitate: utilizator dedicat, fără shell, care citește doar ce are nevoie. # useradd --system --home /var/lib/sharks-guard --shell /usr/sbin/nologin sharks-guard # install -d -o sharks-guard -g sharks-guard -m 0700 /var/lib/sharks-guard # chgrp sharks-guard /var/www/sharks-panel/config/config.php /var/www/sharks-panel/config/bot.php && chmod 0640 ... # Atenție: botul are nevoie de config/config.php (parola bazei de date + app_key) ca să poată decripta parola ServerQuery. # Scripturile din panou rulează ca același utilizator, de aceea utilizatorul NU trebuie să poată citi altceva # decât proiectul, iar restricțiile de mai jos nu sunt opționale. [Unit] Description=Sharks Guard (bot TeamSpeak) After=network-online.target mariadb.service Wants=network-online.target [Service] Type=simple User=sharks-guard Group=sharks-guard WorkingDirectory=/var/www/sharks-panel ExecStart=/usr/bin/php /var/www/sharks-panel/bot/guard.php Restart=always RestartSec=5 TimeoutStopSec=20 # Izolare NoNewPrivileges=yes PrivateTmp=yes PrivateDevices=yes ProtectSystem=strict ProtectHome=yes ProtectKernelTunables=yes ProtectKernelModules=yes ProtectKernelLogs=yes ProtectControlGroups=yes ProtectClock=yes ProtectHostname=yes RestrictSUIDSGID=yes RestrictRealtime=yes RestrictNamespaces=yes LockPersonality=yes MemoryDenyWriteExecute=no RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX SystemCallArchitectures=native SystemCallFilter=@system-service CapabilityBoundingSet= AmbientCapabilities= UMask=0077 ReadWritePaths=/var/lib/sharks-guard StateDirectory=sharks-guard Environment=SHARKS_CONFIG=/var/www/sharks-panel/config/config.php # Limite de resurse MemoryMax=512M TasksMax=128 LimitNOFILE=1024 [Install] WantedBy=multi-user.target