Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Add ingestion sources
Browse files Browse the repository at this point in the history
  • Loading branch information
jehisonprada committed Jan 23, 2024
1 parent c4d5505 commit 623c526
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const IngestionSources = {
ACCOUNTS: 'accounts',
MACOS_CONFIGURATION_PROFILES: 'macos-configuration-profiles',
MOBILE_DEVICES: 'mobile-devices',
COMPUTERS: 'computers',
GROUPS: 'groups',
ADMINS: 'admins',
};
26 changes: 26 additions & 0 deletions src/ingestionConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { IntegrationIngestionConfigFieldMap } from '@jupiterone/integration-sdk-core';
import { IngestionSources } from './constants';

export const ingestionConfig: IntegrationIngestionConfigFieldMap = {
[IngestionSources.ACCOUNTS]: {
title: 'Accounts',
description:
'Users with access, permissions, and roles in device management',
},
[IngestionSources.MACOS_CONFIGURATION_PROFILES]: {
title: 'MacOS configuration profiles',
description: 'Device behavior settings including network and security',
},
[IngestionSources.MOBILE_DEVICES]: {
title: 'Mobile devices',
description: 'Apple devices, such as Macs, iPhones, and iPads',
},
[IngestionSources.COMPUTERS]: {
title: 'Computers',
description: 'Apple Macintosh device, such as a MacBook, iMac, or Mac mini',
},
[IngestionSources.ADMINS]: {
title: 'Users',
description: 'Users who have admin rights on the devices',
},
};
2 changes: 2 additions & 0 deletions src/steps/accounts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
IntegrationSteps,
} from '../constants';
import { createAccountEntity } from './converters';
import { IngestionSources } from '../../constants';

export async function fetchAccounts({
instance,
Expand Down Expand Up @@ -44,6 +45,7 @@ export const accountSteps: IntegrationStep<IntegrationConfig>[] = [
name: 'Fetch Accounts',
entities: [Entities.ACCOUNT],
relationships: [],
ingestionSourceId: IngestionSources.ACCOUNTS,
executionHandler: fetchAccounts,
},
];
4 changes: 4 additions & 0 deletions src/steps/devices/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
setMobileDeviceIdToGraphObjectKeyMap,
} from '../../util/device';
import { createComputerEntity } from './computerEntityConverter';
import { IngestionSources } from '../../constants';

type MacOsConfigurationDetailsById = Map<number, OSXConfigurationDetailParsed>;

Expand Down Expand Up @@ -615,6 +616,7 @@ export const deviceSteps: IntegrationStep<IntegrationConfig>[] = [
name: 'Fetch macOS Configuration Profiles',
entities: [Entities.MAC_OS_CONFIGURATION_PROFILE],
relationships: [Relationships.ACCOUNT_HAS_MAC_OS_CONFIGURATION_PROFILE],
ingestionSourceId: IngestionSources.MACOS_CONFIGURATION_PROFILES,
executionHandler: fetchMacOsConfigurationDetails,
dependsOn: [IntegrationSteps.ACCOUNTS],
},
Expand All @@ -623,6 +625,7 @@ export const deviceSteps: IntegrationStep<IntegrationConfig>[] = [
name: 'Fetch Mobile Devices',
entities: [Entities.MOBILE_DEVICE],
relationships: [Relationships.ACCOUNT_HAS_MOBILE_DEVICE],
ingestionSourceId: IngestionSources.MOBILE_DEVICES,
executionHandler: fetchMobileDevices,
dependsOn: [IntegrationSteps.ACCOUNTS],
},
Expand All @@ -639,6 +642,7 @@ export const deviceSteps: IntegrationStep<IntegrationConfig>[] = [
MappedRelationships.COMPUTER_INSTALLED_APPLICATION,
MappedRelationships.LOCAL_ACCOUNT_USES_COMPUTER,
],
ingestionSourceId: IngestionSources.COMPUTERS,
executionHandler: fetchComputers,
dependsOn: [
IntegrationSteps.ACCOUNTS,
Expand Down
2 changes: 2 additions & 0 deletions src/steps/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from '../../util/device';
import pMap from 'p-map';
import { iterator } from './interator';
import { IngestionSources } from '../../constants';

async function iterateAdminUserProfiles(
client: IJamfClient,
Expand Down Expand Up @@ -250,6 +251,7 @@ export const userSteps: IntegrationStep<IntegrationConfig>[] = [
name: 'Fetch Admins',
entities: [Entities.USER_ADMIN],
relationships: [Relationships.ACCOUNT_HAS_USER_ADMIN],
ingestionSourceId: IngestionSources.ADMINS,
executionHandler: fetchAdminUsers,
dependsOn: [IntegrationSteps.ACCOUNTS],
},
Expand Down

0 comments on commit 623c526

Please sign in to comment.