SECURITY 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. USER/GROUP RESTRICTIONS
  26. -----------------------
  27. The NRPE daemon cannot be run with (effective) root user/group
  28. privileges. You must run the daemon with an account that does
  29. not have superuser rights. Use the nrpe_user and nrpe_group
  30. directives in the config file to specify which user/group the
  31. daemon should run as.
  32. ENCRYPTION
  33. ----------
  34. If you do enable support for command arguments in the NRPE daemon,
  35. make sure that you encrypt communications either by using:
  36. 1. Stunnel (see http://www.stunnel.org for more info)
  37. 2. Native SSL support
  38. Do NOT assume that just because the daemon is behind a firewall
  39. that you are safe! Always encrypt NRPE traffic!
  40. USING ARGUMENTS
  41. ---------------
  42. How do you use command arguments? Well, lets say you define a
  43. command in the NRPE config file that looks like this:
  44. command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
  45. You could then call the check_nrpe plugin like this:
  46. ./check_nrpe -H <host> -c check_users -a 5 10
  47. The arguments '5' and '10' get substituted into the appropriate
  48. $ARGx$ macros in the command ($ARG1$ and $ARG2$, respectively).
  49. The command that would be executed by the NRPE daemon would look
  50. like this:
  51. /usr/local/nagios/libexec/check_users -w 5 -c 10
  52. You can supply up to 16 arguments to be passed to the command
  53. for substitution in $ARG$ macros ($ARG1$ - $ARG16$).
  54. -- Ethan Galstad (nagios@nagios.org)