Skip to content

mgr/smb: cluster linked join auth and users/groups resource types - #57180

Merged
adk3798 merged 14 commits into
ceph:mainfrom
phlogistonjohn:jjm-smb-linked-res
Jun 11, 2024
Merged

adk3798 merged 14 commits into
ceph:mainfrom
phlogistonjohn:jjm-smb-linked-res

Conversation

@phlogistonjohn

@phlogistonjohn phlogistonjohn commented Apr 30, 2024 •

Copy link
Copy Markdown
Contributor

Depends on #56350

Drop the embedded versions of the join source and users and groups configs from the cluster resource type. This means that potentially sensitive information is always stored in a separate resource from the less-sensitive general cluster config. Future changes can then make security related choices about those specific resource types without worrying about having embedded variants inside the cluster resources.

The embedded values are moved to 'linked resources'. The JoinAuth and UsersAndGroups resource types gain a new optional field linked_to_cluster that binds the resource to a single cluster resource instance, making it exclusive to that cluster and automatically removed if the cluster resource is removed. Making it a suitable replacement for the embedded resources when used from the CLI command smb cluster create ....

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

There's no need for order_resources to be a method. Make order_resources
a proper function.

Signed-off-by: John Mulligan <[email protected]>
There's no need for these to be methods as they're largely
self-contained. Functions should be easier to unit-test independently in
the future too.

Signed-off-by: John Mulligan <[email protected]>
Split the ConfigStore protocol into a new base protocol that covers the
methods needed to list keys in a store, called ConfigStoreListing.

Signed-off-by: John Mulligan <[email protected]>
This in-memory staging area for new resources being applied to the
config helps simplify validation.

Signed-off-by: John Mulligan <[email protected]>
The linked_to_cluster field will be used for resources that must be
life-cycled along side the cluster using them. This is mainly intended
for use with `cluster create` command line commands.

Signed-off-by: John Mulligan <[email protected]>
This will be used later to create resources that are not directly named
by a user.

Signed-off-by: John Mulligan <[email protected]>
The new squash method works similarly to `one` but permits multiple
resources to be reported on by moving them into the report for the
"parent" resource. This is meant for upcoming changes to `cluster
create` when it starts using linked join auths and linked
users-and-groups.

Signed-off-by: John Mulligan <[email protected]>
Convert the smb mgr module cli to use linked join auth and
users-and-groups resources when created on the `cluster create` command
line. These linked resources with have semi-ranodmized names and be
linked to the cluster that we're creating on the CLI.

Signed-off-by: John Mulligan <[email protected]>
Drop the embedded versions of the join source and usrers and groups
configs from the cluster resource type. This means that potentially
sensitive information is *always* stored in a separate resource
from the less-sensitive general cluster config. Future changes can
then make security related choices about those specific resources
without worrying about having embedded variants inside the cluster.

For convenience I added a new "emtpy" users and groups source type that
can be used for testing. It defines *no* users and groups (an empty set
basically). This wouldn't be useful in a production scenario today as it
would deploy an smbd that you couldn't log into. But for unit testing
it's extremely handy, and maybe it can be used for integration testing
too.

This is a large change because lots of unit tests relied on embedded
join auths or users-and-groups. I tried to handle all the breaking
changes in one go for bisect-ability.

Signed-off-by: John Mulligan <[email protected]>
Update the documentation to match the code, removing references to
source_types 'inline' and 'password' and uris. Adding documentation
of the new linked_to_cluster field.

Signed-off-by: John Mulligan <[email protected]>
@phlogistonjohn
phlogistonjohn marked this pull request as ready for review May 7, 2024 18:30
@phlogistonjohn
phlogistonjohn requested a review from a team as a code owner May 7, 2024 18:30
@phlogistonjohn
phlogistonjohn requested a review from a team May 7, 2024 20:32

@adk3798 adk3798 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Note: did not review test changes



def rand_name(prefix: str, max_len: int = 18, suffix_len: int = 8) -> str:
trunc = prefix[: (max_len - suffix_len)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's probably unnecessary, but do we want to validate here that max_len is greater than suffix_len

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Next time I touch that function I'll add that

class JoinSourceType(_StrEnum):
PASSWORD = 'password'
HTTP_URI = 'http_uri'
RESOURCE = 'resource'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there much point to still having this enum if it only has one option?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not a lot, but it leaves us options for the future.

@adk3798

adk3798 commented Jun 11, 2024

Copy link
Copy Markdown
Contributor

https://pulpito.ceph.com/adking-2024-06-10_15:49:42-orch:cephadm-wip-adk-testing-2024-06-10-0759-distro-default-smithi/

failures consisted of

  • 18 in cluster log type failures, still being cleaned up and a known issue
  • 3 failures in the cleanup of rados_api_tests, don't know the tracker number but this is a known issue
  • 2 failures in mds_upgrade_sequence, known issue
  • 1 failure with staggered upgrade while agent is active, known issue
  • lots of dead jobs due to Error reimaging machines: Failed to power on smithiXXX, general lab/teuthology issue unrelated to the PRs in the run

Nothing to block merging for most PRs in the run

@adk3798
adk3798 merged commit 4098fa1 into ceph:main Jun 11, 2024
@phlogistonjohn
phlogistonjohn deleted the jjm-smb-linked-res branch June 13, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants