Security and Protection#
Your IT documentation is the memory of your organization -- it contains network diagrams, credentials, contract details, and infrastructure knowledge. An attacker who gains access to your CMDB effectively has a blueprint of your entire IT. That is why i-doit deserves the same level of protection as any other critical system.
This article follows the classic protection goals: confidentiality, integrity, availability, authenticity, and authorization. The measures are organized by timing -- before installation, after installation, and during ongoing operation.
Collection of ideas, not a mandatory checklist
Not every measure fits every environment. An internal test system needs less hardening than a production CMDB with 50,000 objects. Evaluate each recommendation with common sense -- and document deliberate exceptions.
Before installation#
Before you install i-doit, you should harden the underlying system. The examples refer to Debian GNU/Linux or Ubuntu but can be adapted to other distributions.
Minimal Operating System#
Install only what is necessary for operation: Apache, PHP, and MariaDB. The less software running, the smaller the attack surface.
1 2 3 4 5 | |
Disable and remove unnecessary services:
1 2 3 | |
The principle of minimalism also applies to Apache and PHP -- disable unnecessary modules:
1 2 | |
phpMyAdmin
Do not install phpMyAdmin on production systems. It makes the database accessible via the browser and has repeatedly been affected by security vulnerabilities in the past. Use the command line (mysql) or a local tool like DBeaver via an SSH tunnel instead.
Less Privileges Is More#
Never work permanently as superuser (root). Use sudo for commands that require root privileges. Services like Apache run under their own users (e.g., www-data) -- this limits the damage if a service is compromised.
Secure SSH#
SSH, alongside Apache, is often the only externally accessible service. The configuration is located at /etc/ssh/sshd_config.
Disable root login:
1 | |
Set up public key authentication:
1 2 | |
Disable password login (only after key-based login is working!):
1 2 | |
Then restart the SSH service:
1 | |
Updates, Updates, Updates#
Keep the entire system up to date -- this includes i-doit itself, the operating system, and all connected third-party systems. Security vulnerabilities in outdated software are one of the most common attack vectors.
For automatic security updates on Debian/Ubuntu, Unattended Upgrades is a good choice:
1 2 | |
Secure MariaDB#
First, run mysql_secure_installation -- this removes test databases, anonymous users, and sets a root password.
Then check the configured users:
1 | |
Delete unwanted entries (e.g., wildcards % or external addresses). Only localhost, 127.0.0.1, and ::1 should be allowed. Make sure the default port 3306 is not accessible from the outside.
Secure PHP#
Always keep PHP on the latest patch level. The settings required for i-doit can be found in the system settings. Additional hardening can be achieved via a dedicated configuration file:
1 | |
1 2 3 4 5 6 7 8 | |
Enable:
1 2 | |
Adjust PHP version
Replace 8.2 with the PHP version you are using. Which versions i-doit supports can be found in the system requirements.
Backup and Restore#
Backups are your last line of defense -- against attacks, human error, and hardware failures. Read the article on backing up and restoring data.
Equally important: Test restores regularly. A backup that cannot be restored is worthless.
Encrypt backups: When backups are stored on external media or in the cloud, encrypt them -- e.g., with gpg:
1 | |
For emergencies, a second, independent instance is recommended -- e.g., an exported VM in OVF format on a USB drive in a fireproof safe.
Transport Encryption (TLS)#
Secure the communication between browser and server with TLS so that credentials and CMDB data are not transmitted in plain text over the network.
Let's Encrypt (Recommended)#
The easiest way to obtain a trusted certificate is Let's Encrypt with the ACME client Certbot:
1 2 | |
Certbot automatically configures Apache and sets up certificate renewal via cronjob. Test the renewal:
1 | |
Apache TLS Configuration#
If you use your own certificates, use a modern TLS configuration. Use the Mozilla SSL Configuration Generator for a current configuration tailored to your Apache version.
Example for Apache with security headers:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
Check your configuration with:
- SSL Labs by Qualys -- Evaluate TLS configuration
- securityheaders.io -- Check security headers
Client Certificates#
A step further is securing access via client certificates: not only does the browser verify the server certificate, but the web server also verifies the client. This is a strong additional authentication layer but requires distributing and managing client certificates.
Data Encryption#
Full disk encryption protects against theft. On GNU/Linux, dm-crypt/LUKS is widely used -- many distributions offer this during installation. On Windows, BitLocker and VeraCrypt are available.
This is especially relevant when the hardware is not located in your own data center or when i-doit runs on a laptop.
After installation#
File System Permissions#
Set restrictive file permissions:
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Before an update, temporarily relax the restrictions:
1 2 3 | |
Secure Passwords#
Set secure passwords for all accounts from the start. The default passwords after installation are publicly known -- change them immediately.
Default Users in i-doit#
The users admin, reader, author, and editor have the password set to the same as the username by default. This is the most important point after installation:
- Change all default passwords
- Create a dedicated person object for each real user
- Archive the default users after setup
Admin Center Password#
You can change the password in the Admin Center under Config or directly in the file src/config.inc.php.
MySQL Users#
1 | |
Also store the new password in the system database:
1 2 3 | |
Additionally, update it in src/config.inc.php or in the Admin Center under Config.
Linux Users#
1 | |
Enable CSRF Protection#
Cross-Site Request Forgery (CSRF) is an attack where a user unknowingly performs actions in i-doit because they clicked a manipulated link. Enable protection in the Admin Center under:
System Settings > Security > CSRF Token > Yes
Two-Factor Authentication#
i-doit offers built-in two-factor authentication (2FA). This requires users to provide an additional code from an authenticator app in addition to their password. Especially recommended for admin accounts and users with write access.
Additional authentication mechanisms can be set up via the Apache web server, e.g., via Single Sign-On (SSO).
Configure Session Timeout#
By default, sessions in i-doit remain active for a very long time. For security-critical environments, you should shorten the session timeout so that forgotten browser windows do not remain open indefinitely.
The setting can be found in the expert settings under session.time -- the value is specified in seconds. A sensible value for production environments is 3600 (1 hour).
Secure the API#
The JSON-RPC API is a powerful tool -- and an attractive attack target. If you use the API, you should secure it specifically:
- Keep the API key secret -- the key grants full access. Treat it like a password.
- Restrict access by IP -- allow API access only from known systems. You can do this via the Apache configuration or a firewall rule:
1 2 3 4 | |
- Create a dedicated API user -- do not use the admin account for API access. Create a dedicated user with minimal permissions.
- Disable the API if it is not needed -- the add-on can be deactivated in Administration.
Firewall and Network#
Minimize Open Ports#
Every closed port reduces the attack surface. For i-doit, the following ports are typically sufficient:
| Port | Service | Note |
|---|---|---|
| 443 | HTTPS | i-doit web interface |
| 22 | SSH | Administration (ideally only from the admin network) |
MariaDB (3306) should never be accessible from the outside.
A simple firewall with ufw:
1 2 3 4 5 6 | |
Security by Obscurity
Non-standard ports (e.g., 8080, 8022) do not provide real protection. Port scanners like nmap find open ports in seconds.
For Apache, there is also the web application firewall mod_security, which detects and blocks attack patterns in HTTP requests.
Firewall Rules for i-doit#
For i-doit to download updates, verify licenses, and use online repositories, the following destinations must be reachable:
| Host | Protocol | Port | Purpose |
|---|---|---|---|
| login.i-doit.com | HTTPS | 443 | Updates for i-doit and add-ons |
| center.i-doit.com | HTTPS | 443 | Add-on & Subscription Center IPs: 159.69.103.121, 78.46.236.49, 35.158.127.51, 35.158.127.52, 35.158.127.53IPv6: 2a01:4f8:c01f:289a::, 2a01:4f8:1c17:a07c:: |
| crm-gateway.i-doit.com | HTTPS | 443 | Downloads via license token |
| lizenzen.i-doit.com | HTTPS | 443 | Retrieve licenses via token |
| reports-ng.i-doit.org | HTTPS | 443 | Online repository for reports |
| r.i-doit.com | HTTPS | 443 | Online repository for templates |
| i-doit.com | HTTPS | 443 | Update check |
Interfaces to Third-Party Applications#
| Interface | Protocol | Default Port |
|---|---|---|
| Send emails | SMTP | 25 / 465 / 587 |
| LDAP/AD | LDAP / LDAPS | 389 / 636 |
| JDisc Discovery | PostgreSQL | 25321 |
| JDisc Discovery | HTTP | 9000 |
| JDisc Discovery GraphQL | HTTPS | 443 |
| Livestatus | Livestatus | 6557 |
| Znuny Help Desk, Request Tracker | HTTP/HTTPS | 80 / 443 |
Trusted Network#
- No direct internet access -- place i-doit behind a reverse proxy or in an internal network. Use an HTTP proxy for updates.
- Dedicated admin network -- allow SSH only from the management network so that only the core function (HTTPS) is accessible from the office network.
IPv4 vs. IPv6#
If IPv6 is not used in your network, disable it on the server. If it is used, firewall rules and service configurations must cover both protocols -- a firewall with only IPv4 rules does not protect against IPv6 access.
Security Frameworks#
On GNU/Linux, SELinux and AppArmor provide additional protection against unauthorized actions. They allow you to confine Apache so that it can only access specific directories -- even if an attacker exploits a vulnerability in PHP.
Automatically Block Attacks#
fail2ban analyzes log files and automatically blocks IP addresses after repeated failed login attempts:
1 | |
Pre-configured rules exist for SSH, Apache, and MariaDB. For i-doit itself, you can create a custom rule that detects failed logins in the Apache logs.
Monitoring and Logs#
Monitor the System#
Monitor the system with a network monitoring solution like Checkmk or Nagios. Important metrics:
- CPU and memory utilization
- Available disk space
- Apache and MariaDB processes
- Certificate validity (TLS)
- Backup success
Evaluate Logs#
The i-doit log files are located in the log/ directory of the installation. Evaluate them regularly -- especially after updates and when unexpected behavior occurs.
For automatic log monitoring, Logwatch is suitable:
1 | |
Logwatch analyzes logs from Apache, SSH, and other services and sends a daily report via email.
If the system needs to send emails, set up an SMTP relay -- e.g., with msmtp.
Regular Security Audits#
Security is not a one-time project but an ongoing process. Conduct regular audits (e.g., quarterly):
| Checkpoint | How |
|---|---|
| Operating system up to date? | apt update && apt list --upgradable |
| PHP version still supported? | Check system requirements |
| i-doit up to date? | Check release notes |
| Default passwords changed? | Test login with admin/admin |
| Backup functional? | Perform restore on test system |
| TLS configuration current? | SSL Labs |
| Unused users present? | Check user list in i-doit |
| Open ports minimal? | sudo ss -tulpen |
| API access restricted? | Check Apache logs for unknown IPs |
| File permissions correct? | find /var/www/html -perm -o+w |
High Availability#
Really necessary?
In most cases, a single, well-maintained system is sufficient. The system requirements for i-doit are moderate. Before planning a redundant setup, invest in a well-thought-out backup concept and fast recoverability instead.
For increased availability, you can run the services on dedicated systems: Apache behind a load balancer, MariaDB in a cluster (e.g., with MaxScale), files in distributed storage.
On a smaller scale, RAID, ECC RAM, and redundant power supplies on different power phases (ideally with a UPS) help.
Further Reading#
- BSI IT-Grundschutz -- Systematic IT security
- Mozilla SSL Configuration Generator -- Generate TLS configurations
- CIS Benchmarks -- Hardening guidelines for operating systems and services