SECURITY 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ********************
  2. NRPE SECURITY README
  3. ********************
  4. NRPE 2.0 includes the ability for clients to supply arguments to
  5. commands which should be run. Please note that this feature
  6. should be considered a security risk, and you should only use
  7. it if you know what you're doing!
  8. ENABLING ARGUMENTS
  9. ------------------
  10. To enable support for command argument in the daemon, you must
  11. do two things:
  12. 1. Run the configure script with the --enable-command-args
  13. option
  14. 2. Set the 'dont_blame_nrpe' directive in the NRPE config
  15. file to 1.
  16. ILLEGAL METACHARS
  17. -----------------
  18. To help prevent some nasty things from being done by evil
  19. clients, the following twelve metacharacters are not allowed
  20. in client command arguments:
  21. | ` & > < ' " \ [ ] { }
  22. Any client request which contains the abovementioned metachars
  23. is discarded. Also, the bang character (!) is not allowed, as
  24. it is used internally as a delimiter between command arguments.
  25. ENCRYPTION
  26. ----------
  27. If you do enable support for command arguments in the NRPE daemon,
  28. make sure that you encrypt communications either by using:
  29. 1. Stunnel (see http://www.stunnel.org for more info)
  30. 2. Native SSL support
  31. Do NOT assume that just because the daemon is behind a firewall
  32. that you are safe! Always encrypt NRPE traffic!
  33. USING ARGUMENTS
  34. ---------------
  35. How do you use command arguments? Well, lets say you define a
  36. command in the NRPE config file that looks like this:
  37. command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
  38. You could then call the check_nrpe plugin like this:
  39. ./check_nrpe -H <host> -c check_users -a 5 10
  40. The arguments '5' and '10' get substituted into the appropriate
  41. $ARGx$ macros in the command ($ARG1$ and $ARG2$, respectively).
  42. The command that would be executed by the NRPE daemon would look
  43. like this:
  44. /usr/local/nagios/libexec/check_users -w 5 -c 10
  45. You can supply up to 16 arguments to be passed to the command
  46. for substitution in $ARG$ macros ($ARG1$ - $ARG16$).
  47. -- Ethan Galstad (nagios@nagios.org)