Skip to content

Commit

Permalink
Merge branch 'main' into fix-so-share-checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jeramysoucy authored Oct 12, 2023
2 parents 076f3d8 + c1098b5 commit 4fc5345
Show file tree
Hide file tree
Showing 67 changed files with 332 additions and 117 deletions.
8 changes: 8 additions & 0 deletions .buildkite/pipelines/flaky_tests/groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
"key": "cypress/security_serverless_explore",
"name": "[Serverless] Security Solution Explore - Cypress"
},
{
"key": "cypress/defend_workflows",
"name": "Security Solution Defend Workflows - Cypress"
},
{
"key": "cypress/defend_workflows_serverless",
"name": "[Serverless] Security Solution Defend Workflows - Cypress"
},
{
"key": "cypress/osquery_cypress",
"name": "Osquery - Cypress"
Expand Down
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,10 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
/test/interactive_setup_api_integration/ @elastic/kibana-security
/test/interactive_setup_functional/ @elastic/kibana-security
/test/plugin_functional/test_suites/core_plugins/rendering.ts @elastic/kibana-security
/x-pack/test/accessibility/apps/login_page.ts @elastic/kibana-security
/x-pack/test/accessibility/apps/roles.ts @elastic/kibana-security
/x-pack/test/accessibility/apps/spaces.ts @elastic/kibana-security
/x-pack/test/accessibility/apps/users.ts @elastic/kibana-security
/x-pack/test/api_integration/apis/security/ @elastic/kibana-security
/x-pack/test/api_integration/apis/spaces/ @elastic/kibana-security
/x-pack/test/ui_capabilities/ @elastic/kibana-security
Expand Down
1 change: 1 addition & 0 deletions config/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ xpack.canvas.enabled: false
xpack.cloud_integrations.data_migration.enabled: false
data.search.sessions.enabled: false
advanced_settings.enabled: false
xpack.screenshotting.enabled: false

# Disable the browser-side functionality that depends on SecurityCheckupGetStateRoutes
xpack.security.showInsecureClusterWarning: false
Expand Down
3 changes: 1 addition & 2 deletions docs/management/cases/manage-cases.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ cases.

For hosted {kib} on {ess}:

. Add the email addresses to the monitoring email allowlist. Follow the steps in
{cloud}/ec-watcher.html#ec-watcher-allowlist[Send alerts by email].
. Add the email domains to the {cloud}/ec-organizations-notifications-domain-allowlist.html[notifications domain allowlist].
+
--
You do not need to take any more steps to configure an email connector or update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface CloudPostureIntegrationProps {
icon?: string;
tooltip?: string;
isBeta?: boolean;
testId?: string;
}>;
}

Expand All @@ -85,6 +86,7 @@ export const cloudPostureIntegrations: CloudPostureIntegrations = {
defaultMessage: 'CIS AWS',
}),
icon: 'logoAWS',
testId: 'cisAwsTestId',
},
{
type: CLOUDBEAT_GCP,
Expand All @@ -95,6 +97,7 @@ export const cloudPostureIntegrations: CloudPostureIntegrations = {
defaultMessage: 'CIS GCP',
}),
icon: googleCloudLogo,
testId: 'cisGcpTestId',
},
// needs to be a function that disables/enabled based on integration version
{
Expand All @@ -108,6 +111,7 @@ export const cloudPostureIntegrations: CloudPostureIntegrations = {
disabled: false,
isBeta: true,
icon: 'logoAzure',
testId: 'cisAzureTestId',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface CspRadioOption {
icon?: string;
tooltip?: string;
isBeta?: boolean;
testId?: string;
}

export const RadioGroup = ({
Expand All @@ -34,7 +35,6 @@ export const RadioGroup = ({
onChange,
}: CspRadioGroupProps) => {
const { euiTheme } = useEuiTheme();

return (
<div
css={css`
Expand Down Expand Up @@ -101,6 +101,7 @@ export const RadioGroup = ({
`}
>
<EuiRadio
data-test-subj={option.testId}
label={option.label}
id={option.id}
checked={isChecked}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,20 +233,23 @@ const getSetupFormatOptions = (): Array<{
id: SetupFormatGCP;
label: string;
disabled: boolean;
testId: string;
}> => [
{
id: SETUP_ACCESS_CLOUD_SHELL,
label: i18n.translate('xpack.csp.gcpIntegration.setupFormatOptions.googleCloudShell', {
defaultMessage: 'Google Cloud Shell',
}),
disabled: false,
testId: 'gcpGoogleCloudShellOptionTestId',
},
{
id: SETUP_ACCESS_MANUAL,
label: i18n.translate('xpack.csp.gcpIntegration.setupFormatOptions.manual', {
defaultMessage: 'Manual',
}),
disabled: false,
testId: 'gcpManualOptionTestId',
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,14 @@ const getGcpAccountTypeOptions = (isGcpOrgDisabled: boolean): CspRadioGroupProps
defaultMessage: 'Supported from integration version 1.6.0 and above',
})
: undefined,
testId: 'gcpOrganizationAccountTestId',
},
{
id: GCP_SINGLE_ACCOUNT,
label: i18n.translate('xpack.csp.fleetIntegration.gcpAccountType.gcpSingleAccountLabel', {
defaultMessage: 'Single Account',
}),
testId: 'gcpSingleAccountTestId',
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export const getPolicyTemplateInputOptions = (policyTemplate: CloudSecurityPolic
icon: o.icon,
disabled: o.disabled,
isBeta: o.isBeta,
testId: o.testId,
}));

export const getMaxPackageName = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ describe('Fleet preconfiguration reset', () => {
expect(agentPolicies.saved_objects.find((so) => so.id === 'default-policy')).toBeDefined();
});

it('Create correct .fleet-policies', async () => {
// FLAKY: https://github.com/elastic/kibana/issues/133470
it.skip('Create correct .fleet-policies', async () => {
const res = await kbnServer.coreStart.elasticsearch.client.asInternalUser.search({
index: AGENT_POLICY_INDEX,
q: `policy_id:policy-elastic-agent-on-cloud`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ export const goDefinition: LanguageDefinition = {
"fmt"
"log"
"strings"
"github.com/elastic/elasticsearch-serverless-go"
)
func main() {
cfg := elasticsearch.Config{
Address: "${url}",
Expand All @@ -88,7 +88,7 @@ func main() {
{ "index": { "_id": "1"}}
{"name": "foo", "title": "bar"}\n\`)).
Do(context.Background())
fmt.Println(res, err)
}`,
};
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/osquery/cypress/e2e/all/custom_space.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const testSpaces = [
{ name: 'default', tags: ['@ess', '@serverless'] },
{ name: 'custom-spaces', tags: ['@ess'] },
];
describe('ALL - Custom space', () => {
// FLAKY: https://github.com/elastic/kibana/issues/168742
describe.skip('ALL - Custom space', () => {
testSpaces.forEach((testSpace) => {
describe(`[${testSpace.name}]`, { tags: testSpace.tags }, () => {
let packName: string;
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/reporting/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"uiActions",
"taskManager",
"embeddable",
"screenshotting",
"screenshotMode",
"share",
"features"
],
"optionalPlugins": [
"security",
"spaces",
"usageCollection"
"usageCollection",
"screenshotting",
],
"requiredBundles": [
"kibanaReact",
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/reporting/server/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export interface ReportingInternalStart {
fieldFormats: FieldFormatsStart;
licensing: LicensingPluginStart;
logger: Logger;
screenshotting: ScreenshottingStart;
screenshotting?: ScreenshottingStart;
security?: SecurityPluginStart;
taskManager: TaskManagerStartContract;
}
Expand Down Expand Up @@ -134,7 +134,7 @@ export class ReportingCore {
this.getContract = () => ({
usesUiCapabilities: () => config.roles.enabled === false,
registerExportTypes: (id) => id,
getScreenshots: this.getScreenshots.bind(this),
getScreenshots: config.statefulSettings.enabled ? this.getScreenshots.bind(this) : undefined,
getSpaceId: this.getSpaceId.bind(this),
});

Expand Down Expand Up @@ -408,7 +408,7 @@ export class ReportingCore {
): Rx.Observable<PngScreenshotResult | PdfScreenshotResult> {
return Rx.defer(() => this.getPluginStartDeps()).pipe(
switchMap(({ screenshotting }) => {
return screenshotting.getScreenshots({
return screenshotting!.getScreenshots({
...options,
urls: options.urls.map((url) =>
typeof url === 'string'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface BaseExportTypeStartDeps {
savedObjects: SavedObjectsServiceStart;
uiSettings: UiSettingsServiceStart;
esClient: IClusterClient;
screenshotting: ScreenshottingStart;
screenshotting?: ScreenshottingStart;
reporting: ReportingStart;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class PngExportType extends ExportType<JobParamsPNGV2, TaskPayloadPNGV2>

return generatePngObservable(
() =>
this.startDeps.reporting.getScreenshots({
this.startDeps.reporting.getScreenshots!({
format: 'png',
headers,
layout: { ...payload.layout, id: 'preserve_layout' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class PdfV1ExportType extends ExportType<JobParamsPDFDeprecated, TaskPayl
apmGeneratePdf = apmTrans.startSpan('generate-pdf-pipeline', 'execute');
// make a new function that will call reporting.getScreenshots
const snapshotFn = () =>
this.startDeps.reporting.getScreenshots({
this.startDeps.reporting.getScreenshots!({
format: 'pdf',
title,
logo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class PdfExportType extends ExportType<JobParamsPDFV2, TaskPayloadPDFV2>
this.config,
this.getServerInfo(),
() =>
this.startDeps.reporting.getScreenshots({
this.startDeps.reporting.getScreenshots!({
format: 'pdf',
title,
logo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const registerDiagnoseBrowser = (reporting: ReportingCore, logger: Logger
const logsToHelpMap = logsToHelpMapFactory(docLinks);
try {
const { screenshotting } = await reporting.getPluginStartDeps();
if (!screenshotting) throw new Error('Screenshotting is not enabled!');
const logs = await lastValueFrom(screenshotting.diagnose());
const knownIssues = Object.keys(logsToHelpMap) as Array<keyof typeof logsToHelpMap>;

Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/reporting/server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { ExportTypesRegistry } from './lib';
export interface ReportingSetup {
registerExportTypes: ExportTypesRegistry['register'];
getSpaceId: ReportingCore['getSpaceId'];
getScreenshots: ReportingCore['getScreenshots'];
getScreenshots?: ReportingCore['getScreenshots'];
/**
* Used to inform plugins if Reporting config is compatible with UI Capabilities / Application Sub-Feature Controls
*/
Expand Down Expand Up @@ -93,7 +93,7 @@ export type RunTaskFn<TaskPayloadType = BasePayload> = (

export interface ReportingSetupDeps {
features: FeaturesPluginSetup;
screenshotMode: ScreenshotModePluginSetup;
screenshotMode?: ScreenshotModePluginSetup;
security?: SecurityPluginSetup;
spaces?: SpacesPluginSetup;
taskManager: TaskManagerSetupContract;
Expand All @@ -105,7 +105,7 @@ export interface ReportingStartDeps {
discover: DiscoverServerPluginStart;
fieldFormats: FieldFormatsStart;
licensing: LicensingPluginStart;
screenshotting: ScreenshottingStart;
screenshotting?: ScreenshottingStart;
security?: SecurityPluginStart;
taskManager: TaskManagerStartContract;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('chromium driver', () => {
mockLogger.get = () => mockLogger;

mockConfig = {
enabled: true,
networkPolicy: {
enabled: false,
rules: [],
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/screenshotting/server/config/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('ConfigSchema', () => {
},
"zoom": 2,
},
"enabled": true,
"networkPolicy": Object {
"enabled": true,
"rules": Array [
Expand Down Expand Up @@ -87,6 +88,7 @@ describe('ConfigSchema', () => {
},
"zoom": 2,
},
"enabled": true,
"networkPolicy": Object {
"enabled": true,
"rules": Array [
Expand Down
6 changes: 5 additions & 1 deletion x-pack/plugins/screenshotting/server/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { schema, TypeOf } from '@kbn/config-schema';
import { schema, TypeOf, offeringBasedSchema } from '@kbn/config-schema';
import moment from 'moment';

const RulesSchema = schema.object({
Expand All @@ -23,6 +23,10 @@ const RulesSchema = schema.object({
});

export const ConfigSchema = schema.object({
enabled: offeringBasedSchema({
serverless: schema.boolean({ defaultValue: false }),
traditional: schema.boolean({ defaultValue: true }),
}),
networkPolicy: schema.object({
enabled: schema.boolean({ defaultValue: true }),
rules: schema.arrayOf(RulesSchema, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ describe('Screenshot Observable Pipeline', () => {
urls: ['/welcome/home/start/index.htm'],
};
config = {
enabled: true,
poolSize: 1,
capture: {
timeouts: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('class Screenshots', () => {
mockLogger = loggerMock.create();

mockConfig = {
enabled: true,
networkPolicy: {
enabled: false,
rules: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,6 @@ export const allowedExperimentalValues = Object.freeze({
* Enables experimental Entity Analytics HTTP endpoints
*/
riskScoringRoutesEnabled: true,
/*
*
* Enables Discover embedded within timeline
*
* */
discoverInTimeline: true,

/**
* disables ES|QL rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export enum TimelineTabs {
eql = 'eql',
session = 'session',
securityAssistant = 'securityAssistant',
discover = 'discover',
esql = 'esql',
}

/*
Expand Down
Loading

0 comments on commit 4fc5345

Please sign in to comment.