-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Describe the bug
Icingadb by default writes out the command, along with arguments used for a check, to the mysql database. This is visible in the check_commandline column of the service_state table.
I get the value in this, it allows you to see what was executed for a specific check and is great for debugging. The flip side of this is that its a very common pattern with nagios style checks to take credentials as command line arguments. Look no further than the ITL for lots of examples where checks take command line arguments that will contain credentials.
Being in the database is one thing, since access to this is likely limited, but the worse part of this issue is that icingaweb2 with the icingadb module will then show the check command and arguments in the source of a service. This means that anyone with access to view a service in icingaweb2 could potentially learn credentials, which is a pretty big issue.
While you could filter the display of these command line arguments in icingaweb, thats not the solution in my opinion. The database containing credentials in plaintext is the root of the issue here, and filtering the credentials in the UI is just a bandaid.
I understand that there is an argument to be made about never using command line arguments to pass credentials, but the reality is this is extremely prevalent, even in the ITL.
To Reproduce
Configure icinga2 with icingadb, and the icingaweb2 interface
Have some check that passes credentials as command line arguments
Expected behavior
Icingadb should provide the ability to redact command lines arguments from being written to the database, or a similar solution that doesn't involve credentials being exposed to users. I would imagine this be exposed as a knob that users can turn, since some might want the command line arguments exposed. Perhaps a more complete solution would be to allow users to redact the values of certain arguments, instead of just all of nothing.
Your Environment
- Icinga DB version: 1.1.1-g6c8b52f
- Icinga 2 version: 2.14.3
- icinga web version: v2.12.4
- Operating System and version: Rocky Linux 9