Skip to content

Commit

Permalink
[Serverless] Disable Advanced settings plugin (#159819)
Browse files Browse the repository at this point in the history
Partially addresses #159590

## Summary

This PR disables the Advanced settings plugin for all projects in
serverless.

**How to test:**

1. Start Elasticsearch with `yarn es snapshot` and Kibana with `yarn
serverless-{mode}` where {mode} can be `es`, `security`, or `oblt`.
2. Verify that the Advanced settings app is not accessible and its
endpoint (`app/management/kibana/settings`) leads to the Stack
Management landing page.

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
ElenaStoeva and kibanamachine authored Jun 22, 2023
1 parent 33e0734 commit ca425e8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ xpack.license_management.enabled: false
xpack.reporting.enabled: false
xpack.cloud_integrations.data_migration.enabled: false
data.search.sessions.enabled: false
advanced_settings.enabled: false

# Enforce restring access to internal APIs see https://github.com/elastic/kibana/issues/151940
# server.restrictInternalApis: true
Expand Down
20 changes: 20 additions & 0 deletions src/plugins/advanced_settings/server/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { schema, TypeOf } from '@kbn/config-schema';
import { PluginConfigDescriptor } from '@kbn/core-plugins-server';

const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
});

export type AdvancedSettingsConfig = TypeOf<typeof configSchema>;

export const config: PluginConfigDescriptor<AdvancedSettingsConfig> = {
schema: configSchema,
};
2 changes: 2 additions & 0 deletions src/plugins/advanced_settings/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
import { PluginInitializerContext } from '@kbn/core/server';
import { AdvancedSettingsServerPlugin } from './plugin';

export { config } from './config';

export const plugin = (initContext: PluginInitializerContext) =>
new AdvancedSettingsServerPlugin(initContext);
2 changes: 2 additions & 0 deletions src/plugins/advanced_settings/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"@kbn/core-notifications-browser",
"@kbn/core-theme-browser",
"@kbn/core-ui-settings-common",
"@kbn/config-schema",
"@kbn/core-plugins-server",
],
"exclude": [
"target/**/*",
Expand Down

0 comments on commit ca425e8

Please sign in to comment.