Skip to content

Commit

Permalink
Updates siem grouping to security, and adds cloudtrail module
Browse files Browse the repository at this point in the history
  • Loading branch information
spong committed Jul 24, 2020
1 parent 7f36bd7 commit 7bb8389
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const setupMlJob = async ({
configTemplate,
indexPatternName = 'auditbeat-*',
jobIdErrorFilter = [],
groups = ['siem'],
groups = ['security'],
prefix = '',
}: MlSetupArgs): Promise<SetupMlResponse> => {
const response = await KibanaServices.get().http.fetch<SetupMlResponse>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import { i18n } from '@kbn/i18n';
export const SIEM_JOB_FETCH_FAILURE = i18n.translate(
'xpack.securitySolution.components.mlPopup.hooks.errors.siemJobFetchFailureTitle',
{
defaultMessage: 'SIEM job fetch failure',
defaultMessage: 'Security job fetch failure',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const getInstalledJobs = (
compatibleModuleIds: string[]
): SiemJob[] =>
jobSummaryData
.filter(({ groups }) => groups.includes('siem'))
.filter(({ groups }) => groups.includes('siem') || groups.includes('security'))
.map<SiemJob>((jobSummary) => ({
...jobSummary,
...getAugmentedFields(jobSummary.id, moduleJobs, compatibleModuleIds),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ interface GroupsFilterPopoverProps {

/**
* Popover for selecting which SiemJob groups to filter on. Component extracts unique groups and
* their counts from the provided SiemJobs. The 'siem' group is filtered out as all jobs will be
* siem jobs
* their counts from the provided SiemJobs. The 'siem' & 'security' groups are filtered out as all jobs will be
* siem/security jobs
*
* @param siemJobs jobs to fetch groups from to display for filtering
* @param onSelectedGroupsChanged change listener to be notified when group selection changes
Expand All @@ -41,7 +41,7 @@ export const GroupsFilterPopoverComponent = ({
const groups = siemJobs
.map((j) => j.groups)
.flat()
.filter((g) => g !== 'siem');
.filter((g) => g !== 'siem' && g !== 'security');
const uniqueGroups = Array.from(new Set(groups));

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
export const mlModules: string[] = [
'siem_auditbeat',
'siem_auditbeat_auth',
'siem_cloudtrail',
'siem_packetbeat',
'siem_winlogbeat',
'siem_winlogbeat_auth',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const HelpText: React.FC<{ href: string; showEnableWarning: boolean }> = ({
<>
<FormattedMessage
id="xpack.securitySolution.detectionEngine.createRule.stepDefineRule.machineLearningJobIdHelpText"
defaultMessage="We've provided a few common jobs to get you started. To add your own custom jobs, assign a group of “siem” to those jobs in the {machineLearning} application to make them appear here."
defaultMessage="We've provided a few common jobs to get you started. To add your own custom jobs, assign a group of “security” to those jobs in the {machineLearning} application to make them appear here."
values={{
machineLearning: (
<EuiLink href={href} target="_blank">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ export const getMlJobsUsage = async (ml: MlPluginSetup | undefined): Promise<MlJ
.modulesProvider(internalMlClient, fakeRequest, fakeSOClient)
.listModules();
const moduleJobs = modules.flatMap((module) => module.jobs);
const jobs = await ml.jobServiceProvider(internalMlClient, fakeRequest).jobsSummary(['siem']);
const jobs = await ml
.jobServiceProvider(internalMlClient, fakeRequest)
.jobsSummary(['siem', 'security']);

jobsUsage = jobs.reduce((usage, job) => {
const isElastic = moduleJobs.some((moduleJob) => moduleJob.id === job.id);
Expand Down

0 comments on commit 7bb8389

Please sign in to comment.