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

tools: set ownership of syslog created log file to frr #4379

Closed
wants to merge 1 commit into from

Conversation

dslicenc
Copy link
Member

Problem reported with errors if "log file /var/log/frr/frr.log" is
entered and the file had been created by syslog with root ownership.
This fix sets the ownership to frr/frrvty so that the file can be
referenced and defined within frr if syslog created it.

Signed-off-by: Don Slice dslice@cumulusnetworks.com
Ticket: CM-18981

Problem reported with errors if "log file /var/log/frr/frr.log" is
entered and the file had been created by syslog with root ownership.
This fix sets the ownership to frr/frrvty so that the file can be
referenced and defined within frr if syslog created it.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-18981
@LabN-CI
Copy link
Collaborator

LabN-CI commented May 21, 2019

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/4379 cffa703
Date 05/21/2019
Start 13:30:20
Finish 13:53:57
Run-Time 23:37
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2019-05-21-13:30:20.txt
Log autoscript-2019-05-21-13:31:21.log.bz2
Memory 418 431 359

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-7777/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


CLANG Static Analyzer Summary

  • Github Pull Request 4379, comparing to Git base SHA dddcb45

No Changes in Static Analysis warnings compared to base

12 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-7777/artifact/shared/static_analysis/index.html

Copy link
Member

@qlyoung qlyoung left a comment

Choose a reason for hiding this comment

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

Makes sense to me

@donaldsharp donaldsharp requested a review from riw777 May 21, 2019 16:13
@eqvinox
Copy link
Contributor

eqvinox commented May 21, 2019

This decreases security since an attacker that has gained remote code execution under the frr user can now tamper with the log files (e.g. to remove signs of the intrusion.) Writing the log file through syslog enforces append-only semantics as long as syslog / root is not compromised; this is lost with this change.

Copy link
Contributor

@eqvinox eqvinox left a comment

Choose a reason for hiding this comment

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

The more I think about this, the more I believe we're stepping over the boundary to the sysadmin's zone of authority here.

# cause issues.

$FileOwner frr
$FileGroup frrvty
Copy link
Contributor

Choose a reason for hiding this comment

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

In addition to the intrusion problem described in my conversation comment, I'm not convinced frrvty is the right group here. It's the group that controls vty access, which human operator users can be added to so they can use vtysh without being root. If we want to give them read access, then this makes sense, but then we also need to make sure the permissions are 0640. If the permissions include group write, this opens a hole that suddenly allows operators to tamper with the logs. If the permissions are 0644, the group doesn't matter.

So either this is accompanied by a permission setting to 0640, or the group setting is underdetermined in its effect and needs to go.

Copy link
Contributor

@eqvinox eqvinox left a comment

Choose a reason for hiding this comment

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

More problems.

# CLI. Without this, log file is created with root ownership which can
# cause issues.

$FileOwner frr
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok so I just looked at the rsyslogd docs and these are global configuration parameters, which affect all following statements (the doc for $FileOwner and $FileGroup doesn't say specifically, but $FileCreateMode does and I think it's reasonable to assume these 3 work the same way.)

That would mean that the effect of these statements is not limited to 45-frr.conf (or the frr.log file created) but rather extends to any other logging config loaded after it, e.g. 50-foobar.conf.

I'm only 60% confident on this (I use syslog-ng personally), but this definitely needs to be confirmed or invalidated.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the feedback. I'll check into whether this is true or not and find alternatives.

@donaldsharp
Copy link
Member

@daveolson53 -> Thoughts here about how we can approach this issue better?

@dslicenc
Copy link
Member Author

After further discussion with Dave Olson, agree that we need to find a better answer. closing the PR.

@dslicenc dslicenc closed this May 22, 2019
@dslicenc dslicenc deleted the tools_syslog_owner branch May 22, 2019 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants