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

Allow configuring permissions for log files #5441

Open
achenand opened this issue Mar 7, 2019 · 8 comments
Open

Allow configuring permissions for log files #5441

achenand opened this issue Mar 7, 2019 · 8 comments
Labels
theme/operator-usability Replaces UX. Anything related to making things easier for the practitioner type/enhancement Proposed improvement or new feature

Comments

@achenand
Copy link

achenand commented Mar 7, 2019

On Linux I used -log-file flag to redirect all the Consul agent log messages to a local file, for some reason the log file was created with the permission that is write only by owner, for example:

--w------- 1 fispguat fispguat 91300 Mar 6 12:54 consul_20190306-114637-1551890797918163665.log

Is this write only permission by design of consul? I have not found anything in documentation and existing issues so would appreciate any insights from consul team.

@mkeeler
Copy link
Member

mkeeler commented Mar 7, 2019

@achenand This was definitely not intended. #5346 was for the same thing and was fixed in version 1.4.3. If you upgrade, log files will now be created rw permissions for the owner and read only permissions for the group.

@mkeeler mkeeler closed this as completed Mar 7, 2019
@achenand
Copy link
Author

Hi Matt,
This "rw permissions for the owner and read only permissions for the group." is still too restrictive for our use case. We would like to have read access for users in different groups.

Could you make it possible to allow an umask to be supplied along with the -log-file flag?
Thanks again.

@mkeeler mkeeler reopened this Mar 11, 2019
@mkeeler mkeeler changed the title -log-file flag created log file in write only permission Allow configuring permissions for log files Mar 11, 2019
@mkeeler mkeeler added type/enhancement Proposed improvement or new feature theme/operator-usability Replaces UX. Anything related to making things easier for the practitioner labels Mar 11, 2019
@mkeeler
Copy link
Member

mkeeler commented Mar 11, 2019

@achenand I reopened the issue and edited the title to more closely align with what I think the request is.

Could you elaborate on your usage a bit. Particularly what sorts of permissions you are desiring or how you would desire those log files to be created.

@achenand
Copy link
Author

Thanks for updating the title.
I am looking to have "644" as the log file permission on Linux servers, "rw" for owner, "r" for group and others. In our use case, developers are only allowed to access production Linux boxes as a low-privileged users while consul process is run as a higher-privileged service id.

In another note, when I specified the complete path along with the name of the log file in -log-file flag the {timestamp} was still appended. For example I have specified the name of the log file as consul_20190311-141420.log
But actual log file name still have {timestamp} added, is it possible to remove this additional {timestamp} to match the behavior described by the documentation?
consul_20190311-141420-1552328060963016440.log

-log-file - to redirect all the Consul agent log messages to a file. This can be specified with the complete path along with the name of the log. In case the path doesn't have the filename, the filename defaults to consul-{timestamp}.log. Can be combined with -log-rotate-bytes and -log-rotate-duration for a fine-grained log rotation experience.

@neillyt
Copy link
Contributor

neillyt commented Aug 10, 2019

Hi, 644 would be very good for me as well as I'd like to ingest these logs into Splunk. However, Splunk runs under a pretty non-privileged user in our case. With the logs having an unpredictable name (as it uses a timestamp) it is tough to get around this. Any help on this would be appreciated.

@dheide951
Copy link

dheide951 commented Oct 25, 2021

Has there been any update on this topic? I am also looking to have these logs go into splunk and need 644 permissions.

Or is there a way to change the group of the logs?

@3eka
Copy link

3eka commented Dec 3, 2021

+1

1 similar comment
@cunningriver777
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/operator-usability Replaces UX. Anything related to making things easier for the practitioner type/enhancement Proposed improvement or new feature
Projects
None yet
Development

No branches or pull requests

6 participants