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

Remove deprecated xpack.security.enabled config option #111681

Merged
merged 7 commits into from
Oct 25, 2021
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
14 changes: 0 additions & 14 deletions docs/settings/security-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@ You do not need to configure any additional settings to use the
[[general-security-settings]]
==== General security settings

[cols="2*<"]
|===
| `xpack.security.enabled`
| deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."]
By default, {kib} automatically detects whether to enable the
{security-features} based on the license and whether {es} {security-features}
are enabled. +
+
Do not set this to `false`; it disables the login form, user and role management
screens, and authorization using <<kibana-privileges>>. To disable
{security-features} entirely, see
{ref}/security-settings.html[{es} security settings].
|===

[float]
[[authentication-security-settings]]
==== Authentication security settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ kibana_vars=(
xpack.security.authc.saml.realm
xpack.security.authc.selector.enabled
xpack.security.cookieName
xpack.security.enabled
xpack.security.encryptionKey
xpack.security.loginAssistanceMessage
xpack.security.loginHelp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function ({ getService }: FtrProviderContext) {

expect(resp.body).to.be.an('array');

expect(resp.body.length).to.be(12);
expect(resp.body.length).to.be(33);
Copy link
Contributor Author

@watson watson Oct 21, 2021

Choose a reason for hiding this comment

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

@elastic/fleet I think this test is yours? I had to bump the expected number to 33 as the array now contains a lot of enterprise_search integrations that wasn't included previously. I think this is because the enterprise_search plugin simply wasn't loaded previously because since it has the security plugin as a dependency, which was disabled and is now enabled. Could be the same for all the new integrations.

These are the extra 21 integrations
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/box',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'box',
    title: 'Box',
    description: 'Search over your files and folders stored on Box with Workplace Search.',
    categories: [ 'document_storage' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/confluence_cloud',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'confluence_cloud',
    title: 'Confluence Cloud',
    description: 'Search over your organizational content on Confluence Cloud with Workplace Search.',
    categories: [ 'knowledge_platform' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/confluence_server',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'confluence_server',
    title: 'Confluence Server',
    description: 'Search over your organizational content on Confluence Server with Workplace Search.',
    categories: [ 'knowledge_platform' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/dropbox',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'dropbox',
    title: 'Dropbox',
    description: 'Search over your files and folders stored on Dropbox with Workplace Search.',
    categories: [ 'document_storage' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/github',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'github',
    title: 'GitHub',
    description: 'Search over your projects and repos on GitHub with Workplace Search.',
    categories: [ 'software_development' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/github_enterprise_server',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'github_enterprise_server',
    title: 'GitHub Enterprise Server',
    description: 'Search over your projects and repos on GitHub Enterprise Server with Workplace Search.',
    categories: [ 'software_development' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/gmail',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'gmail',
    title: 'Gmail',
    description: 'Search over your emails managed by Gmail with Workplace Search.',
    categories: [ 'communication' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/google_drive',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'google_drive',
    title: 'Google Drive',
    description: 'Search over your documents on Google Drive with Workplace Search.',
    categories: [ 'document_storage' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/jira_cloud',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'jira_cloud',
    title: 'Jira Cloud',
    description: 'Search over your project workflow on Jira Cloud with Workplace Search.',
    categories: [ 'project_management' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/jira_server',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'jira_server',
    title: 'Jira Server',
    description: 'Search over your project workflow on Jira Server with Workplace Search.',
    categories: [ 'project_management' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/one_drive',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'onedrive',
    title: 'OneDrive',
    description: 'Search over your files stored on OneDrive with Workplace Search.',
    categories: [ 'document_storage' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/salesforce',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'salesforce',
    title: 'Salesforce',
    description: 'Search over your content on Salesforce with Workplace Search.',
    categories: [ 'crm' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/salesforce_sandbox',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'salesforce_sandbox',
    title: 'Salesforce Sandbox',
    description: 'Search over your content on Salesforce Sandbox with Workplace Search.',
    categories: [ 'crm' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/servicenow',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'servicenow',
    title: 'ServiceNow',
    description: 'Search over your content on ServiceNow with Workplace Search.',
    categories: [ 'enterprise_management' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/share_point',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'sharepoint_online',
    title: 'SharePoint Online',
    description: 'Search over your files stored on SharePoint Online with Workplace Search.',
    categories: [ 'document_storage' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/slack',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'slack',
    title: 'Slack',
    description: 'Search over your messages on Slack with Workplace Search.',
    categories: [ 'communication' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/zendesk',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'zendesk',
    title: 'Zendesk',
    description: 'Search over your tickets on Zendesk with Workplace Search.',
    categories: [ 'customer_support' ]
  },
  {
    type: 'ui_link',
    uiInternalPath: '/app/enterprise_search/workplace_search/sources/add/custom',
    icons: [ [Object] ],
    isBeta: false,
    shipper: 'enterprise_search',
    id: 'custom_api_source',
    title: 'Custom API Source',
    description: 'Search over anything by building your own integration with Workplace Search.',
    categories: [ 'custom' ]
  },
  {
    type: 'ui_link',
    id: 'app_search_web_crawler',
    title: 'Web Crawler',
    description: "Add search to your website with App Search's web crawler.",
    categories: [ 'website_search' ],
    uiInternalPath: '/app/enterprise_search/app_search/engines/new?method=crawler',
    icons: [ [Object] ],
    shipper: 'enterprise_search',
    isBeta: false
  },
  {
    type: 'ui_link',
    id: 'app_search_json',
    title: 'JSON',
    description: 'Search over your JSON data with App Search.',
    categories: [ 'upload_file' ],
    uiInternalPath: '/app/enterprise_search/app_search/engines/new?method=json',
    icons: [ [Object] ],
    shipper: 'enterprise_search',
    isBeta: false
  },
  {
    type: 'ui_link',
    id: 'app_search_api',
    title: 'API',
    description: "Add search to your application with App Search's robust APIs.",
    categories: [ 'custom' ],
    uiInternalPath: '/app/enterprise_search/app_search/engines/new?method=api',
    icons: [ [Object] ],
    shipper: 'enterprise_search',
    isBeta: false
  }


// Test for sample data card
expect(resp.body.findIndex((c: { id: string }) => c.id === 'sample_data_all')).to.be.above(
Expand Down
11 changes: 5 additions & 6 deletions test/common/services/security/test_user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ export class TestUser extends FtrService {
export async function createTestUserService(ctx: FtrProviderContext, role: Role, user: User) {
const log = ctx.getService('log');
const config = ctx.getService('config');
const kibanaServer = ctx.getService('kibanaServer');

const enabledPlugins = config.get('security.disableTestUser')
? []
: await kibanaServer.plugins.getEnabledIds();

const enabled = enabledPlugins.includes('security') && !config.get('security.disableTestUser');
const enabled =
!config
.get('esTestCluster.serverArgs')
.some((arg: string) => arg === 'xpack.security.enabled=false') &&
!config.get('security.disableTestUser');

if (enabled) {
log.debug('===============creating roles and users===============');
Expand Down
1 change: 0 additions & 1 deletion test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default async function ({ readConfigFile }) {
'--savedObjects.maxImportPayloadBytes=10485760',

// to be re-enabled once kibana/issues/102552 is completed
'--xpack.security.enabled=false',
'--xpack.reporting.enabled=false',
],
},
Expand Down
3 changes: 0 additions & 3 deletions x-pack/plugins/security/server/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ describe('config schema', () => {
"selector": Object {},
},
"cookieName": "sid",
"enabled": true,
"encryptionKey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"loginAssistanceMessage": "",
"public": Object {},
Expand Down Expand Up @@ -110,7 +109,6 @@ describe('config schema', () => {
"selector": Object {},
},
"cookieName": "sid",
"enabled": true,
"encryptionKey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"loginAssistanceMessage": "",
"public": Object {},
Expand Down Expand Up @@ -164,7 +162,6 @@ describe('config schema', () => {
"selector": Object {},
},
"cookieName": "sid",
"enabled": true,
"loginAssistanceMessage": "",
"public": Object {},
"secureCookies": false,
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/security/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ const providersConfigSchema = schema.object(
);

export const ConfigSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
loginAssistanceMessage: schema.string({ defaultValue: '' }),
showInsecureClusterWarning: schema.boolean({ defaultValue: true }),
loginHelp: schema.maybe(schema.string()),
Expand Down
30 changes: 0 additions & 30 deletions x-pack/plugins/security/server/config_deprecations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,34 +357,4 @@ describe('Config Deprecations', () => {
]
`);
});

it('warns when the security plugin is disabled', () => {
const config = {
xpack: {
security: {
enabled: false,
},
},
};
const { messages, migrated } = applyConfigDeprecations(cloneDeep(config));
expect(migrated).toEqual(config);
expect(messages).toMatchInlineSnapshot(`
Array [
"Disabling the security plugin \\"xpack.security.enabled\\" will only be supported by disable security in Elasticsearch.",
]
`);
});

it('does not warn when the security plugin is enabled', () => {
const config = {
xpack: {
security: {
enabled: true,
},
},
};
const { messages, migrated } = applyConfigDeprecations(cloneDeep(config));
expect(migrated).toEqual(config);
expect(messages).toHaveLength(0);
});
});
24 changes: 0 additions & 24 deletions x-pack/plugins/security/server/config_deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,28 +157,4 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({
});
}
},
(settings, fromPath, addDeprecation) => {
if (settings?.xpack?.security?.enabled === false) {
addDeprecation({
configPath: 'xpack.security.enabled',
title: i18n.translate('xpack.security.deprecations.enabledTitle', {
defaultMessage: 'Disabling the security plugin "xpack.security.enabled" is deprecated',
}),
message: i18n.translate('xpack.security.deprecations.enabledMessage', {
defaultMessage:
'Disabling the security plugin "xpack.security.enabled" will only be supported by disable security in Elasticsearch.',
}),
correctiveActions: {
manualSteps: [
i18n.translate('xpack.security.deprecations.enabled.manualStepOneMessage', {
defaultMessage: `Remove "xpack.security.enabled" from your Kibana configuration.`,
}),
i18n.translate('xpack.security.deprecations.enabled.manualStepTwoMessage', {
defaultMessage: `To turn off security features, disable them in Elasticsearch instead.`,
}),
],
},
});
}
},
];
4 changes: 3 additions & 1 deletion x-pack/test/alerting_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
},
},
})}`,
...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`),
...disabledPlugins
.filter((k) => k !== 'security')
.map((key) => `--xpack.${key}.enabled=false`),
...plugins.map(
(pluginDir) =>
`--plugin-path=${path.resolve(__dirname, 'fixtures', 'plugins', pluginDir)}`
Expand Down
4 changes: 3 additions & 1 deletion x-pack/test/case_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
`--xpack.actions.allowedHosts=${JSON.stringify(['localhost', 'some.non.existent.com'])}`,
`--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`,
'--xpack.eventLog.logEntries=true',
...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`),
...disabledPlugins
.filter((k) => k !== 'security')
.map((key) => `--xpack.${key}.enabled=false`),
// Actions simulators plugin. Needed for testing push to external services.
...alertingPlugins.map(
(pluginDir) =>
Expand Down
4 changes: 3 additions & 1 deletion x-pack/test/lists_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
...xPackApiIntegrationTestsConfig.get('kbnTestServer'),
serverArgs: [
...xPackApiIntegrationTestsConfig.get('kbnTestServer.serverArgs'),
...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`),
...disabledPlugins
.filter((k) => k !== 'security')
.map((key) => `--xpack.${key}.enabled=false`),
`--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'alerts')}`,
`--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'actions')}`,
`--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'task_manager')}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
},
kbnTestServer: {
...apiConfig.get('kbnTestServer'),
serverArgs: [...apiConfig.get('kbnTestServer.serverArgs'), `--xpack.security.enabled=false`],
serverArgs: [...apiConfig.get('kbnTestServer.serverArgs')],
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
testFiles: [resolve(__dirname, './reporting_without_security')],
kbnTestServer: {
...reportingConfig.get('kbnTestServer'),
serverArgs: [
...reportingConfig.get('kbnTestServer.serverArgs'),
`--xpack.security.enabled=false`,
],
serverArgs: [...reportingConfig.get('kbnTestServer.serverArgs')],
},
esTestCluster: {
...reportingConfig.get('esTestCluster'),
Expand Down
4 changes: 3 additions & 1 deletion x-pack/test/rule_registry/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
`--xpack.actions.allowedHosts=${JSON.stringify(['localhost', 'some.non.existent.com'])}`,
`--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`,
'--xpack.eventLog.logEntries=true',
...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`),
...disabledPlugins
.filter((k) => k !== 'security')
.map((key) => `--xpack.${key}.enabled=false`),
// TO DO: Remove feature flags once we're good to go
'--xpack.securitySolution.enableExperimental=["ruleRegistryEnabled"]',
'--xpack.ruleRegistry.write.enabled=true',
Expand Down
4 changes: 3 additions & 1 deletion x-pack/test/saved_object_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
...config.xpack.api.get('kbnTestServer.serverArgs'),
'--server.xsrf.disableProtection=true',
`--plugin-path=${path.join(__dirname, 'fixtures', 'saved_object_test_plugin')}`,
...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`),
...disabledPlugins
.filter((k) => k !== 'security')
.map((key) => `--xpack.${key}.enabled=false`),
],
},
};
Expand Down
4 changes: 3 additions & 1 deletion x-pack/test/spaces_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
'--status.allowAnonymous=false',
'--server.xsrf.disableProtection=true',
`--plugin-path=${path.join(__dirname, 'fixtures', 'spaces_test_plugin')}`,
...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`),
...disabledPlugins
.filter((k) => k !== 'security')
.map((key) => `--xpack.${key}.enabled=false`),
],
},
};
Expand Down
4 changes: 3 additions & 1 deletion x-pack/test/timeline/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
`--xpack.actions.allowedHosts=${JSON.stringify(['localhost', 'some.non.existent.com'])}`,
`--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`,
'--xpack.eventLog.logEntries=true',
...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`),
...disabledPlugins
.filter((k) => k !== 'security')
.map((key) => `--xpack.${key}.enabled=false`),
// TO DO: Remove feature flags once we're good to go
'--xpack.securitySolution.enableExperimental=["ruleRegistryEnabled"]',
'--xpack.ruleRegistry.write.enabled=true',
Expand Down
4 changes: 3 additions & 1 deletion x-pack/test/ui_capabilities/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
...xPackFunctionalTestsConfig.get('kbnTestServer'),
serverArgs: [
...xPackFunctionalTestsConfig.get('kbnTestServer.serverArgs'),
...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`),
...disabledPlugins
.filter((k) => k !== 'security')
.map((key) => `--xpack.${key}.enabled=false`),
`--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'foo_plugin')}`,
],
},
Expand Down
15 changes: 13 additions & 2 deletions x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ export default function catalogueTests({ getService }: FtrProviderContext) {
'watcher',
];

const uiCapabilitiesExceptions = [
// enterprise_search plugin is loaded but disabled because security isn't enabled in ES. That means the following 3 capabilities are disabled
'enterpriseSearch',
'appSearch',
'workplaceSearch',
];

describe('catalogue', () => {
SpaceScenarios.forEach((scenario) => {
it(`${scenario.name}`, async () => {
Expand All @@ -33,7 +40,10 @@ export default function catalogueTests({ getService }: FtrProviderContext) {
expect(uiCapabilities.success).to.be(true);
expect(uiCapabilities.value).to.have.property('catalogue');
// everything is enabled
const expected = mapValues(uiCapabilities.value!.catalogue, () => true);
const expected = mapValues(
uiCapabilities.value!.catalogue,
(enabled, catalogueId) => !uiCapabilitiesExceptions.includes(catalogueId)
);
expect(uiCapabilities.value!.catalogue).to.eql(expected);
break;
}
Expand All @@ -55,7 +65,8 @@ export default function catalogueTests({ getService }: FtrProviderContext) {
// only foo is disabled
const expected = mapValues(
uiCapabilities.value!.catalogue,
(value, catalogueId) => catalogueId !== 'foo'
(enabled, catalogueId) =>
!uiCapabilitiesExceptions.includes(catalogueId) && catalogueId !== 'foo'
);
expect(uiCapabilities.value!.catalogue).to.eql(expected);
break;
Expand Down
15 changes: 13 additions & 2 deletions x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ export default function navLinksTests({ getService }: FtrProviderContext) {
const uiCapabilitiesService: UICapabilitiesService = getService('uiCapabilities');
const featuresService: FeaturesService = getService('features');

const uiCapabilitiesExceptions = [
// enterprise_search plugin is loaded but disabled because security isn't enabled in ES. That means the following 3 capabilities are disabled
'enterpriseSearch',
'appSearch',
'workplaceSearch',
];

describe('navLinks', () => {
let navLinksBuilder: NavLinksBuilder;
before(async () => {
Expand All @@ -30,7 +37,9 @@ export default function navLinksTests({ getService }: FtrProviderContext) {
case 'everything_space':
expect(uiCapabilities.success).to.be(true);
expect(uiCapabilities.value).to.have.property('navLinks');
expect(uiCapabilities.value!.navLinks).to.eql(navLinksBuilder.all());
expect(uiCapabilities.value!.navLinks).to.eql(
navLinksBuilder.except(...uiCapabilitiesExceptions)
);
break;
case 'nothing_space':
expect(uiCapabilities.success).to.be(true);
Expand All @@ -40,7 +49,9 @@ export default function navLinksTests({ getService }: FtrProviderContext) {
case 'foo_disabled_space':
expect(uiCapabilities.success).to.be(true);
expect(uiCapabilities.value).to.have.property('navLinks');
expect(uiCapabilities.value!.navLinks).to.eql(navLinksBuilder.except('foo'));
expect(uiCapabilities.value!.navLinks).to.eql(
navLinksBuilder.except('foo', ...uiCapabilitiesExceptions)
);
break;
default:
throw new UnreachableError(scenario);
Expand Down