SECURITY 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. ********************
  2. NRPE SECURITY README
  3. ********************
  4. TCP WRAPPER SUPPORT
  5. ===================
  6. NRPE 2.x includes native support for TCP wrappers. The older
  7. host access list directive was removed from the config file.
  8. Make sure your system supports TCP wrappers before running NRPE.
  9. Once you compile NRPE you can check to see if it has wrapper
  10. support built in by running the daemon from the command line
  11. without any arguments like this:
  12. ./nrpe --help
  13. COMMAND ARGUMENTS
  14. =================
  15. NRPE 2.0 includes the ability for clients to supply arguments to
  16. commands which should be run. Please note that this feature
  17. should be considered a security risk, and you should only use
  18. it if you know what you're doing!
  19. BASH COMMAND SUBSTITUTION
  20. -------------------------
  21. Even with the metacharacter restrictions below, if command arguments
  22. are enabled, it is still possible to send bash command substitions
  23. in the form $(...) as an agrument. This is explicity disabled by
  24. default, but can be enabled by a configure-time option and a
  25. configuration file option. Enabling this option is VERY RISKY and
  26. its use is HIGHLY DISCOURAGED.
  27. ENABLING ARGUMENTS
  28. ------------------
  29. To enable support for command argument in the daemon, you must
  30. do two things:
  31. 1. Run the configure script with the --enable-command-args
  32. option
  33. 2. Set the 'dont_blame_nrpe' directive in the NRPE config
  34. file to 1.
  35. ENABLING BASH COMMAND SUBSTITUTION
  36. ----------------------------------
  37. To enable support for arguments containing bash command substitions,
  38. you must do two things:
  39. 1. Enable arguments as described above
  40. 2. Include the --enable-bash-command-substitution configure
  41. option when running the configure script
  42. 3. Set the 'allow_bash_command_substitutions' directive in the
  43. NRPE config file to 1.
  44. ILLEGAL METACHARS
  45. -----------------
  46. To help prevent some nasty things from being done by evil
  47. clients, the following metacharacters are not allowed
  48. in client command arguments:
  49. | ` & > < ' " \ [ ] { } ; !
  50. Any client request which contains the abovementioned metachars
  51. is discarded.
  52. USER/GROUP RESTRICTIONS
  53. -----------------------
  54. The NRPE daemon cannot be run with (effective) root user/group
  55. privileges. You must run the daemon with an account that does
  56. not have superuser rights. Use the nrpe_user and nrpe_group
  57. directives in the config file to specify which user/group the
  58. daemon should run as.
  59. ENCRYPTION
  60. ----------
  61. If you do enable support for command arguments in the NRPE daemon,
  62. make sure that you encrypt communications either by using:
  63. 1. Stunnel (see http://www.stunnel.org for more info)
  64. 2. Native SSL support
  65. Do NOT assume that just because the daemon is behind a firewall
  66. that you are safe! Always encrypt NRPE traffic!
  67. USING ARGUMENTS
  68. ---------------
  69. How do you use command arguments? Well, lets say you define a
  70. command in the NRPE config file that looks like this:
  71. command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
  72. You could then call the check_nrpe plugin like this:
  73. ./check_nrpe -H <host> -c check_users -a 5 10
  74. The arguments '5' and '10' get substituted into the appropriate
  75. $ARGx$ macros in the command ($ARG1$ and $ARG2$, respectively).
  76. The command that would be executed by the NRPE daemon would look
  77. like this:
  78. /usr/local/nagios/libexec/check_users -w 5 -c 10
  79. You can supply up to 16 arguments to be passed to the command
  80. for substitution in $ARG$ macros ($ARG1$ - $ARG16$).
  81. -- Ethan Galstad (nagios@nagios.org)