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

[poc][deploy] Attempt to deploy security to Cloud testing. #152173

Closed
Closed
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
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,9 @@ packages/kbn-securitysolution-t-grid @elastic/security-solution-platform
packages/kbn-securitysolution-utils @elastic/security-solution-platform
packages/kbn-server-http-tools @elastic/kibana-core
packages/kbn-server-route-repository @elastic/apm-ui
x-pack/plugins/serverless @elastic/appex-sharedux
x-pack/plugins/serverless_observability @elastic/appex-sharedux
x-pack/plugins/serverless_security @elastic/appex-sharedux
test/plugin_functional/plugins/session_notifications @elastic/kibana-core
x-pack/plugins/session_view @elastic/awp-viz
packages/kbn-set-map @elastic/kibana-operations
Expand Down
1 change: 1 addition & 0 deletions config/kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,4 @@
# Maximum number of documents loaded by each shard to generate autocomplete suggestions.
# This value must be a whole number greater than zero. Defaults to 100_000
#unifiedSearch.autocomplete.valueSuggestions.terminateAfter: 100000

10 changes: 10 additions & 0 deletions config/serverless.oblt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
enterpriseSearch.enabled: false
xpack.canvas.enabled: false
xpack.cloudSecurityPosture.enabled: false
xpack.reporting.enabled: false
xpack.securitySolution.enabled: false
xpack.watcher.enabled: false

xpack.serverless.observability.enabled: true

uiSettings.overrides.defaultRoute: /app/observability/overview
10 changes: 10 additions & 0 deletions config/serverless.security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
xpack.apm.enabled: false
xpack.canvas.enabled: false
xpack.observability.enabled: false
xpack.reporting.enabled: false
xpack.uptime.enabled: false
xpack.watcher.enabled: false

xpack.serverless.security.enabled: true

uiSettings.overrides.defaultRoute: /app/security/get_started
2 changes: 2 additions & 0 deletions config/serverless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

xpack.serverless.plugin.enabled: true
12 changes: 12 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,18 @@ Kibana.
|Welcome to the Kibana Security Solution plugin! This README will go over getting started with development and testing.


|{kib-repo}blob/{branch}/x-pack/plugins/serverless/README.md[serverless]
|A Kibana plugin


|{kib-repo}blob/{branch}/x-pack/plugins/serverless_observability/README.md[serverlessObservability]
|A witty, fitting description to come.


|{kib-repo}blob/{branch}/x-pack/plugins/serverless_security/README.md[serverlessSecurity]
|A witty, fitting description to come.


|{kib-repo}blob/{branch}/x-pack/plugins/session_view/README.md[sessionView]
|Session View is meant to provide a visualization into what is going on in a particular Linux environment where the agent is running. It looks likes a terminal emulator; however, it is a tool for introspecting process activity and understanding user and service behaviour in your Linux servers and infrastructure. It is a time-ordered series of process executions displayed in a tree over time.

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,9 @@
"@kbn/securitysolution-utils": "link:packages/kbn-securitysolution-utils",
"@kbn/server-http-tools": "link:packages/kbn-server-http-tools",
"@kbn/server-route-repository": "link:packages/kbn-server-route-repository",
"@kbn/serverless": "link:x-pack/plugins/serverless",
"@kbn/serverless-observability": "link:x-pack/plugins/serverless_observability",
"@kbn/serverless-security": "link:x-pack/plugins/serverless_security",
"@kbn/session-notifications-plugin": "link:test/plugin_functional/plugins/session_notifications",
"@kbn/session-view-plugin": "link:x-pack/plugins/session_view",
"@kbn/set-map": "link:packages/kbn-set-map",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ import type {
ChromeGlobalHelpExtensionMenuLink,
ChromeHelpExtension,
ChromeUserBanner,
ChromeStyle,
} from '@kbn/core-chrome-browser';
import type { CustomBrandingStart } from '@kbn/core-custom-branding-browser';
import { KIBANA_ASK_ELASTIC_LINK } from './constants';
import { DocTitleService } from './doc_title';
import { NavControlsService } from './nav_controls';
import { NavLinksService } from './nav_links';
import { RecentlyAccessedService } from './recently_accessed';
import { Header } from './ui';
import { Header, SolutionHeader } from './ui';
import type { InternalChromeStart } from './types';

const IS_LOCKED_KEY = 'core.chrome.isLocked';
Expand Down Expand Up @@ -119,6 +120,8 @@ export class ChromeService {
const customNavLink$ = new BehaviorSubject<ChromeNavLink | undefined>(undefined);
const helpSupportUrl$ = new BehaviorSubject<string>(KIBANA_ASK_ELASTIC_LINK);
const isNavDrawerLocked$ = new BehaviorSubject(localStorage.getItem(IS_LOCKED_KEY) === 'true');
const chromeStyle$ = new BehaviorSubject<ChromeStyle>('classic');
const solutionNavigation$ = new BehaviorSubject<JSX.Element | undefined>(undefined);

const getKbnVersionClass = () => {
// we assume that the version is valid and has the form 'X.X.X'
Expand All @@ -135,6 +138,9 @@ export class ChromeService {
map(([headerBanner, isVisible]) => {
return [
'kbnBody',
chromeStyle$.getValue() === 'classic'
? 'kbnBody--classicLayout'
: 'kbnBody--projectLayout',
headerBanner ? 'kbnBody--hasHeaderBanner' : 'kbnBody--noHeaderBanner',
isVisible ? 'kbnBody--chromeVisible' : 'kbnBody--chromeHidden',
getKbnVersionClass(),
Expand Down Expand Up @@ -163,6 +169,16 @@ export class ChromeService {

const getIsNavDrawerLocked$ = isNavDrawerLocked$.pipe(takeUntil(this.stop$));

const setChromeStyle = (style: ChromeStyle) => {
chromeStyle$.next(style);
};

const setSolutionNavigation = (navigation: JSX.Element) => {
solutionNavigation$.next(navigation);
};

const getChromeStyle$ = chromeStyle$.pipe(takeUntil(this.stop$));

const isIE = () => {
const ua = window.navigator.userAgent;
const msie = ua.indexOf('MSIE '); // IE 10 or older
Expand Down Expand Up @@ -203,41 +219,74 @@ export class ChromeService {
});
}

const getHeaderComponent = () => {
const Component = ({
style$,
navigation$,
}: {
style$: typeof chromeStyle$;
navigation$: typeof solutionNavigation$;
}) => {
if (style$.getValue() === 'solution') {
const navigation = navigation$.getValue();
if (navigation) {
return (
<SolutionHeader
{...{
application,
globalHelpExtensionMenuLinks$,
}}
navigation={navigation}
actionMenu$={application.currentActionMenu$}
breadcrumbs$={breadcrumbs$.pipe(takeUntil(this.stop$))}
helpExtension$={helpExtension$.pipe(takeUntil(this.stop$))}
helpSupportUrl$={helpSupportUrl$.pipe(takeUntil(this.stop$))}
kibanaDocLink={docLinks.links.kibana.guide}
kibanaVersion={injectedMetadata.getKibanaVersion()}
/>
);
}
}

return (
<Header
loadingCount$={http.getLoadingCount$()}
application={application}
headerBanner$={headerBanner$.pipe(takeUntil(this.stop$))}
badge$={badge$.pipe(takeUntil(this.stop$))}
basePath={http.basePath}
breadcrumbs$={breadcrumbs$.pipe(takeUntil(this.stop$))}
breadcrumbsAppendExtension$={breadcrumbsAppendExtension$.pipe(takeUntil(this.stop$))}
customNavLink$={customNavLink$.pipe(takeUntil(this.stop$))}
kibanaDocLink={docLinks.links.kibana.guide}
forceAppSwitcherNavigation$={navLinks.getForceAppSwitcherNavigation$()}
globalHelpExtensionMenuLinks$={globalHelpExtensionMenuLinks$}
helpExtension$={helpExtension$.pipe(takeUntil(this.stop$))}
helpSupportUrl$={helpSupportUrl$.pipe(takeUntil(this.stop$))}
homeHref={http.basePath.prepend('/app/home')}
isVisible$={this.isVisible$}
kibanaVersion={injectedMetadata.getKibanaVersion()}
navLinks$={navLinks.getNavLinks$()}
recentlyAccessed$={recentlyAccessed.get$()}
navControlsLeft$={navControls.getLeft$()}
navControlsCenter$={navControls.getCenter$()}
navControlsRight$={navControls.getRight$()}
navControlsExtension$={navControls.getExtension$()}
onIsLockedUpdate={setIsNavDrawerLocked}
isLocked$={getIsNavDrawerLocked$}
customBranding$={customBranding$}
/>
);
};
return <Component {...{ style$: chromeStyle$, navigation$: solutionNavigation$ }} />;
};

return {
navControls,
navLinks,
recentlyAccessed,
docTitle,

getHeaderComponent: () => (
<Header
loadingCount$={http.getLoadingCount$()}
application={application}
headerBanner$={headerBanner$.pipe(takeUntil(this.stop$))}
badge$={badge$.pipe(takeUntil(this.stop$))}
basePath={http.basePath}
breadcrumbs$={breadcrumbs$.pipe(takeUntil(this.stop$))}
breadcrumbsAppendExtension$={breadcrumbsAppendExtension$.pipe(takeUntil(this.stop$))}
customNavLink$={customNavLink$.pipe(takeUntil(this.stop$))}
kibanaDocLink={docLinks.links.kibana.guide}
forceAppSwitcherNavigation$={navLinks.getForceAppSwitcherNavigation$()}
globalHelpExtensionMenuLinks$={globalHelpExtensionMenuLinks$}
helpExtension$={helpExtension$.pipe(takeUntil(this.stop$))}
helpSupportUrl$={helpSupportUrl$.pipe(takeUntil(this.stop$))}
homeHref={http.basePath.prepend('/app/home')}
isVisible$={this.isVisible$}
kibanaVersion={injectedMetadata.getKibanaVersion()}
navLinks$={navLinks.getNavLinks$()}
recentlyAccessed$={recentlyAccessed.get$()}
navControlsLeft$={navControls.getLeft$()}
navControlsCenter$={navControls.getCenter$()}
navControlsRight$={navControls.getRight$()}
navControlsExtension$={navControls.getExtension$()}
onIsLockedUpdate={setIsNavDrawerLocked}
isLocked$={getIsNavDrawerLocked$}
customBranding$={customBranding$}
/>
),
getHeaderComponent,

getIsVisible$: () => this.isVisible$,

Expand Down Expand Up @@ -302,6 +351,9 @@ export class ChromeService {
},

getBodyClasses$: () => bodyClasses$.pipe(takeUntil(this.stop$)),
setChromeStyle,
getChromeStyle$: () => getChromeStyle$,
setSolutionNavigation,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
*/

export { Header } from './header';
export { SolutionHeader } from './solution';
export { LoadingIndicator } from './loading_indicator';
export type { NavType } from './header';
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* 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 React from 'react';
import {
EuiButtonIcon,
EuiCollapsibleNav,
EuiHeader,
EuiHeaderLogo,
EuiHeaderSection,
EuiHeaderSectionItem,
EuiThemeProvider,
useEuiTheme,
} from '@elastic/eui';
import {
ChromeBreadcrumb,
ChromeGlobalHelpExtensionMenuLink,
ChromeHelpExtension,
} from '@kbn/core-chrome-browser/src';
import { Observable } from 'rxjs';
import { MountPoint } from '@kbn/core-mount-utils-browser';
import { InternalApplicationStart } from '@kbn/core-application-browser-internal';
import { HeaderBreadcrumbs } from '../header/header_breadcrumbs';
import { HeaderActionMenu } from '../header/header_action_menu';
import { HeaderHelpMenu } from '../header/header_help_menu';

interface Props {
breadcrumbs$: Observable<ChromeBreadcrumb[]>;
actionMenu$: Observable<MountPoint | undefined>;
kibanaDocLink: string;
globalHelpExtensionMenuLinks$: Observable<ChromeGlobalHelpExtensionMenuLink[]>;
helpExtension$: Observable<ChromeHelpExtension | undefined>;
helpSupportUrl$: Observable<string>;
kibanaVersion: string;
application: InternalApplicationStart;
navigation: JSX.Element;
}

export const SolutionHeader = ({
application,
kibanaDocLink,
kibanaVersion,
navigation,
...observables
}: Props) => {
const { euiTheme, colorMode } = useEuiTheme();

const renderLogo = () => (
<EuiHeaderLogo
iconType="logoElastic"
href="#"
onClick={(e) => e.preventDefault()}
aria-label="Go to home page"
/>
);

return (
<>
<EuiHeader position="fixed">
<EuiHeaderSection grow={false}>
<EuiHeaderSectionItem border="right">{renderLogo()}</EuiHeaderSectionItem>
<EuiHeaderSectionItem>
<HeaderBreadcrumbs breadcrumbs$={observables.breadcrumbs$} />
</EuiHeaderSectionItem>
</EuiHeaderSection>
<EuiHeaderSection side="right">
<EuiHeaderSectionItem>
<HeaderHelpMenu
globalHelpExtensionMenuLinks$={observables.globalHelpExtensionMenuLinks$}
helpExtension$={observables.helpExtension$}
helpSupportUrl$={observables.helpSupportUrl$}
kibanaDocLink={kibanaDocLink}
kibanaVersion={kibanaVersion}
navigateToUrl={application.navigateToUrl}
/>
</EuiHeaderSectionItem>
<EuiHeaderSectionItem border="left">
<HeaderActionMenu actionMenu$={observables.actionMenu$} />
</EuiHeaderSectionItem>
</EuiHeaderSection>
</EuiHeader>
<EuiThemeProvider colorMode={colorMode === 'DARK' ? 'LIGHT' : 'DARK'}>
<EuiCollapsibleNav
css={{
borderInlineEndWidth: 1,
background: euiTheme.colors.darkestShade,
}}
isOpen={true}
onClose={() => {}}
closeButtonProps={{ iconType: 'menuLeft' }}
showButtonIfDocked={true}
isDocked={true}
size={248}
hideCloseButton={false}
button={
<span css={{ marginLeft: -40, marginTop: 16, position: 'fixed', zIndex: 1000 }}>
<EuiButtonIcon iconType="menuLeft" aria-label="Open nav" color="text" />
</span>
}
>
{navigation}
</EuiCollapsibleNav>
</EuiThemeProvider>
</>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* 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.
*/

export { SolutionHeader } from './header';
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"types": [
"jest",
"node",
"react"
"react",
"@emotion/react/types/css-prop"
]
},
"include": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ const createStartContractMock = () => {
setHeaderBanner: jest.fn(),
hasHeaderBanner$: jest.fn(),
getBodyClasses$: jest.fn(),
getChromeStyle$: jest.fn(),
setChromeStyle: jest.fn(),
setSolutionNavigation: jest.fn(),
};
startContract.navLinks.getAll.mockReturnValue([]);
startContract.getIsVisible$.mockReturnValue(new BehaviorSubject(false));
Expand Down
Loading