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

Review permissions for proper tool functioning #81

Open
pleia2 opened this issue Feb 11, 2022 · 4 comments
Open

Review permissions for proper tool functioning #81

pleia2 opened this issue Feb 11, 2022 · 4 comments

Comments

@pleia2
Copy link
Contributor

pleia2 commented Feb 11, 2022

We're giving the "apache" user pretty broad permissions (ownership of the whole tool) in our installation documentation, but more restricted permissions may also work, and be more appropriate from a best practices perspective.

Investigate by restricting permissions significantly and adjust documentation accordingly.

@rachejazz
Copy link
Member

For the tool to work and log printing, apache user should have read and write permissions and for the binaries to work, it should have execute permissions. The most we can do is remove sudo permissions which it already doesn't. What else could be done?

@pleia2
Copy link
Contributor Author

pleia2 commented Feb 11, 2022

At first glance, I think only the data_files/ directory really needs to be writable by the apache user since that's what is being modified, but we'll need to test that. A separate stduser (which we have in production) that is unrelated to the web server should probably own most of the files instead.

The vulnerability we want to protect against here is a security flaw in the web server itself (which the entire world has access to), so restricting how much damage the web server can do on the file system is a best practice.

@rachejazz
Copy link
Member

rachejazz commented Feb 12, 2022

https://github.com/openmainframeproject/software-discovery-tool-deploy/blob/f0a18279df4e70ee92a3384e2fde190b0c872158/.github/workflows/cicd.yml#L20

This line is followed in our deployment. Surely there should be more ways to check which process is using sudo in our server. I do have a script written for my server that sends alert on slack if some user has used sudo on my server with the pid. Should we use something like that too?

Sudo-notifier script:
https://github.com/rachejazz/DevSecOps-Automation-and-Monitoring/blob/main/sudo-notifer

@pleia2
Copy link
Contributor Author

pleia2 commented Sep 6, 2023

Now that the web server user should not require write access to the file system to do data file updates, we should do a thorough re-evaluation of ownership in our installation documentation, and probably have a specific sdt user set up to own these files instead.

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