Skip to content

Commit

Permalink
Merge pull request #46 from JupiterOne/INT-11348-ingest-sources
Browse files Browse the repository at this point in the history
Int 11348 ingest sources
  • Loading branch information
Gonzalo-Avalos-Ribas authored Aug 8, 2024
2 parents 0033f3e + 0563538 commit a2eadc2
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 1 deletion.
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

0 comments on commit a2eadc2

Please sign in to comment.