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

Allow specifying a fixed prefix and maximum allowed length for accounts generated by the Active Directory backend #449

Closed
soenkeliebau opened this issue Jun 20, 2024 · 6 comments · Fixed by #454
Assignees
Labels
customer-request release/2024-11 release-note Denotes a PR that will be considered when it comes time to generate release notes.

Comments

@soenkeliebau
Copy link
Member

We should enhance the secret operator to give a certain degree of influence over the accounts that it generates in active directory, when using this backend for Kerberos principals.

Necessary functionality:

  • specify a fixed prefix that should be prepended to all samaccountnames of like for example "svc01"
  • specify a maximum length for the overall length of samaccountname (if used in conjunction with the prefix, the overall length counted together with the prefix and the generated portion of the name should not exceed this value)
@nightkr
Copy link
Member

nightkr commented Jun 26, 2024

I'm curious about the max length one, we should already be hard-coded to fit within AD's limits. Do they systems that limit it further?

There's also the problem that the shorter it gets, the more likely collissions get... :/

@soenkeliebau
Copy link
Member Author

soenkeliebau commented Jun 26, 2024

Do we think collisions are a real issue?
For example what this user wants would give us 10 characters for the random part, with numbers, upper- and lowercase letters that gives us 62^10 combinations (839299365868340224) - sounds okay, but I know that for this type of things large numbers can be deceiving :)

ChatGPT says this:

The probability of at least one collision occurring when randomly generating 10,000 hash values from a possible
839299365868340224 is approximately 5.96×10 ^ −11 , which is extremely small. This suggests that collisions are highly unlikely with such a large number of possibilities and relatively few generated values.

Not sure about the length restriction, I can check, but I don't think there is anything we can do there, if we touch this anyway, it might be best to just accept it, make it configurable and add a note to the docs about "you shouldn't need to set this, but if you do, please make sure you consider possible collisions"..

@nightkr
Copy link
Member

nightkr commented Jun 28, 2024

I was confusing CN and samAccountName here. CN is problematic, sAN is just random anyway so we can set it to whatever.

@lfrancke
Copy link
Member

lfrancke commented Sep 4, 2024

Can you please include a link to the docs and include a snippet we can use for the release notes?
And is this a CRD change requiring any actions by the users?

@nightkr
Copy link
Member

nightkr commented Sep 11, 2024

Docs: https://docs.stackable.tech/home/nightly/secret-operator/secretclass#ad-samaccountname

Release notes: "Added support for customizing sAMAccountName generation"

The CRD change is purely additive, by default it will keep the old behaviour.

@maxgruber19
Copy link

Just wanted to let you know that this is perfectly fine, we're looking forward to 24.11 :-) thanks for your quick solution

@lfrancke lfrancke added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-request release/2024-11 release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
Development

Successfully merging a pull request may close this issue.

4 participants