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

Improve ownership and permissions of files in OpenSearch-Dashboards deb and rpm packages #3952

Conversation

smortex
Copy link
Contributor

@smortex smortex commented Sep 1, 2023

Description

Similar to the issue fixed in #3898, OpenSearch-Dashboards package has
unexpected files owner and permissions.

This ensure the installed files are not owner by the
opensearch-dashboards user (preventing the program to overwrite itself
with malicious code if the service has some kind of vulnerability), and
make sure logs and data cannot be accessed by random users.

Issues Resolved

Fixes #3815

@smortex
Copy link
Contributor Author

smortex commented Sep 1, 2023

Cc @peterzhuamazon who worked on the OpenSearch part of this PR.

@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Merging #3952 (407415f) into main (4743a92) will increase coverage by 0.00%.
Report is 26 commits behind head on main.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #3952   +/-   ##
=======================================
  Coverage   92.06%   92.06%           
=======================================
  Files         187      187           
  Lines        5669     5673    +4     
=======================================
+ Hits         5219     5223    +4     
  Misses        450      450           

see 1 file with indirect coverage changes

Copy link

@Endalaust Endalaust left a comment

Choose a reason for hiding this comment

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

Approved. Well done.

@smortex smortex changed the title Fix files ownership and permissions for Dashboards Fix files ownership and permissions for OpenSearch-Dashboards packages Sep 4, 2023
@smortex smortex changed the title Fix files ownership and permissions for OpenSearch-Dashboards packages Fix files ownership and permissions in OpenSearch-Dashboards packages Sep 4, 2023
@peterzhuamazon
Copy link
Member

Taking a look on it soon.

Similar to the issue fixed in opensearch-project#3898, OpenSearch-Dashboards package has
unexpected files owner and permissions.

This ensure the installed files are not owner by the
opensearch-dashboards user (preventing the program to overwrite itself
with malicious code if the service has some kind of vulnerability), and
make sure logs and data cannot be accessed by random users.

Signed-off-by: Romain Tartière <[email protected]>
@smortex smortex force-pushed the deb-rpm-owner-permission-dashboards branch from fc480af to 407415f Compare September 11, 2023 18:50
Copy link
Member

@peterzhuamazon peterzhuamazon left a comment

Choose a reason for hiding this comment

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

Thanks @smortex, approved.

@peterzhuamazon peterzhuamazon merged commit b5f7ae2 into opensearch-project:main Sep 11, 2023
12 checks passed
@smortex smortex deleted the deb-rpm-owner-permission-dashboards branch September 11, 2023 20:03
smortex added a commit to smortex/opensearch-build that referenced this pull request Sep 19, 2023
In  opensearch-project#3952, the permissions where changed to fix some inconsistencies in
the .deb and .rpm packaging.

This change restricted access to the configuration files (which where
previously readable by all users) but failed to adjust the files
permissions so that the service can access these files.

Ensure the configuration directory and files belong to the root user and
the opensearch-dashboards group

Signed-off-by: Romain Tartière <[email protected]>
smortex added a commit to smortex/opensearch-build that referenced this pull request Sep 19, 2023
In  opensearch-project#3952, the permissions where changed to fix some inconsistencies in
the .deb and .rpm packaging.

This change restricted access to the configuration files (which where
previously readable by all users) but failed to adjust the files
ownership so that the service can access these files.

Ensure the configuration directory and files belong to the root user and
the opensearch-dashboards group

Signed-off-by: Romain Tartière <[email protected]>
@smortex smortex changed the title Fix files ownership and permissions in OpenSearch-Dashboards packages Improve ownership and permissions of files in OpenSearch-Dashboards deb and rpm packages Sep 19, 2023
@peterzhuamazon peterzhuamazon self-assigned this Sep 19, 2023
peterzhuamazon added a commit to peterzhuamazon/opensearch-build that referenced this pull request Sep 19, 2023
peterzhuamazon pushed a commit to peterzhuamazon/opensearch-build that referenced this pull request Sep 19, 2023
peterzhuamazon pushed a commit to peterzhuamazon/opensearch-build that referenced this pull request Sep 19, 2023
peterzhuamazon pushed a commit to peterzhuamazon/opensearch-build that referenced this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Defaut config permission too relaxed in deb and rpm packages
3 participants