addigy 2.6.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +3 -1
- package/index.js +90 -5
- package/package.json +1 -1
- package/types.d.ts +74 -2
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomFact, Extension, FilevaultRequest, IAddigyConfig, IAddigyInternalAuthObject, MdmConfigurationPayload, NotificationSettings, PPPCInput, SupportedOsVersions } from './types';
|
|
1
|
+
import { CreateWebContentFilterPayload, CustomFact, Extension, FilevaultRequest, IAddigyConfig, IAddigyInternalAuthObject, MdmConfigurationPayload, NotificationSettings, PPPCInput, ServiceManagementPayloadRule, SupportedOsVersions } from './types';
|
|
2
2
|
export * from './types';
|
|
3
3
|
declare enum AlertStatus {
|
|
4
4
|
Acknowledged = "Acknowledged",
|
|
@@ -62,6 +62,8 @@ export declare class Addigy {
|
|
|
62
62
|
createNotificationSettingsPolicy(authObject: IAddigyInternalAuthObject, name: string, notificationSettings: NotificationSettings[]): Promise<any>;
|
|
63
63
|
createCustomProfile(authObject: IAddigyInternalAuthObject, name: string, customProfileText: string, supportedOsVersions: SupportedOsVersions, payloadScope?: 'System' | 'User', is_profile_signed?: boolean): Promise<any>;
|
|
64
64
|
createMdmProfile(authObject: IAddigyInternalAuthObject, mdmProfile: any): Promise<any>;
|
|
65
|
+
createServiceManagementPolicy(authObject: IAddigyInternalAuthObject, name: string, rules: ServiceManagementPayloadRule[], priority?: number): Promise<any>;
|
|
66
|
+
createWebContentFilterPolicy(authObject: IAddigyInternalAuthObject, payloadName: string, webContentPayload: CreateWebContentFilterPayload, priority?: number): Promise<any>;
|
|
65
67
|
createFilevaultPolicy(authObject: IAddigyInternalAuthObject, name: string, filevault: FilevaultRequest, payloadPriority?: number): Promise<any>;
|
|
66
68
|
createPPPCPolicy(authObject: IAddigyInternalAuthObject, name: string, pppcPolicy: PPPCInput[]): Promise<any>;
|
|
67
69
|
createCustomFact(authObject: IAddigyInternalAuthObject, name: string, script: string, scriptType: 'bash' | 'python' | 'zsh'): Promise<CustomFact>;
|
package/index.js
CHANGED
|
@@ -743,6 +743,89 @@ class Addigy {
|
|
|
743
743
|
throw err;
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
|
+
async createServiceManagementPolicy(authObject, name, rules, priority = 9) {
|
|
747
|
+
const groupUUID = uuid_1.v4();
|
|
748
|
+
const payload = {
|
|
749
|
+
addigy_payload_type: 'com.addigy.servicemanagement.com.apple.servicemanagement',
|
|
750
|
+
addigy_payload_version: 0,
|
|
751
|
+
has_manifest: false,
|
|
752
|
+
payload_display_name: name,
|
|
753
|
+
payload_enabled: false,
|
|
754
|
+
payload_group_id: groupUUID,
|
|
755
|
+
payload_identifier: `com.addigy.servicemanagement.com.apple.servicemanagement.${groupUUID}`,
|
|
756
|
+
payload_priority: priority,
|
|
757
|
+
payload_type: 'com.apple.servicemanagement',
|
|
758
|
+
payload_uuid: uuid_1.v4(),
|
|
759
|
+
payload_version: 1,
|
|
760
|
+
policy_restricted: false,
|
|
761
|
+
requires_device_supervision: false,
|
|
762
|
+
requires_mdm_profile_approved: false,
|
|
763
|
+
supported_os_versions: null,
|
|
764
|
+
rules,
|
|
765
|
+
};
|
|
766
|
+
try {
|
|
767
|
+
let res = await this._addigyRequest('https://app-prod.addigy.com/api/mdm/user/profiles/configurations', {
|
|
768
|
+
headers: {
|
|
769
|
+
Cookie: `auth_token=${authObject.authToken};`,
|
|
770
|
+
origin: 'https://app-prod.addigy.com',
|
|
771
|
+
},
|
|
772
|
+
method: 'POST',
|
|
773
|
+
json: { payloads: [payload] },
|
|
774
|
+
});
|
|
775
|
+
return JSON.parse(res.body);
|
|
776
|
+
}
|
|
777
|
+
catch (err) {
|
|
778
|
+
throw err;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
async createWebContentFilterPolicy(authObject, payloadName, webContentPayload, priority = 9) {
|
|
782
|
+
const groupUUID = uuid_1.v4();
|
|
783
|
+
const payload = {
|
|
784
|
+
addigy_payload_type: 'com.addigy.webcontent-filter.com.apple.webcontent-filter',
|
|
785
|
+
addigy_payload_version: 2,
|
|
786
|
+
auto_filter_enabled: null,
|
|
787
|
+
blacklisted_urls: null,
|
|
788
|
+
content_filter_uuid: null,
|
|
789
|
+
filter_browsers: null,
|
|
790
|
+
filter_data_provider_bundle_identifier: null,
|
|
791
|
+
filter_data_provider_designated_requirement: null,
|
|
792
|
+
filter_packet_provider_bundle_identifier: null,
|
|
793
|
+
filter_packet_provider_designated_requirement: null,
|
|
794
|
+
filter_packets: null,
|
|
795
|
+
filter_sockets: true,
|
|
796
|
+
filter_type: 'Plugin',
|
|
797
|
+
has_manifest: false,
|
|
798
|
+
organization: null,
|
|
799
|
+
password: null,
|
|
800
|
+
payload_display_name: payloadName,
|
|
801
|
+
payload_enabled: true,
|
|
802
|
+
payload_group_id: groupUUID,
|
|
803
|
+
payload_identifier: `com.addigy.webcontent-filter.com.apple.webcontent-filter.${groupUUID}`,
|
|
804
|
+
payload_priority: priority,
|
|
805
|
+
payload_type: 'com.apple.webcontent-filter',
|
|
806
|
+
payload_uuid: uuid_1.v4(),
|
|
807
|
+
payload_version: 1,
|
|
808
|
+
permitted_urls: null,
|
|
809
|
+
policy_restricted: false,
|
|
810
|
+
requires_device_supervision: false,
|
|
811
|
+
requires_mdm_profile_approved: false,
|
|
812
|
+
server_address: null,
|
|
813
|
+
supported_os_versions: null,
|
|
814
|
+
user_name: null,
|
|
815
|
+
vendor_config: null,
|
|
816
|
+
white_listed_bookmarks: null,
|
|
817
|
+
...webContentPayload,
|
|
818
|
+
};
|
|
819
|
+
let res = await this._addigyRequest('https://app-prod.addigy.com/api/mdm/user/profiles/configurations', {
|
|
820
|
+
headers: {
|
|
821
|
+
Cookie: `auth_token=${authObject.authToken};`,
|
|
822
|
+
origin: 'https://app-prod.addigy.com',
|
|
823
|
+
},
|
|
824
|
+
method: 'POST',
|
|
825
|
+
json: { payloads: [payload] },
|
|
826
|
+
});
|
|
827
|
+
return JSON.parse(res.body);
|
|
828
|
+
}
|
|
746
829
|
async createFilevaultPolicy(authObject, name, filevault, payloadPriority = 1) {
|
|
747
830
|
const groupUUID = uuid_1.v4();
|
|
748
831
|
const encryptCertPayloadUUID = uuid_1.v4();
|
|
@@ -1041,13 +1124,15 @@ class Addigy {
|
|
|
1041
1124
|
}
|
|
1042
1125
|
async getImpersonationAuthObject(authObject, orgId) {
|
|
1043
1126
|
let postBody = {
|
|
1044
|
-
|
|
1127
|
+
parent_orgid: authObject.orgId,
|
|
1128
|
+
child_orgid: orgId,
|
|
1129
|
+
user_email: authObject.emailAddress,
|
|
1045
1130
|
};
|
|
1046
1131
|
try {
|
|
1047
|
-
let res = await this._addigyRequest('https://
|
|
1132
|
+
let res = await this._addigyRequest('https://app.addigy.com/api/impersonation', {
|
|
1048
1133
|
headers: {
|
|
1049
|
-
Cookie: `
|
|
1050
|
-
origin: 'https://app
|
|
1134
|
+
Cookie: `prod_auth_token=${authObject.authToken};`,
|
|
1135
|
+
origin: 'https://app.addigy.com',
|
|
1051
1136
|
},
|
|
1052
1137
|
method: 'POST',
|
|
1053
1138
|
json: postBody,
|
|
@@ -1055,7 +1140,7 @@ class Addigy {
|
|
|
1055
1140
|
let impersonationAuthObject = {
|
|
1056
1141
|
orgId: orgId,
|
|
1057
1142
|
authToken: res.headers['set-cookie']
|
|
1058
|
-
.find((e) => e.includes('
|
|
1143
|
+
.find((e) => e.includes('prod_auth_token') && !e.includes('original_auth_token'))
|
|
1059
1144
|
.split('auth_token=')[1]
|
|
1060
1145
|
.split(';')[0],
|
|
1061
1146
|
emailAddress: authObject.emailAddress,
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export interface IAddigyInternalAuthObject {
|
|
|
10
10
|
emailAddress: string;
|
|
11
11
|
}
|
|
12
12
|
export interface Payload {
|
|
13
|
-
addigy_payload_type: 'com.addigy.syspolicy.system-extension-policy.com.apple.system-extension-policy' | 'com.addigy.TCC.configuration-profile-policy.com.apple.TCC.configuration-profile-policy' | 'com.addigy.syspolicy.kernel-extension-policy.com.apple.syspolicy.kernel-extension-policy' | 'com.addigy.notifications.com.apple.notificationsettings' | 'com.addigy.custom.mdm.payload' | 'com.addigy.securityAndPrivacy.com.apple.MCX.FileVault2' | 'com.addigy.securityAndPrivacy.com.apple.MCX' | 'com.addigy.securityAndPrivacy.com.apple.security.pkcs1' | 'com.addigy.securityAndPrivacy.com.apple.security.FDERecoveryKeyEscrow' | 'com.addigy.securityAndPrivacy.com.apple.security.FDERecoveryRedirect';
|
|
14
|
-
payload_type: 'com.apple.system-extension-policy' | 'com.apple.syspolicy.kernel-extension-policy' | 'com.apple.TCC.configuration-profile-policy' | 'com.apple.notificationsettings' | 'custom' | 'com.apple.MCX.FileVault2' | 'com.apple.MCX' | 'com.apple.security.pkcs1' | 'com.apple.security.FDERecoveryKeyEscrow' | 'com.apple.security.FDERecoveryRedirect';
|
|
13
|
+
addigy_payload_type: 'com.addigy.syspolicy.system-extension-policy.com.apple.system-extension-policy' | 'com.addigy.TCC.configuration-profile-policy.com.apple.TCC.configuration-profile-policy' | 'com.addigy.syspolicy.kernel-extension-policy.com.apple.syspolicy.kernel-extension-policy' | 'com.addigy.notifications.com.apple.notificationsettings' | 'com.addigy.custom.mdm.payload' | 'com.addigy.securityAndPrivacy.com.apple.MCX.FileVault2' | 'com.addigy.securityAndPrivacy.com.apple.MCX' | 'com.addigy.securityAndPrivacy.com.apple.security.pkcs1' | 'com.addigy.securityAndPrivacy.com.apple.security.FDERecoveryKeyEscrow' | 'com.addigy.securityAndPrivacy.com.apple.security.FDERecoveryRedirect' | 'com.addigy.servicemanagement.com.apple.servicemanagement' | 'com.addigy.webcontent-filter.com.apple.webcontent-filter';
|
|
14
|
+
payload_type: 'com.apple.system-extension-policy' | 'com.apple.syspolicy.kernel-extension-policy' | 'com.apple.TCC.configuration-profile-policy' | 'com.apple.notificationsettings' | 'custom' | 'com.apple.MCX.FileVault2' | 'com.apple.MCX' | 'com.apple.security.pkcs1' | 'com.apple.security.FDERecoveryKeyEscrow' | 'com.apple.security.FDERecoveryRedirect' | 'com.apple.servicemanagement' | 'com.apple.webcontent-filter';
|
|
15
15
|
payload_version: number;
|
|
16
16
|
payload_identifier: string;
|
|
17
17
|
payload_uuid: string;
|
|
@@ -218,3 +218,75 @@ export interface PoliciesMdmPayload {
|
|
|
218
218
|
configuration_id: string;
|
|
219
219
|
policy_id: string;
|
|
220
220
|
}
|
|
221
|
+
export interface ServiceManagementPayload extends Payload {
|
|
222
|
+
addigy_payload_version: number;
|
|
223
|
+
has_manifest: boolean;
|
|
224
|
+
payload_enabled: boolean;
|
|
225
|
+
payload_priority: number;
|
|
226
|
+
policy_restricted: boolean;
|
|
227
|
+
requires_device_supervision: boolean;
|
|
228
|
+
requires_mdm_profile_approved: boolean;
|
|
229
|
+
rules: ServiceManagementPayloadRule[];
|
|
230
|
+
supported_os_versions: SupportedOsVersions | null;
|
|
231
|
+
}
|
|
232
|
+
export interface ServiceManagementPayloadRule {
|
|
233
|
+
comment: string;
|
|
234
|
+
rule_type: string;
|
|
235
|
+
rule_value: string;
|
|
236
|
+
}
|
|
237
|
+
export interface WebContentFilterPayload extends Payload {
|
|
238
|
+
addigy_payload_version: number;
|
|
239
|
+
auto_filter_enabled: null | boolean;
|
|
240
|
+
blacklisted_urls: null | string[];
|
|
241
|
+
content_filter_uuid: null | string;
|
|
242
|
+
filter_browsers: null | boolean;
|
|
243
|
+
filter_data_provider_bundle_identifier: string | null;
|
|
244
|
+
filter_data_provider_designated_requirement: string | null;
|
|
245
|
+
filter_grade: 'firewall' | 'inspector';
|
|
246
|
+
filter_packet_provider_bundle_identifier: null | string;
|
|
247
|
+
filter_packet_provider_designated_requirement: null | string;
|
|
248
|
+
filter_packets: null | boolean;
|
|
249
|
+
filter_sockets: boolean;
|
|
250
|
+
filter_type: string;
|
|
251
|
+
has_manifest: boolean;
|
|
252
|
+
organization: null | string;
|
|
253
|
+
password: null | string;
|
|
254
|
+
payload_enabled: boolean;
|
|
255
|
+
payload_priority: number;
|
|
256
|
+
permitted_urls: null | string[];
|
|
257
|
+
plugin_bundle_id: string | null;
|
|
258
|
+
policy_restricted: boolean;
|
|
259
|
+
requires_device_supervision: boolean;
|
|
260
|
+
requires_mdm_profile_approved: boolean;
|
|
261
|
+
server_address: null | string;
|
|
262
|
+
supported_os_versions: null | SupportedOsVersions;
|
|
263
|
+
user_defined_name: string;
|
|
264
|
+
user_name: null | string;
|
|
265
|
+
vendor_config: Record<string, string> | null;
|
|
266
|
+
white_listed_bookmarks: null | string[];
|
|
267
|
+
}
|
|
268
|
+
export interface CreateWebContentFilterPayload {
|
|
269
|
+
user_defined_name: string;
|
|
270
|
+
plugin_bundle_id: string;
|
|
271
|
+
filter_grade: 'firewall' | 'inspector';
|
|
272
|
+
vendor_config?: Record<string, string>;
|
|
273
|
+
content_filter_uuid?: string;
|
|
274
|
+
server_address?: string;
|
|
275
|
+
organization?: string;
|
|
276
|
+
user_name?: string;
|
|
277
|
+
password?: string;
|
|
278
|
+
filter_browsers?: boolean;
|
|
279
|
+
filter_sockets?: boolean;
|
|
280
|
+
filter_data_provider_bundle_identifier?: string;
|
|
281
|
+
filter_data_provider_designated_requirement?: string;
|
|
282
|
+
filter_packets?: boolean;
|
|
283
|
+
filter_packet_provider_bundle_identifier?: string;
|
|
284
|
+
filter_packet_provider_designated_requirement?: string;
|
|
285
|
+
auto_filter_enabled?: null;
|
|
286
|
+
permitted_urls?: string[];
|
|
287
|
+
blacklisted_urls?: string[];
|
|
288
|
+
white_listed_bookmarks?: string[];
|
|
289
|
+
policy_restricted?: boolean;
|
|
290
|
+
requires_device_supervision?: boolean;
|
|
291
|
+
requires_mdm_profile_approved?: boolean;
|
|
292
|
+
}
|