Skip to content

Permissions too restrictive on /etc/mysql/my.cnf #32

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

Closed
wants to merge 2 commits into from

Conversation

justintime
Copy link

Since /etc/mysql/my.cnf contains the [client] section, normal
users need to be able to read that file. We should set 0644
on /etc/mysql/my.cnf, but use 0400 on /etc/my.cnf and
/root/.my.cnf because they contain passwords in plaintext.

I gotta run, and won't be back until Tues Jan 3rd. Let me know if I need to file a bug report -- if anyone wants to save me the trouble, I'd appreciate it :)

users need to be able to read that file.  We should set 0644
on /etc/mysql/my.cnf, but use 0400 on /etc/my.cnf and
/root/.my.cnf because they contain passwords in plaintext.
}
}
}
File {
owner => 'root',
group => 'root',
mode => '0400',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary. You should override the default on the one file you want to be different (/etc/mysql/my.cnf) so just set the mode on that one resource and leave the resource default.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the 'default' is a matter of taste here. I see it as more of a "default is 644, but if there's passwords in the file, override the default and make the perms 400". Also, out of the box, the $etc_root_password variable won't be set, so you'll have one file 644, the other 400, making it a 50/50 split.

Certainly not anything I'll spend a lot of energy debating on though :) If after reading this you still would prefer it changed, just let me know and I'll fix it up.

I'm creating the issue on puppetlabs now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with that, but I'd still prefer to have a file resource default. If we add another file resource I'd prefer to have some reasonable default mode. I guess the question is it better to be open by default or closed. Considering the importance of security in this module, I'd err on the side of being locked down by default.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me - see 579651c

@ccaum
Copy link
Contributor

ccaum commented Jan 4, 2012

Definitely file a bug. Set the category to mysql http://projects.puppetlabs.com/projects/modules/issues

@justintime
Copy link
Author

Bug filed at: http://projects.puppetlabs.com/issues/11720

…le permissions and using a default of 0400; overriding it to 0644 when needed.
@ccaum
Copy link
Contributor

ccaum commented Jan 6, 2012

@kbarber Can you give a thumbs up/down?

@branan
Copy link
Contributor

branan commented Apr 29, 2012

👍 from me on this

@branan
Copy link
Contributor

branan commented May 3, 2012

This change is in b1f90fd

@branan branan closed this May 3, 2012
pmcmaw pushed a commit to pmcmaw/puppetlabs-mysql that referenced this pull request Mar 3, 2021
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

Successfully merging this pull request may close these issues.

4 participants