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

Unskipped and added additional filters to test #187869

Merged
merged 5 commits into from
Jul 10, 2024
Merged
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: 9 additions & 5 deletions x-pack/test/security_api_integration/tests/audit/audit_log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,27 @@ export default function ({ getService }: FtrProviderContext) {
await logFile.reset();
});

// FLAKY: https://github.com/elastic/kibana/issues/119267
it.skip('logs audit events when reading and writing saved objects', async () => {
it('logs audit events when reading and writing saved objects', async () => {
await supertest.get('/audit_log?query=param').set('kbn-xsrf', 'foo').expect(204);
await logFile.isWritten();
const content = await logFile.readJSON();

const httpEvent = content.find((c) => c.event.action === 'http_request');
const httpEvent = content.find(
(c) => c.event.action === 'http_request' && c.url.path === '/audit_log'
);
expect(httpEvent).to.be.ok();
expect(httpEvent.trace.id).to.be.ok();

expect(httpEvent.user.name).to.be(username);
expect(httpEvent.kibana.space_id).to.be('default');
expect(httpEvent.http.request.method).to.be('get');
expect(httpEvent.url.path).to.be('/audit_log');
expect(httpEvent.url.query).to.be('query=param');

const createEvent = content.find((c) => c.event.action === 'saved_object_create');
const createEvent = content.find(
(c) =>
c.event.action === 'saved_object_create' && c.kibana.saved_object.type === 'dashboard'
);

expect(createEvent).to.be.ok();
expect(createEvent.trace.id).to.be.ok();
expect(createEvent.user.name).to.be(username);
Expand Down