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

Commit

Permalink
Merge pull request #159 from JupiterOne/int-8958-jamf-add-ingestion-s…
Browse files Browse the repository at this point in the history
…ources

Add ingestion sources
  • Loading branch information
jehisonprada authored Jan 24, 2024
2 parents c4d5505 + e7ba431 commit cecf2a3
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const IngestionSources = {
MACOS_CONFIGURATION_PROFILES: 'macos-configuration-profiles',
MOBILE_DEVICES: 'mobile-devices',
COMPUTERS: 'computers',
ADMINS: 'admins',
};
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { deviceSteps } from './steps/devices';
import { groupSteps } from './steps/groups';
import { userSteps } from './steps/users';
import { validateInvocation } from './validator';
import { ingestionConfig } from './ingestionConfig';

export const invocationConfig: IntegrationInvocationConfig<IntegrationConfig> =
{
Expand All @@ -16,4 +17,5 @@ export const invocationConfig: IntegrationInvocationConfig<IntegrationConfig> =
...userSteps,
...deviceSteps,
],
ingestionConfig,
};
21 changes: 21 additions & 0 deletions src/ingestionConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { IntegrationIngestionConfigFieldMap } from '@jupiterone/integration-sdk-core';
import { IngestionSources } from './constants';

export const ingestionConfig: IntegrationIngestionConfigFieldMap = {
[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',
},
};
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 cecf2a3

Please sign in to comment.