Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ const AuthenticationTableManage = manageQuery(AuthenticationTable);
const ID = 'authenticationsOverTimeQuery';
const authStackByOptions: MatrixHistogramOption[] = [
{
text: 'event.type',
value: 'event.type',
text: 'event.outcome',
value: 'event.outcome',
},
];
const DEFAULT_STACK_BY = 'event.type';
const DEFAULT_STACK_BY = 'event.outcome';

enum AuthMatrixDataGroup {
authSuccess = 'authentication_success',
authFailure = 'authentication_failure',
authSuccess = 'success',
authFailure = 'failure',
}

export const authMatrixDataMappingFields: MatrixHistogramMappingTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const buildQuery = ({
failures: {
filter: {
term: {
'event.type': 'authentication_failure',
'event.outcome': 'failure',
},
},
aggs: {
Expand All @@ -86,7 +86,7 @@ export const buildQuery = ({
successes: {
filter: {
term: {
'event.type': 'authentication_success',
'event.outcome': 'success',
},
},
aggs: {
Expand Down
8 changes: 4 additions & 4 deletions x-pack/legacy/plugins/siem/server/lib/kpi_hosts/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,15 @@ export const mockKpiHostDetailsUniqueIpsQuery = [
];

const mockAuthAggs = {
authentication_success: { filter: { term: { 'event.type': 'authentication_success' } } },
authentication_success: { filter: { term: { 'event.outcome': 'success' } } },
authentication_success_histogram: {
auto_date_histogram: { field: '@timestamp', buckets: '6' },
aggs: { count: { filter: { term: { 'event.type': 'authentication_success' } } } },
aggs: { count: { filter: { term: { 'event.outcome': 'success' } } } },
},
authentication_failure: { filter: { term: { 'event.type': 'authentication_failure' } } },
authentication_failure: { filter: { term: { 'event.outcome': 'failure' } } },
authentication_failure_histogram: {
auto_date_histogram: { field: '@timestamp', buckets: '6' },
aggs: { count: { filter: { term: { 'event.type': 'authentication_failure' } } } },
aggs: { count: { filter: { term: { 'event.outcome': 'failure' } } } },
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const buildAuthQuery = ({
authentication_success: {
filter: {
term: {
'event.type': 'authentication_success',
'event.outcome': 'success',
},
},
},
Expand All @@ -62,7 +62,7 @@ export const buildAuthQuery = ({
count: {
filter: {
term: {
'event.type': 'authentication_success',
'event.outcome': 'success',
},
},
},
Expand All @@ -71,7 +71,7 @@ export const buildAuthQuery = ({
authentication_failure: {
filter: {
term: {
'event.type': 'authentication_failure',
'event.outcome': 'failure',
},
},
},
Expand All @@ -84,7 +84,7 @@ export const buildAuthQuery = ({
count: {
filter: {
term: {
'event.type': 'authentication_failure',
'event.outcome': 'failure',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@ export const buildAuthenticationsOverTimeQuery = ({
sourceConfiguration: {
fields: { timestamp },
},
stackByField = 'event.type',
stackByField = 'event.outcome',
}: MatrixHistogramRequestOptions) => {
const filter = [
...createQueryFilterClauses(filterQuery),
{
bool: {
must: [
{
term: {
'event.category': 'authentication',
},
},
],
},
},
{
range: {
[timestamp]: {
Expand Down Expand Up @@ -45,7 +56,7 @@ export const buildAuthenticationsOverTimeQuery = ({
eventActionGroup: {
terms: {
field: stackByField,
include: ['authentication_success', 'authentication_failure'],
include: ['success', 'failure'],
order: {
_count: 'desc',
},
Expand Down