-
Notifications
You must be signed in to change notification settings - Fork 30
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
KRB5_TRACE documentation for gssproxy #43
Conversation
@jacobshivers I am ok with this, but I am curious, KRB5_TRACE output will already be logged to the journal at debug level 3, why do you need to override the output and send it to a file? Is this to avoid flooding the regular logs with debug information? |
In my tests, setting debug_level = 3 does not send trace information to the system journal. I had to manually specific a location for KRB5_TRACE for the data to be logged. |
Well this line: Line 18 in dbc4820
sends KRB5_TRACE to stderr, so it should definitely end up in the journal. If not I would know why, did you modify your systemd unit in some way? Or maybe there have been changes to what systemd logs now from stdout/stderr? |
Also on my system: What does your system show? |
and does adding StandardError=journal in a systemd drop file make any difference? |
RHEL 8.5
Fedora 35:
RHEL 7.9
None of those systems direct KRB5_TRACE to the system journal by default. Adding StandardError=journal requires adjusting max message size for rsyslogd:
Even after increasing the max message size, I still do not see KRB5_TRACE messages Edited to properly interpret code |
And ack to adjusting language. It is why I also avoided even providing a description for a custom SELinux module. That can could lead to some unnecessary changes. |
It is an issue with SELinux
|
Actually, even setting SELinux into permissive did not resolve this nor did setting StandardError output to a fil:
So once the issue with writing to stderr is resolved, there will probably need to be some adjustments for SELinux as well. |
This is so odd .. |
@jacobshivers there seems to be something wrong on your system, as those denials show gssproxy running with init_d label. This is what I have on my system (which is correct):
See how on my system the process is running with gssproxy_t label Can you check that your gssproxy binary has the correct label?
If not you may want to restorecon it. |
I have the same label
|
The init_t label is for systemd
|
Ok then it is the attempt to: The other two avcs I see them too but one is related to "proc" and the other is unclear but seems irrelevant. I also verified that setting debug_level=3 does not get me the KRB5_TRACE output. I suspect the problem is that opening /dev/stderr explicitly does not work because the journal is not reading from the devices, but rather creating new files for FD 0, 1, 2, so opening /dev/stderr will work on the command line when manually running gssproxy but does not work to pipe to the journal. Could you change your configuration back to pristine and then only add: If this works I think the readme text should note that KRB5_TRACE does no work in a systemd environment by just setting debug_level= 3 and provide this Environment variable setting trick as the solution to get out krb5 trace logs. |
Looking at the audit message again, seing the ENXIO seems to be for /dev/stderr. type=SYSCALL msg=audit(03/07/2022 17:11:12.753:95) : arch=x86_64 syscall=openat success=no exit=ENXIO(No such device or address
I can confirm the below works and is how I was obtaining the KRB5_TRACE information originally
Do you think that we should add a new doc and a small blurb in The wording for the doc should also reflect the requirement of creating a separate trace file if desired. I am going to mull this over. |
Interesting I did not get an ENXIO avc line in my quick testing |
I see ENXIO on RHEL 8.5, but not F35. |
I think all should be in the new doc, I am also ok with a mention in the manpage that tells people to look at the KRB5_TRACE.md for more info |
Gor #fedora-devel on IRC: So yeah writing to /dev/stderr simply can't work when launched from systemd. So I think we definitely need to document this in the short term. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposed addition detailing systemd behavior.
docs/KRB5_TRACE.md
Outdated
|
||
**At level 3 and above, KRB5_TRACE output is logged. If KRB5_TRACE was already set in the execution environment, trace output is sent to its value instead.** | ||
|
||
can be done either by including `KRB5_TRACE=/path/to/location` when executing gssproxy at the command line or by including a location within a drop file loaded by systemd. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"..loaded by systemd. Systemd does not open /dev/stderr
and instead creates a file descriptor for stderr when gssproxy is started. A drop file is necessary to record KRB5_TRACE
information as gssproxy directs KRB5_TRACE
to /dev/stderr
.
1cacb1a
to
5918c9b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think with these two changes we can merge this
Added KRB5_TRACE.md to provide a brief overview on how to enable low level Kerberos tracing below gssapi via KRB5_TRACE. Updated gssproxy.conf man page to cite newly added doc when mentioning KRB5_TRACE behavior. Signed-off-by: Jacob Shivers <jacob.shivers@redhat.com>
5918c9b
to
30a4104
Compare
Added KRB5_TRACE.md to provide a brief overview on how to enable
low level Kerberos tracing below gssapi via KRB5_TRACE.
Signed-off-by: Jacob Shivers jacob.shivers@redhat.com