Hi,
i’ve created a module that can be used to administer the system. This module consists of some php-files to set some system-settings through the Admin-Interface of the PBX and some binary files (c++ code), which do the changes. As most of the changes can only be done by root, these binaries need to be owned by root and have the setuid-bit enabled.
To prevent regular users with shell access to the PBX system from changing system settings, the module creates an entry in a MySQL table containing the “section” and the current timestamp when it is accessed through the admin interface. The corresponding binary checks before making changes whether such an entry has been created in the appropriate table within a certain time frame and only executes the changes if it finds such an entry. So for example if you change the IP address through the Web-Interface, the module creates an entry in the table with the section “network” and the current timestamp and then executes the corresponding binary. This binary checks if an entry with the section “netowrk” and a timestamp within a configurable time frame exists. If so, then these changes are applied.
The following changes could be done through this module so far:
- Network Settings (support for ifupdown, network-manager, systemd-networkd and netplan)
– IPv4 and IPv6 assignment method
– IPv4/v6 Address, Netmask and Gateway
– Ipv6 Autoconf enabled/disabled
– Accept IPv6 Router Advertisment (enabled/disabled) - DNS (if /etc/resolv.conf is updated through another program (e.g. systemd-resolved), this module is aware of this and does not change /etc/resolv.conf directly)
– Change name servers
– Change dns search list - Change Hostname/Domainname
- Change Timezone
- Notification Settings*
– Change sender email address
– Change Storage email-address - eMail Configuration (Currently, only Postfix is supported)
– Send email via remote or directly via local MTA
– Support for TLS encryption
– Use authentication when sending mail via remote MTA (yes/no) - Power management
– Shut down
– Restart - Packet Capture (via tcpdump)
– Start/Stop/Download/Delete capture - Storage
– View current disk space used
– Support for different raid-levels including sync-status and spare devices
– Sends a warning email when the used storage exceeds a configurable threshold
*Since some (all?) modules which send email rely on the function sysadmin_get_storage_email, this setting is currently not recognized by these modules. Either these modules would need to be revised to work with the open-source version, or an alias function would need to be created in the open-source module.
Since I am not a software developer and only program for fun in my spare time, I cannot support the module as much as it needs. Therefore, the module would need to be supported and further developed also by others/the community.
Any thoughts on that? Do you think this is a nice/needed module? Any comments are appreciated.
Best regards,
Hannes