How can I encrypt passwords in configuration files

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

How can I encrypt passwords in configuration files

Post by gdolidze »

All the config files have password that readable to anyone who views them. How can I make it so that they are encrypted.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: How can I encrypt passwords in configuration files

Post by ssax »

Unfortunately there is no way that I'm aware of to encrypt them, you could however use your /usr/local/nagios/etc/resource.cfg file to put your passwords in there and just use the vars to pull them into the commands and use filesystem perms as the best alternative.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How can I encrypt passwords in configuration files

Post by lmiltchev »

Here's a link to a document that covers the procedure of adding user macros to the resource.cfg file:

https://assets.nagios.com/downloads/nag ... Macros.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: How can I encrypt passwords in configuration files

Post by gdolidze »

Is there anyway to lock the web interface to specific IP access?
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: How can I encrypt passwords in configuration files

Post by jolson »

The web interface of Nagios? One solution is to only allow port 80/443 requests from a particular IP address. Keep in mind that passive checks may stop coming in if they use these ports to contact Nagios XI.

Code: Select all

iptables -I INPUT -p tcp -s YourIP --dport 80 -j ACCEPT
iptables -I INPUT -p tcp -s YourIP --dport 443 -j ACCEPT
service iptables save
After you have altered your firewall, remove the port 80 and port 443 ACCEPT rules from /etc/sysconfig/iptables and restart iptables.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: How can I encrypt passwords in configuration files

Post by ssax »

You could use iptables but you would have to be careful if you are using passive checks (NRDP, etc) and not block localhost as well. But no, there is no feature inherent to XI that would limit it to certain IP addresses. Or maybe look into Apache Access Control: http://httpd.apache.org/docs/2.2/howto/access.html
Locked