Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up certificates does not work if user != icinga #617

Closed
joernott opened this issue May 26, 2020 · 0 comments · Fixed by #618
Closed

Setting up certificates does not work if user != icinga #617

joernott opened this issue May 26, 2020 · 0 comments · Fixed by #618

Comments

@joernott
Copy link
Contributor

My customer is using an enmvironment specific user for monitoring. When defining this user in hiera via

icinga2::globals::user: "mon-%{::umgebung}"
icinga2::globals::group: "mon-%{::umgebung}"

the execs for certificate generation and retrieval fail, as the folders belong to the monitoring user and /sbin/icinga2 runs as root. As it is switching to icinga automagically somewhere, it can't access the folders and puppet runs fail with messages like

Error: '"/sbin/icinga2" pki request --host ppr-mon0-ems-v02-mgmt.sf-rz.de --port 5665 --ca /var/lib/icinga2/certs/ca.crt --key /var/lib/icinga2/certs/vpt-krn3-bcl-v62.sf-rz.de.key --cert /var/lib/icinga2/certs/vpt-krn3-bcl-v62.sf-rz.de.crt --trustedcert /var/lib/icinga2/certs/trusted-cert.crt --ticket redacted' returned  instead of one of [0]

Expected Behavior

Icinga uses the user we specify in the globals to run /sbin/icinga2

Current Behavior

The exec runs as root and /sbin/icinga2 switches to the default icinga user and fails due to missing permissions

Possible Solution

Setting the environment when running /sbin/icinga2

Steps to Reproduce (for bugs)

  1. Create a different user than icinga
  2. Define the user in hiera
  3. Add a host as client with those settings

Context

Using an environment specific monitoring users which has only access to things in that environment. This preventsthe use of a compromised monitoring user from one environment in another to access log files or other possibly sensitive files.

Your Environment

  • Module icinga2 v2.3.0 (in prod) and v2.4.1 in dev and preproduction
  • Puppet version (puppet -V): v6.4.3
  • Operating System and version: RHEL 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant