Skip to content

Commit

Permalink
Merge branch '8.12' into backport/8.12/pr-175682
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Jan 27, 2024
2 parents 4a08a10 + 42f0a85 commit cd71814
Show file tree
Hide file tree
Showing 25 changed files with 92 additions and 48 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"**/hoist-non-react-statics": "^3.3.2",
"**/isomorphic-fetch/node-fetch": "^2.6.7",
"**/remark-parse/trim": "1.0.1",
"**/sharp": "0.32.6",
"**/typescript": "4.7.4",
"globby/fast-glob": "^3.2.11"
},
Expand Down Expand Up @@ -1442,7 +1443,6 @@
"@types/selenium-webdriver": "^4.1.21",
"@types/semver": "^7",
"@types/set-value": "^2.0.0",
"@types/sharp": "^0.30.4",
"@types/sinon": "^7.0.13",
"@types/source-map-support": "^0.5.3",
"@types/stats-lite": "^2.2.0",
Expand Down
40 changes: 38 additions & 2 deletions x-pack/plugins/security/server/routes/api_keys/get.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,44 @@ describe('Get API Keys route', () => {
);

expect(response.status).toBe(200);
expect(response.payload.apiKeys).toContainEqual({ id: '123', invalidated: false });
expect(response.payload.apiKeys).not.toContainEqual({ id: '456', invalidated: true });
expect(response.payload.apiKeys).toContainEqual({ id: '123', name: '', invalidated: false });
expect(response.payload.apiKeys).not.toContainEqual({ id: '456', name: '', invalidated: true });
});

it('should substitute an empty string for keys with `null` names', async () => {
esClientMock.asCurrentUser.security.getApiKey.mockRestore();
esClientMock.asCurrentUser.security.getApiKey.mockResponse({
api_keys: [
{ id: 'with_name', name: 'foo', invalidated: false },
{ id: 'undefined_name', invalidated: false },
{ id: 'null_name', name: null, invalidated: false },
],
} as any);

const response = await routeHandler(
mockContext,
httpServerMock.createKibanaRequest(),
kibanaResponseFactory
);

expect(response.status).toBe(200);
expect(response.payload.apiKeys).toEqual([
{
id: 'with_name',
name: 'foo',
invalidated: false,
},
{
id: 'undefined_name',
name: '',
invalidated: false,
},
{
id: 'null_name',
name: '',
invalidated: false,
},
]);
});

it('should return `404` if API keys are disabled', async () => {
Expand Down
9 changes: 8 additions & 1 deletion x-pack/plugins/security/server/routes/api_keys/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ export function defineGetApiKeysRoutes({
owner: !clusterPrivileges.manage_api_key && !clusterPrivileges.read_security,
});

const validKeys = apiResponse.api_keys.filter(({ invalidated }) => !invalidated);
const validKeys = apiResponse.api_keys
.filter(({ invalidated }) => !invalidated)
.map((key) => {
if (!key.name) {
key.name = '';
}
return key;
});

return response.ok<GetAPIKeysResult>({
body: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { createEndpointHost } from '../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data';
import { enableAllPolicyProtections } from '../../tasks/endpoint_policy';

describe(
// Failing: See https://github.com/elastic/kibana/issues/168340
describe.skip(
'Automated Response Actions',
{
tags: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import { login, ROLE } from '../tasks/login';
import { EXECUTE_ROUTE } from '../../../../common/endpoint/constants';
import { waitForActionToComplete } from '../tasks/response_actions';

describe('Endpoint generated alerts', { tags: ['@ess', '@serverless'] }, () => {
// Failing: See https://github.com/elastic/kibana/issues/169958
describe.skip('Endpoint generated alerts', { tags: ['@ess', '@serverless'] }, () => {
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
let policy: PolicyData;
let createdHost: CreateAndEnrollEndpointHostResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { enableAllPolicyProtections } from '../../tasks/endpoint_policy';
import { createEndpointHost } from '../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data';

describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
// Failing: See https://github.com/elastic/kibana/issues/169689
describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
let policy: PolicyData;
let createdHost: CreateAndEnrollEndpointHostResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import { createEndpointHost } from '../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data';
import { APP_CASES_PATH } from '../../../../../common/constants';

describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
// Failing: See https://github.com/elastic/kibana/issues/169343
describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
let policy: PolicyData;
let createdHost: CreateAndEnrollEndpointHostResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import { enableAllPolicyProtections } from '../../tasks/endpoint_policy';
import { createEndpointHost } from '../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data';

describe('Document signing:', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
// Failing: See https://github.com/elastic/kibana/issues/170674
describe.skip('Document signing:', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
let policy: PolicyData;
let createdHost: CreateAndEnrollEndpointHostResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { enableAllPolicyProtections } from '../../tasks/endpoint_policy';
import { createEndpointHost } from '../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data';

describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
// Failing: See https://github.com/elastic/kibana/issues/169821
describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
beforeEach(() => {
login();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe('Response console', { tags: ['@ess', '@serverless'] }, () => {
// Failing: See https://github.com/elastic/kibana/issues/170373
describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
login();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe('Response console', { tags: ['@ess', '@serverless'] }, () => {
// Failing: See https://github.com/elastic/kibana/issues/170424
describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
login();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe('Response console', { tags: ['@ess', '@serverless'] }, () => {
// Failing: See https://github.com/elastic/kibana/issues/173464
describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => {
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
let policy: PolicyData;
let createdHost: CreateAndEnrollEndpointHostResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe('Response console', { tags: ['@ess', '@serverless'] }, () => {
// Failing: See https://github.com/elastic/kibana/issues/170563
describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
login();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe(
// Failing: See https://github.com/elastic/kibana/issues/170814
describe.skip(
'Unenroll agent from fleet with agent tamper protection is disabled',
{ tags: ['@ess'] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe(
// Failing: See https://github.com/elastic/kibana/issues/170667
describe.skip(
'Uninstall agent from host when agent tamper protection is disabled',
{ tags: ['@ess'] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { login } from '../../../tasks/login';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe(
// Failing: See https://github.com/elastic/kibana/issues/170706
describe.skip(
'Unenroll agent from fleet when agent tamper protection is enabled',
{ tags: ['@ess'] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import { login } from '../../../tasks/login';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe(
// Failing: See https://github.com/elastic/kibana/issues/170601
describe.skip(
'Uninstall agent from host when agent tamper protection is enabled',
{ tags: ['@ess'] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe(
// Failing: See https://github.com/elastic/kibana/issues/170811
describe.skip(
'Unenroll agent from fleet when agent tamper protection is disabled but then is switched to a policy with it enabled',
{ tags: ['@ess'] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe(
// Failing: See https://github.com/elastic/kibana/issues/170817
describe.skip(
'Unenroll agent from fleet changing when agent tamper protection is enabled but then is switched to a policy with it disabled',
{ tags: ['@ess'] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import { login } from '../../../tasks/login';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe(
// Failing: See https://github.com/elastic/kibana/issues/170816
describe.skip(
'Unenroll agent from fleet changing agent policy when agent tamper protection is enabled but then is switched to a policy with it also enabled',
{ tags: ['@ess'] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe(
// Failing: See https://github.com/elastic/kibana/issues/170794
describe.skip(
'Uninstall agent from host changing agent policy when agent tamper protection is disabled but then is switched to a policy with it enabled',
{ tags: ['@ess'] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe(
// Failing: See https://github.com/elastic/kibana/issues/170604
describe.skip(
'Uninstall agent from host changing agent policy when agent tamper protection is enabled but then is switched to a policy with it disabled',
{ tags: ['@ess'] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import { login } from '../../../tasks/login';
import { createEndpointHost } from '../../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data';

describe(
// Failing: See https://github.com/elastic/kibana/issues/170812
describe.skip(
'Uninstall agent from host changing agent policy when agent tamper protection is enabled but then is switched to a policy with it also enabled',
{ tags: ['@ess'] },
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ describe('CasesWebhookActionConnectorFields renders', () => {
// this validation is tested in the main validation section
});

describe('Validation', () => {
// FLAKY: https://github.com/elastic/kibana/issues/175497
// FLAKY: https://github.com/elastic/kibana/issues/175498
describe.skip('Validation', () => {
const onSubmit = jest.fn();

beforeEach(() => {
Expand Down
25 changes: 2 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10039,13 +10039,6 @@
resolved "https://registry.yarnpkg.com/@types/set-value/-/set-value-2.0.0.tgz#63d386b103926dcf49b50e16e0f6dd49983046be"
integrity sha512-k8dCJEC80F/mbsIOZ5Hj3YSzTVVVBwMdtP/M9Rtc2TM4F5etVd+2UG8QUiAUfbXm4fABedL2tBZnrBheY7UwpA==

"@types/sharp@^0.30.4":
version "0.30.4"
resolved "https://registry.yarnpkg.com/@types/sharp/-/sharp-0.30.4.tgz#7430b5fcf37f35dd860112c4cf6dcd6a1ba0011b"
integrity sha512-6oJEzKt7wZeS7e+6x9QFEOWGs0T/6of00+0onZGN1zSmcSjcTDZKgIGZ6YWJnHowpaKUCFBPH52mYljWqU32Eg==
dependencies:
"@types/node" "*"

"@types/sinon@^7.0.13":
version "7.0.13"
resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.0.13.tgz#ca039c23a9e27ebea53e0901ef928ea2a1a6d313"
Expand Down Expand Up @@ -27333,21 +27326,7 @@ shallowequal@^1.1.0:
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"
integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==

[email protected]:
version "0.32.1"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.32.1.tgz#41aa0d0b2048b2e0ee453d9fcb14ec1f408390fe"
integrity sha512-kQTFtj7ldpUqSe8kDxoGLZc1rnMFU0AO2pqbX6pLy3b7Oj8ivJIdoKNwxHVQG2HN6XpHPJqCSM2nsma2gOXvOg==
dependencies:
color "^4.2.3"
detect-libc "^2.0.1"
node-addon-api "^6.1.0"
prebuild-install "^7.1.1"
semver "^7.5.0"
simple-get "^4.0.1"
tar-fs "^2.1.1"
tunnel-agent "^0.6.0"

sharp@^0.32.6:
[email protected], [email protected], sharp@^0.32.6:
version "0.32.6"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.32.6.tgz#6ad30c0b7cd910df65d5f355f774aa4fce45732a"
integrity sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==
Expand Down Expand Up @@ -28709,7 +28688,7 @@ [email protected], tar-fs@^3.0.4:
pump "^3.0.0"
tar-stream "^3.1.5"

tar-fs@^2.0.0, tar-fs@^2.1.1:
tar-fs@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784"
integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==
Expand Down

0 comments on commit cd71814

Please sign in to comment.