Skip to content

Conversation

klihub
Copy link
Member

@klihub klihub commented Jul 16, 2025

This PR implements plugin authentication. The sole purpose of authenticated plugins is to allow finer-grained restrictions of selected NRI features than just a global on/off. This PR also updates the builtin default validator to allow finer-grained restrictions using overrides for authenticated plugins.

In particular the patch series

  • defines the wire protocol bits for authentication
  • implements a challenge-response authentication mostly based on the ideas in [RFC] Plugins authentication proposal #152
  • implements runtime and plugin side support for authentication
  • implements overrides for authenticated plugins in the default validator

Here are working trees of updated runtimes with support for authenticated NRI plugins and finer-grained validation using an NRI tree with this PR:

@klihub klihub marked this pull request as draft July 16, 2025 11:34
@klihub klihub force-pushed the devel/plugin-authentication branch 4 times, most recently from d47b6d6 to 34a751d Compare July 16, 2025 12:16
@klihub klihub changed the title [DRAFT] implement plugin authentication, finer-grained restrictions/validation. [RFC] implement plugin authentication, finer-grained restrictions/validation. Jul 16, 2025
@klihub klihub force-pushed the devel/plugin-authentication branch from 34a751d to 1e28cf6 Compare July 16, 2025 16:13
@klihub klihub force-pushed the devel/plugin-authentication branch from 1e28cf6 to 3997cb8 Compare August 14, 2025 16:00
@klihub klihub force-pushed the devel/plugin-authentication branch 2 times, most recently from c7f97fc to 99fec92 Compare September 10, 2025 19:39
@klihub klihub requested a review from chrishenzie September 10, 2025 19:44
@klihub klihub marked this pull request as ready for review September 10, 2025 19:46
@klihub klihub force-pushed the devel/plugin-authentication branch from 99fec92 to 63d8c5d Compare September 11, 2025 06:57
@klihub klihub changed the title [RFC] implement plugin authentication, finer-grained restrictions/validation. implement plugin authentication, finer-grained restrictions/validation. Sep 11, 2025
}

p.role.algo = algo
chal, key, err := p.role.algo.Challenge([]byte("XXtmpXXX"), req.PublicKey)
Copy link
Contributor

Choose a reason for hiding this comment

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

Judging by the name, I'm assuming this will be replaced? Should this be a random seed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Argh... that was already supposed to be replaced by a random seed. Thanks for spotting it !

@klihub klihub force-pushed the devel/plugin-authentication branch from 63d8c5d to cceb324 Compare September 16, 2025 07:04
@klihub klihub requested a review from chrishenzie September 16, 2025 07:16
@klihub klihub force-pushed the devel/plugin-authentication branch from cceb324 to 8fe3f62 Compare September 16, 2025 08:29
Neither assume that we have a single proto definition
nor hardcode proto file locations for post-processing
actions based on such an assumption.

Signed-off-by: Krisztian Litkey <[email protected]>
Add a service and protocol for challenge-response authentication.
Define an interface for authentication implementations. Implement
a default authentication, mostly based on the ideas described in
containerd#152, the proposal for
plugin authentication. Add examples/keygen.go for generating key
pairs for this default implementation.

Signed-off-by: Krisztian Litkey <[email protected]>
Add optional authentication-related information to the list
of plugin instances for validation. This should allow finer-
grained validation including loser or stricter restrictions
for authenticated vs. unauthenticated plugins.

Signed-off-by: Krisztian Litkey <[email protected]>
Add a new option for acquiring a public/private key pair from
an external source for authenticating with the runtime. Using
this option implicitly enables plugin authentication prior to
registration.

Also add a new environment variable to read keys from files.
Together with bind-mounted secrets, this should provide enough
plumbing to enable transparent authentication of containerized
plugins.

Signed-off-by: Krisztian Litkey <[email protected]>
Add support for plugin authentication. Authenticating a plugin
associates it with a role. A role has a unique name and it can
have an optional set of associated tags. These tags are opaque,
carrying no semantic meaning for authentication or NRI itself.

However, tags can have associated semantics during validation
and authorize plugins to perform otherwise restricted actions.
This is the primary intended usage for tags: allow validators
to associate rights with tags instead of role names.

Signed-off-by: Krisztian Litkey <[email protected]>
Implement role based overrides for authenticated plugins. This
allows setting a restrictive default configuration and override
it with more liberal configuration for some plugins/roles.

Signed-off-by: Krisztian Litkey <[email protected]>
Update documentation for plugin authentication and validation.

Signed-off-by: Krisztian Litkey <[email protected]>
@klihub klihub force-pushed the devel/plugin-authentication branch from 8fe3f62 to 7739284 Compare September 17, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants