DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Dmitry Kozlyuk" <dmitry.kozliuk@gmail.com>
Cc: "Stephen Hemminger" <stephen@networkplumber.org>, <dev@dpdk.org>
Subject: RE: [RFC] Dynamic log/trace control via telemetry
Date: Mon, 22 Aug 2022 08:47:59 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D8728C@smartserver.smartshare.dk> (raw)
In-Reply-To: <20220820181941.24882e85@sovereign>

> From: Dmitry Kozlyuk [mailto:dmitry.kozliuk@gmail.com]
> Sent: Saturday, 20 August 2022 17.20
> To: Morten Brørup
> Cc: Stephen Hemminger; dev@dpdk.org
> Subject: Re: [RFC] Dynamic log/trace control via telemetry
> 
> 2022-08-17 17:34 (UTC+0200), Morten Brørup:
> > > From: Dmitry Kozlyuk [mailto:dmitry.kozliuk@gmail.com]
> > > Sent: Wednesday, 17 August 2022 17.15
> > >
> > > 2022-08-16 19:08 (UTC-0700), Stephen Hemminger:
> > > > Not sure if turning telemetry into a do all control api makes
> sense.
> > >
> > > I'm sure it doesn't, for "do all".
> > > Controlling diagnostic collection and output, however,
> > > is directly related to the telemetry purpose.
> > >
> > > > This seems like a different API.
> >
> > I agree with Stephen regarding not making the telemetry library a "do
> all" control API. A separate API would be preferable.
> >
> > And then, a wrapper through the telemetry interface can be provided
> to that API. Best of both worlds. :-)
> 
> One of the reasons why I considered and suggested using the telemetry
> socket
> was that a new channel, protocol, and API would be an overkill for the
> task.
> 
> It reminds me of an older "IF proxy library" proposal [1].
> In the RFC discussion it was suggested that it could be a generic
> mechanism
> to deliver external events to DPDK, although, unlike events, commands
> need
> responses. I also found Thomas' message [2] that suggested log/trace
> control
> (never knew it was proposed already) but discouraged adding more
> interfaces.
> The final version of "IF proxy library" was nevertheless focused on
> netdev
> specifics and AFAICT never accepted because of questions from that
> side.
> 
> So this RFC should be severely re-framed: 1) a generic event/command
> delivery
> mechanism is needed in principle, and 2) log/trace control can be the
> first
> usage of it, which may be easier to pull through than a complex
> interaction
> with OS networking stack.
> 
> [1]: https://inbox.dpdk.org/dev/20200114142517.29522-1-
> aostruszka@marvell.com/
> 
> [2]: https://inbox.dpdk.org/dev/1734533.zqhfolzEdB@thomas/
> 

Good arguments, Dmitry.

I 100 % agree that the telemetry API/socket is appropriate for changing log/trace settings.

I'm just not sure the telemetry API/socket is usable for streaming log and trace output, and I got these two things mixed up.

> >
> > > > Also, the default would have to be disabled for application
> safety
> > > reasons.
> > >
> > > This feature would be for collecting additional info
> > > in case the collection was not planned and a restart is not
> desired.
> > > If it is disabled by default, it is likely to be off when it's
> needed.
> >
> > All tracing, logging etc. MUST be disabled by default. You are
> suggesting the opposite, which will definitely impact performance.
> >
> > And performance will become a valid argument for not adding more
> trace/logging to libraries, if all of it is enabled by default.
> >
> > And my usual rant: I hope all of this can be disabled at build time -
> for maximum performance.
> 
> The feature is a dynamic equivalent of existing --log-level/--trace
> options.
> It doesn't affect performance until used to configure logs/traces that
> do.
> Other arguments to have it off by default are valid; just to clarify.

OK. Then I have no further concerns about performance.

> 
> >
> > >
> > > Let's consider how exactly can safety be compromised.
> > >
> > > 1. Securing telemetry socket access is out of scope for DPDK,
> > >    that is, any successful access is considered trusted.
> > >
> > > 2. Even read-only telemetry still comes at cost, for example,
> > >    memory telemetry takes a global lock that blocks all
> allocations,
> > >    so affecting the app performance is already possible.
> > >
> > > 3. Important logs and traces enabled at startup may be disabled
> > > dynamically.
> > >    If it's an issue, the API can refuse to disable them.
> > >
> > > 4. Bogus logs may flood the output and slow down the app.
> > >    Bogus traces can exhaust disk space.
> > >    Logs should be monitored automatically, so flooding is just an
> > > annoyance.
> > >    Disk space can have a quota.
> > >    Since the user is trusted (item 1), even if they do it by
> mistake,
> > >    they can quickly correct themselves using the same API.
> > >
> >
> > Here's a thought:
> >
> > Add an API to set an "unlock key", so applications who don't want to
> allow these features for unauthorized users can prevent them from
> enabling it. Authorized users can use an API to unlock these features
> by providing the key.
> 
> Let's keep delegating AAA to an external proxy if needed.
> 
> Unlock key would not remove Stephen's concerns,
> because it would still be another interface to analyze and to protect.
> Worse, it's a home-grown security mechanism to consider.

Tracing, logging and telemetry has lots of existing security issues.

I agree that this fact should not prevent any new features, such as your proposal here. AAA regarding telemetry should be addressed separately.

The "unlock key" concept was inspired by the silicon world. Some chips require "keys" to unlock access to their firmware, to protect them from reverse engineering. I was thinking we could use a similar approach to protect proprietary DPDK applications from being reverse engineered through telemetry. But again, I agree with your response; let's not blend existing tracing/logging/telemetry security issues into this RFC.



      reply	other threads:[~2022-08-22  6:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15 23:17 Dmitry Kozlyuk
2022-08-17  1:25 ` fengchengwen
2022-08-17  2:08 ` Stephen Hemminger
2022-08-17 15:15   ` Dmitry Kozlyuk
2022-08-17 15:34     ` Stephen Hemminger
2022-08-17 15:34     ` Morten Brørup
2022-08-20 15:19       ` Dmitry Kozlyuk
2022-08-22  6:47         ` Morten Brørup [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98CBD80474FA8B44BF855DF32C47DC35D8728C@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).