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

change tedge mosquitto configuration file permissions from 600 to 644 #2154

Closed
reubenmiller opened this issue Aug 12, 2023 · 4 comments
Closed
Labels
improvement User value
Milestone

Comments

@reubenmiller
Copy link
Contributor

Is your feature improvement request related to a problem? Please describe.

Running mosquitto as a non-root user is not possible as the tedge mosquitto files under /etc/tedge/mosquitto-conf/*.conf are only readable by the root user (e.g. the files have the permission 0o0600). Changing the tedge mosquitto configuration files to 0o0644 would fix this, and it would also align the file permissions to those used by the /etc/mosquitto/mosquitto.conf.

Below shows the difference between the tedge and mosquitto configuration files.

tedge configuration files

$ ls -l /etc/tedge/mosquitto-conf/
total 8
-rw------- 1 root root 1149 Jul 19 16:07 c8y-bridge.conf
-rw------- 1 root root  261 Jul 19 15:58 tedge-mosquitto.conf

tedge configuration files

$ ls -l /etc/mosquitto/mosquitto.conf
-rw-r--r-- 1 root root 392 Jun 27 22:07 /etc/mosquitto/mosquitto.conf

Describe the solution you'd like

Change the file permissions from 0o0600 to 0o0644 for all files created under the /etc/tedge/mosquitto-conf/ directory.

Describe alternatives you've considered

Additional context

@reubenmiller reubenmiller added the improvement User value label Aug 12, 2023
@didier-wenzek
Copy link
Contributor

I would consider to do this along #2012

@reubenmiller
Copy link
Contributor Author

reubenmiller commented Sep 21, 2023

The implementation was done exactly as described in the ticket description.

  1. create a new c8y bridge configuration via tedge connect c8y
  2. Check the file permissions on the bridge files as described in the ticket description

@gligorisaev gligorisaev self-assigned this Sep 22, 2023
@gligorisaev
Copy link
Contributor

QA has thoroughly checked the feature and here are the results:

  • Test for ticket exists in the test suite.
  • QA has tested the feature and it meets the required specifications.

@reubenmiller
Copy link
Contributor Author

This issue was only partially closed. The c8y-bridge.conf file still need to have its permissions set to 644 instead of 600 to allow non-root users to read it.

A PR was opened to included system tests to verify this functionality. #2334

@reubenmiller reubenmiller removed their assignment Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement User value
Projects
None yet
Development

No branches or pull requests

4 participants