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

Int 11348 ingest sources #46

Merged
merged 2 commits into from
Aug 8, 2024
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
7 changes: 7 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ import {
VULNERABILITY_ENTITY,
} from './entities';

export const INGESTION_SOURCE_IDS = {
USERS: 'users',
MACHINES: 'machines',
LOGON_USERS: 'logon_users',
VULNERABILITIES: 'vulnerabilities',
};

export const Steps: Record<
| 'FETCH_ACCOUNT'
| 'FETCH_MACHINES'
Expand Down
23 changes: 23 additions & 0 deletions src/ingestionConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { IntegrationIngestionConfigFieldMap } from '@jupiterone/integration-sdk-core';
import { INGESTION_SOURCE_IDS } from './constants';

export const ingestionConfig: IntegrationIngestionConfigFieldMap = {
[INGESTION_SOURCE_IDS.USERS]: {
title: 'Users',
description: 'Fetch User data',
},
[INGESTION_SOURCE_IDS.MACHINES]: {
title: 'Machines',
description: 'Fetch information about machines and endpoints',
},
[INGESTION_SOURCE_IDS.LOGON_USERS]: {
title: 'Logon Users',
description:
'Gather a collection of logged on users on a specific device and links it to existing data',
},
[INGESTION_SOURCE_IDS.VULNERABILITIES]: {
title: 'Vulnerabilities',
description:
'Retrieves a collection of discovered vulnerabilities and relates it to existing machines',
},
};
2 changes: 2 additions & 0 deletions src/steps/active-directory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { IntegrationConfig, IntegrationStepContext } from '../../config';
import {
ACCOUNT_ENTITY_KEY,
Entities,
INGESTION_SOURCE_IDS,
Relationships,
Steps,
} from '../../constants';
Expand Down Expand Up @@ -69,6 +70,7 @@ export const activeDirectorySteps: Step<
entities: [Entities.USER],
relationships: [Relationships.ACCOUNT_HAS_USER],
dependsOn: [Steps.FETCH_ACCOUNT.id],
ingestionSourceId: INGESTION_SOURCE_IDS.USERS,
executionHandler: fetchUsers,
},
];
8 changes: 7 additions & 1 deletion src/steps/ms-defender/logon-user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import {
} from '@jupiterone/integration-sdk-core';
import { IntegrationConfig, IntegrationStepContext } from '../../../config';
import { DefenderClient } from '../client';
import { Entities, Relationships, Steps } from '../../../constants';
import {
Entities,
INGESTION_SOURCE_IDS,
Relationships,
Steps,
} from '../../../constants';
import {
createLogonUserEntity,
createLogonUserEntityKey,
Expand Down Expand Up @@ -66,6 +71,7 @@ export const logonUserSteps: Step<
entities: [Entities.LOGON_USER],
relationships: [Relationships.MACHINE_HAS_LOGON_USER],
dependsOn: [Steps.FETCH_MACHINES.id],
ingestionSourceId: INGESTION_SOURCE_IDS.LOGON_USERS,
executionHandler: fetchLogonUsers,
},
];
2 changes: 2 additions & 0 deletions src/steps/ms-defender/machine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { DefenderClient } from '../client';
import {
ACCOUNT_ENTITY_KEY,
Entities,
INGESTION_SOURCE_IDS,
Relationships,
Steps,
} from '../../../constants';
Expand Down Expand Up @@ -109,6 +110,7 @@ export const machineSteps: Step<
entities: [Entities.MACHINE],
relationships: [Relationships.ACCOUNT_HAS_MACHINE],
dependsOn: [Steps.FETCH_ACCOUNT.id],
ingestionSourceId: INGESTION_SOURCE_IDS.MACHINES,
executionHandler: fetchMachines,
},
{
Expand Down
2 changes: 2 additions & 0 deletions src/steps/ms-defender/vulnerabilities/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Vulnerability, Machine } from '../../../types';
import { DefenderClient } from '../client';
import {
Entities,
INGESTION_SOURCE_IDS,
MappedRelationships,
Relationships,
Steps,
Expand Down Expand Up @@ -90,6 +91,7 @@ export const vulnerabilitiesSteps: Step<
entities: [Entities.VULNERABILITY],
relationships: [Relationships.MACHINE_IDENTIFIED_VULNERABILITY],
dependsOn: [Steps.FETCH_MACHINES.id],
ingestionSourceId: INGESTION_SOURCE_IDS.VULNERABILITIES,
executionHandler: fetchFindings,
},
{
Expand Down
Loading