Page 1 of 1

Keyhelp 24.1 Security Alert Mail bei Login ins Panel

Posted: Tue 11. Jun 2024, 08:30
by l_fish
Ich bin sicher, dass die Ursache des Problems bei KeyHelp liegt
(Probleme ohne KeyHelp-Bezug gehören ins Offtopic-Forum)
Ja

Server-Betriebssystem + Version
(z.B. Ubuntu 20.04)
Debian 11

Eingesetzte Server-Virtualisierung-Technologie
(z.B. keine, OpenVZ, KVM, XEN, etc.)
betrifft sowohl dedizierte Server als auch KVM

KeyHelp-Version + Build-Nummer
(z.B. 22.0 - Build 2366)
24.1 (Build 3285)

Problembeschreibung / Fehlermeldungen
Seit dem gestrigen Keyhelpupdate wird beim Einloggen ins Keyhelp Panel eine Mail an root@hostname ausgelöst mit folgendem Inhalt:
Betreff: *** SECURITY information for HOSTNAME ***

HOSTNAME : Jun 11 06:23:39 : keyhelp : a password is required ; PWD=/home/keyhelp/www/keyhelp ; USER=root ; COMMAND=/bin/df --block-size=1 --output=source,fstype,size,used,avail,itotal,iused,iavail,target


Erwartetes Ergebnis

Keine Email :)

Tatsächliches Ergebnis

Email :)

Schritte zur Reproduktion

Einloggen ins Keyhelp Panel (als Admin)

Zusätzliche Informationen
(z.B. kürzlich durchgeführte Änderungen am Server, Auszüge aus Protokolldateien (/var/log/*, /var/log/keyhelp/php-error.log, etc.))

Es betrifft nicht alle unsere Server. Auf den ersten Blick scheinen nur die Systeme betroffen zu sein, die bereits unter Debian 10 oder älter eingerichtet und später auf Debian 11 aktualisiert wurden.

Re: Keyhelp 24.1 Security Alert Mail bei Login ins Panel

Posted: Tue 11. Jun 2024, 11:22
by Alexander
Hallo,

schau mal ob dir das abhilfe schafft. Einfach den Befehl ausführen, dann wird eine Datei ausgetauscht:

Debian 12:

Code: Select all

wget https://install.keyhelp.de/misc/php82/Disk -O /home/keyhelp/www/keyhelp/core-ns/System/Disk.php ; chown keyhelp:keyhelp /home/keyhelp/www/keyhelp/core-ns/System/Disk.php ;
Ubuntu 22:

Code: Select all

wget https://install.keyhelp.de/misc/php81/Disk -O /home/keyhelp/www/keyhelp/core-ns/System/Disk.php ; chown keyhelp:keyhelp /home/keyhelp/www/keyhelp/core-ns/System/Disk.php 
Debian 10 / Debian 11 / Ubuntu 20

Code: Select all

wget https://install.keyhelp.de/misc/php71/Disk -O /home/keyhelp/www/keyhelp/core-ns/System/Disk.php ; chown keyhelp:keyhelp /home/keyhelp/www/keyhelp/core-ns/System/Disk.php ;

Re: Keyhelp 24.1 Security Alert Mail bei Login ins Panel

Posted: Tue 11. Jun 2024, 11:49
by l_fish
Alexander wrote: Tue 11. Jun 2024, 11:22 schau mal ob dir das abhilfe schafft. Einfach den Befehl ausführen, dann wird eine Datei ausgetauscht:
Vielen Dank für die schnelle Reaktion. Leider hilft es nicht (getestet auf zwei Debian 11 Systemen), die Mail wird immer noch versendet - übrigens bei jedem Aufruf vom Dashboard, nicht nur nach Login, wie ich inzwischen sehe.

Die Mail sieht mir nach einer sudo-Warning aus, daher poste ich dir hier mal die Inhalte meiner sudo-configs, vielleicht hilft das ja.

/etc/sudoers

Code: Select all

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "@include" directives:

@includedir /etc/sudoers.d
/etc/sudoers.d/keyhelp

Code: Select all

# Manage system services
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/service

# Mail queue management
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/postsuper
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/postcat

# Server reboot
keyhelp ALL = (ALL) NOPASSWD: /sbin/reboot

# Process management
keyhelp ALL = (ALL) NOPASSWD: /bin/kill

# Disk usage
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/du
keyhelp ALL = (ALL) NOPASSWD: /bin/ls

# Firewall
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/iptables, /sbin/iptables
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/iptables-restore, /sbin/iptables-restore
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/iptables-save, /sbin/iptables-save
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/ip6tables, /sbin/ip6tables
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/ip6tables-restore, /sbin/ip6tables-restore
keyhelp ALL = (ALL) NOPASSWD: /usr/sbin/ip6tables-save, /sbin/ip6tables-save

# Dovecot active sessions
keyhelp ALL = (root) NOPASSWD: /usr/bin/doveadm who

# API - Export account system passwords
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/getent

# Backup
keyhelp ALL = (ALL) NOPASSWD:SETENV: /usr/local/bin/restic
keyhelp ALL = (ALL) NOPASSWD: /bin/chown

# Fail2Ban management
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/fail2ban-client, /usr/local/bin/fail2ban-client

# Socket status - Allow full output when using the "--extended" parameter of "ss"
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/ss, /bin/ss

# Mail queue - Allow direct access to /var/spool/postfix/*
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/find

# Disk overview - Allow display of remote file systems
keyhelp ALL = (ALL) NOPASSWD: /usr/bin/df

# Last line must be empty, do not trim!

Viele Grüße,
Lars

Re: Keyhelp 24.1 Security Alert Mail bei Login ins Panel  [GELÖST]

Posted: Tue 11. Jun 2024, 12:16
by Alexander
Besten Dank!
Schau mal ob sich unter /usr/bin/df eine Datei befindet. Kann sein, dass die Datei bei dir unter /bin/df liegt (oder woanders).

Also einmal nach der Datei suchen:

Code: Select all

find / -name "df"
und dann die /etc/sudoers.d/keyhelp anpassen, in dem du diese Zeile:

Code: Select all

keyhelp ALL = (ALL) NOPASSWD: /usr/bin/df
Mit dieser ersetzen (sofern sich die Datei denn unter /bin/df befindet):

Code: Select all

keyhelp ALL = (ALL) NOPASSWD: /usr/bin/df, /bin/df

Re: Keyhelp 24.1 Security Alert Mail bei Login ins Panel

Posted: Tue 11. Jun 2024, 12:28
by l_fish
Alexander wrote: Tue 11. Jun 2024, 12:16 Schau mal ob sich unter /usr/bin/df eine Datei befindet. Kann sein, dass die Datei bei dir unter /bin/df liegt (oder woanders).
Genau das war es, danke! :) Nach Hinzufügen von /bin/df in der keyhelp-sudoer-Datei kommt keine Mail mehr.

Re: Keyhelp 24.1 Security Alert Mail bei Login ins Panel

Posted: Tue 11. Jun 2024, 22:49
by ShortSnow
Hi,

bei mir ebenfalls aufgetreten: Debian 11.9 (64-bit)

Datei in /bin/df und entsprechend der Anweisung zugefügt. Danach keine Mails mehr.

Gruß Arne

Re: Keyhelp 24.1 Security Alert Mail bei Login ins Panel

Posted: Wed 12. Jun 2024, 09:48
by Ralph
da könnten eventl. auch Variablen verwendet werden ...

Code: Select all

which df