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

Strict file mode (permissions) setting? #3200

Open
ainar-g opened this issue May 28, 2021 · 4 comments
Open

Strict file mode (permissions) setting? #3200

ainar-g opened this issue May 28, 2021 · 4 comments
Assignees
Milestone

Comments

@ainar-g
Copy link
Contributor

ainar-g commented May 28, 2021

Currently, AGH creates most of its files and directories with permissions like 0o644 (-rw-r--r--) for non-executable files and 0o755 (-rwxr-xr-x) for executables and directories. CWE and securego.io recommend these to be no greater than 0o600 (-rw-------) and 0o750 (-rwxr-x---) correspondingly.

I propose that we add a setting, strict_file_mode, which makes AGH make these 0o600 and 0o750/0o700. I would like it to be set to true by default, but that could break people's backup and other scripts. Perhaps it should only be true for new installations?

@ameshkov, what do you think?

Related:

@ameshkov
Copy link
Member

ameshkov commented Jun 2, 2021

Tbh, I don't like the idea of adding one more setting.

Also, I don't fully see any viable reason for making these settings stricter. I mean it's okay to have 600 for the config file (since it contains secrets), but it's okay for other files that do not have any secrets to be 644.

@ainar-g
Copy link
Contributor Author

ainar-g commented Jun 2, 2021

@ameshkov, I would say that the query log, stats, and sessions can also be quite sensitive. And after that, the only things that are left are filters and the stuff we do during the automatic update. Do we really want two sets of permissions?

@ameshkov
Copy link
Member

ameshkov commented Jun 2, 2021

IMO, it's better to have it than one more setting

@ainar-g ainar-g added this to the v0.108.0 milestone Jul 14, 2021
@ameshkov ameshkov modified the milestones: v0.108.0, v1.0.0 Jan 27, 2022
@ameshkov
Copy link
Member

Let's think about it later, I still don't like that this is a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants