Skip to content

Conversation

phlogistonjohn
Copy link
Collaborator

A satellite service is a service provided by sambacc that "orbits" smbd or another core samba daemon, providing it optional enhanced features.

Our first sattelite service is keybridge - a server process that provides a varlink based RPC over a local unix socket. The keybridge server acts like a key-value store, where keys are embedded in a particular scope. That scope can be simple - such as a mapping in memory - or complex such as a KMIP client. Keybridge exists to hide complexity from smbd allowing it to focus on getting key material using this simple API.

@phlogistonjohn phlogistonjohn changed the title Add keybridge sattelite service Add keybridge satellite service Jul 11, 2025
@phlogistonjohn phlogistonjohn force-pushed the jjm-keybridge branch 2 times, most recently from 472129b to 1601762 Compare July 13, 2025 19:13
Fixes: samba-in-kubernetes#160

While it's not strictly necessary to make the protobuf file(s) part of
the python library because we generate the code ahead of time this
silences a warning from setuptools as well as making the file part
of the library, so it's distributed along with the code - which could
possibly be helpful in some situations. And it will be consistent with
our plans for varlink interface files, which do *need* to be part of
the library.

Signed-off-by: John Mulligan <[email protected]>
@phlogistonjohn
Copy link
Collaborator Author

I don't this this is necessarily 100% complete for all of our KMIP needs but I think it's sufficient for now, enough to be reviewed and possibly merged. Other bugs and features can be tackled in later PRs.

@phlogistonjohn phlogistonjohn marked this pull request as ready for review July 13, 2025 22:04
Copy link
Collaborator

@synarete synarete left a comment

Choose a reason for hiding this comment

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

Overall looks fine, but see my comments on the thread-safety for the caching mechanism.

@synarete synarete self-requested a review July 14, 2025 14:30
synarete
synarete previously approved these changes Jul 14, 2025
Copy link
Collaborator

@synarete synarete left a comment

Choose a reason for hiding this comment

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

lgtm

Define a simple-ish interface for fetching data blobs from a peer
service. The intent is that the backing service can be a basic
key-value store or a more complex secret store. The keybridge
server encapsulates the complexity of talking to a web-service or
whatnot requiring the client to only deal with identifying the
scope and key to fetch the value.
Plus debugging and introspection stuff.

Signed-off-by: John Mulligan <[email protected]>
Add a new keybridge extra. It will be used to build a server that
depends on varlink and kmip libraries. Adding it now allows mypy to
do it's thing.

Signed-off-by: John Mulligan <[email protected]>
@mergify mergify bot dismissed synarete’s stale review July 14, 2025 15:18

Pull request has been modified.

@phlogistonjohn
Copy link
Collaborator Author

Was also missing a new Recommends: for the new extra and thus it would not automatically install the pykmip and varlink dependencies. I've updated these patches to fix that problem and a test container build looks better now.

synarete
synarete previously approved these changes Jul 15, 2025
Copy link
Collaborator

@synarete synarete left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@anoopcs9 anoopcs9 left a comment

Choose a reason for hiding this comment

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

Generally lgtm. I haven't looked deep into the core KMIP and peer verification logic but the varlink server implementation (and its integration with sambacc) looks pretty good.

The sambacc varlink server types wrap the python varlink libraries types
allowing it to more flexibly initialize the services (aka endpoints).

Signed-off-by: John Mulligan <[email protected]>
Instead of constantly having to define new dedicated subcommands for
things that don't fit neatly under the `samba-container` umbrella,
create a new concept for things provided by sambacc that "orbit" the
samba & smbd processes but are very optional in most scenarios.

Establish the keybridge server as our first satellite. The keybridge
server can be set up via the sambacc config or configured/customized
by command line values. In particular, the TLS credentials needed for
KMIP can be specified on the command line while the other params
are in the file because of ceph-shaped reasons.

Signed-off-by: John Mulligan <[email protected]>
Add the new varlink and kmip related packages to the list in the
setuptools config. Sort the list of packages so it's easier to
read and understand.

Signed-off-by: John Mulligan <[email protected]>
Add the samba-satellite script to the setup.cfg configuration as well as
the example RPM spec file.

Signed-off-by: John Mulligan <[email protected]>
I am certain that the .varlink and .proto files were being added to the
source tarballs and wheels. However, when testing the container image I
found that they were missing from the RPM. After mostly fruitless web
searches and some pretty nonsense LLM responses I closely read the
output being generated by the rpm python tools and revisited the docs
and it managed to loosen something up to revisit MANIFEST.in and...
it worked.

Signed-off-by: John Mulligan <[email protected]>
@mergify mergify bot dismissed synarete’s stale review July 15, 2025 13:32

Pull request has been modified.

Copy link
Collaborator

@anoopcs9 anoopcs9 left a comment

Choose a reason for hiding this comment

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

Still lgtm.

Copy link
Collaborator

@synarete synarete left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@Shwetha-Acharya Shwetha-Acharya left a comment

Choose a reason for hiding this comment

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

lgtm

@mergify mergify bot merged commit 7827da0 into samba-in-kubernetes:master Jul 17, 2025
10 checks passed
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.

4 participants