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

[Serverless] Allow authentication via the Elasticsearch JWT realm with the shared_secret client authentication type. #161564

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions config/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,5 @@ server.versioned.strictClientVersionCheck: false
xpack.spaces.maxSpaces: 1
xpack.spaces.allowFeatureVisibility: false

# Temporarily allow unauthenticated access to task manager utilization & status/stats APIs for autoscaling
status.allowAnonymous: true
xpack.task_manager.unsafe.authenticate_background_task_utilization: false
# Allow authentication via the Elasticsearch JWT realm with the `shared_secret` client authentication type.
elasticsearch.requestHeadersWhitelist: ["authorization", "es-client-authentication"]
4 changes: 4 additions & 0 deletions packages/kbn-es/src/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const mockSettings = [
'abc.def=1',
'xpack.security.authc.realms.oidc.oidc1.rp.client_secret=secret',
'xpack.security.authc.realms.oidc.oidc1.rp.client_id=client id',
'xpack.security.authc.realms.jwt.jwt1.client_authentication.shared_secret=jwt_secret',
'discovery.type=single-node',
];

Expand All @@ -20,6 +21,7 @@ test('`parseSettings` parses and returns all settings by default', () => {
['abc.def', '1'],
['xpack.security.authc.realms.oidc.oidc1.rp.client_secret', 'secret'],
['xpack.security.authc.realms.oidc.oidc1.rp.client_id', 'client id'],
['xpack.security.authc.realms.jwt.jwt1.client_authentication.shared_secret', 'jwt_secret'],
['discovery.type', 'single-node'],
]);
});
Expand All @@ -29,13 +31,15 @@ test('`parseSettings` parses and returns all settings with `SettingsFilter.All`
['abc.def', '1'],
['xpack.security.authc.realms.oidc.oidc1.rp.client_secret', 'secret'],
['xpack.security.authc.realms.oidc.oidc1.rp.client_id', 'client id'],
['xpack.security.authc.realms.jwt.jwt1.client_authentication.shared_secret', 'jwt_secret'],
['discovery.type', 'single-node'],
]);
});

test('`parseSettings` parses and returns only secure settings with `SettingsFilter.SecureOnly` filter', () => {
expect(parseSettings(mockSettings, { filter: SettingsFilter.SecureOnly })).toEqual([
['xpack.security.authc.realms.oidc.oidc1.rp.client_secret', 'secret'],
['xpack.security.authc.realms.jwt.jwt1.client_authentication.shared_secret', 'jwt_secret'],
]);
});

Expand Down
1 change: 1 addition & 0 deletions packages/kbn-es/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/
const SECURE_SETTINGS_LIST = [
/^xpack\.security\.authc\.realms\.oidc\.[a-zA-Z0-9_]+\.rp\.client_secret$/,
/^xpack\.security\.authc\.realms\.jwt\.[a-zA-Z0-9_]+\.client_authentication\.shared_secret$/,
];

function isSecureSetting(settingName: string) {
Expand Down