-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Convert security auth feature objects to LicensedFeature #79213
Conversation
This commit moves the security auth realm and engine license checks to use the new LicensedFeature class.
Pinging @elastic/es-security (Team:Security) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code changes seem fine, but
- I don't think we want to group these 2 features under a family
- I don't think the behaviour we'll get (which is the same as we currently have) is actually what we'll want.
I guess we can tackle item 2 later, but probably need to decide on item 1 now so that we introduce stable names into the API.
@@ -376,6 +376,12 @@ | |||
public static final LicensedFeature.Persistent CUSTOM_REALMS_FEATURE = | |||
LicensedFeature.persistentLenient(REALMS_FEATURE_FAMILY, "custom", License.OperationMode.PLATINUM); | |||
|
|||
private static final String AUTHORIZATION_FEATURE_FAMILY = "security-authorization"; | |||
public static final LicensedFeature.Momentary AUTHORIZATION_REALM_FEATURE = | |||
LicensedFeature.momentary(AUTHORIZATION_FEATURE_FAMILY, "realm", License.OperationMode.PLATINUM); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect authorization realms should be persistent.
They're "in use" by virtue of a setting on a realm, more than because someone authenticated using one. I think we would prefer to have them track the same way realms do (by configuration not active use).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree we should use explicit tracking, I'm just not sure all that will entail. At this point I'm just trying to remove remaining uses of XPackLicenseState.Feature so that there is no confusion or possibility of adding new values there for the life of 7.16.
@@ -376,6 +376,12 @@ | |||
public static final LicensedFeature.Persistent CUSTOM_REALMS_FEATURE = | |||
LicensedFeature.persistentLenient(REALMS_FEATURE_FAMILY, "custom", License.OperationMode.PLATINUM); | |||
|
|||
private static final String AUTHORIZATION_FEATURE_FAMILY = "security-authorization"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think bundling these under a feature family is meaningful (unless we bundle all of security under a common family).
Authorization realms and Authorization engines don't have any relationship with one another other than both being security features (and having similar words in the name).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll remove the family, the similarity of the name made me think they were related. With that in mind, is there a more descriptive name we can use for these? "security-authorization-realm" is going to be confusing with the security realms feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The public Yaml setting is authorization_realms
, and the internal classes refer to it as DelegatedAuthorization
The docs uses both terms (they refer to the concept as "Delegating Authorization ...", but also reference the name of the setting.
My feeling was that authorization-realm[s]
is more helpful because it ties into something tangible in the docs (a specific setting), but delegated-authorization
would be fine.
public static final LicensedFeature.Momentary AUTHORIZATION_REALM_FEATURE = | ||
LicensedFeature.momentary(AUTHORIZATION_FEATURE_FAMILY, "realm", License.OperationMode.PLATINUM); | ||
public static final LicensedFeature.Momentary AUTHORIZATION_ENGINE_FEATURE = | ||
LicensedFeature.momentary(AUTHORIZATION_FEATURE_FAMILY, "engine", License.OperationMode.PLATINUM); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the same is true for an AuthorizationEngine. It's a type of plugin, and I think we want to consider it to be in use any time one is installed in the cluster.
I am reomving myself as a reviewer since @tvernum is already on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
If you want to change the feature name from security-authorization-realm
to security-delegated-authorization
(or a variant on that) that's fine too.
Thanks, I updated the name as suggested. |
💔 Backport failed
You can use sqren/backport to manually backport by running |
This commit moves the security auth realm and engine license checks to use the new LicensedFeature class.
This commit moves the security auth realm and engine license
checks to use the new LicensedFeature class.