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

Changing webadmin user and pass #40

Closed
krisavi opened this issue Sep 26, 2017 · 1 comment
Closed

Changing webadmin user and pass #40

krisavi opened this issue Sep 26, 2017 · 1 comment

Comments

@krisavi
Copy link

krisavi commented Sep 26, 2017

Seems like with the current setup it is not possible to change the user and password.

When I use the environment variables on swarm, where it might have data folders already created and restart the nagios container. It will not change the user nor password due to file already existing.

if [ ! -f "${NAGIOS_HOME}/etc/htpasswd.users" ] ; then

From htpasswd documentation I can read out that current flags set on file creation might not be the best
https://httpd.apache.org/docs/current/programs/htpasswd.html

-c Create the passwd file. If passwd file already exists, it is rewritten and truncated. This option cannot be combined with the -n option.
-s Use SHA encryption for passwords. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif). This algorithm is insecure by today's standards.
-b Use batch mode; i.e., get the password from the command line rather than prompting for it. This option should be used with extreme care, since the password is clearly visible on the command line. For script use see the -i option. Available in 2.4.4 and later.

"-c" one is ok, and will make the bash check if file exists even redundant and would make it to overwrite it.
"-b" seems ok, will just let the creation from bash.
"-s" seems a bit bad choice, since authentication is handled by apache only, I don't think there is a need to use SHA. Default is MD5 and -B gives bcrypt which is considered as very secure, at least by the documentation there.

@JasonRivers
Copy link
Owner

Changing the password within the nagios container could mean that you will lose all of your changes when there is an update to the container.
The correct way to do this would be to mount /opt/nagios/etc as an external volume and make your changes there, This way when you update the container you won't lose any changes you have made.

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

No branches or pull requests

2 participants