identityscope 0.0.0-stage → 0.28.4
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/LICENSE +21 -0
- package/README.md +916 -2
- package/SECURITY.md +56 -0
- package/dist/core/audit-readiness.d.ts +158 -0
- package/dist/core/audit-readiness.js +357 -0
- package/dist/core/audit-readiness.js.map +1 -0
- package/dist/core/certs.d.ts +68 -0
- package/dist/core/certs.js +132 -0
- package/dist/core/certs.js.map +1 -0
- package/dist/core/checks.d.ts +133 -0
- package/dist/core/checks.js +512 -0
- package/dist/core/checks.js.map +1 -0
- package/dist/core/cloud-rules.d.ts +20 -0
- package/dist/core/cloud-rules.js +44 -0
- package/dist/core/cloud-rules.js.map +1 -0
- package/dist/core/compare.d.ts +45 -0
- package/dist/core/compare.js +372 -0
- package/dist/core/compare.js.map +1 -0
- package/dist/core/conditions.d.ts +10 -0
- package/dist/core/conditions.js +201 -0
- package/dist/core/conditions.js.map +1 -0
- package/dist/core/credentials.d.ts +71 -0
- package/dist/core/credentials.js +211 -0
- package/dist/core/credentials.js.map +1 -0
- package/dist/core/datasets.d.ts +53 -0
- package/dist/core/datasets.js +596 -0
- package/dist/core/datasets.js.map +1 -0
- package/dist/core/definition.d.ts +32 -0
- package/dist/core/definition.js +301 -0
- package/dist/core/definition.js.map +1 -0
- package/dist/core/discover.d.ts +32 -0
- package/dist/core/discover.js +105 -0
- package/dist/core/discover.js.map +1 -0
- package/dist/core/engine.d.ts +18 -0
- package/dist/core/engine.js +290 -0
- package/dist/core/engine.js.map +1 -0
- package/dist/core/fields.d.ts +16 -0
- package/dist/core/fields.js +132 -0
- package/dist/core/fields.js.map +1 -0
- package/dist/core/governance-trail.d.ts +211 -0
- package/dist/core/governance-trail.js +557 -0
- package/dist/core/governance-trail.js.map +1 -0
- package/dist/core/http-transport.d.ts +66 -0
- package/dist/core/http-transport.js +247 -0
- package/dist/core/http-transport.js.map +1 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.js +16 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/insights.d.ts +176 -0
- package/dist/core/insights.js +417 -0
- package/dist/core/insights.js.map +1 -0
- package/dist/core/joiner-evidence.d.ts +98 -0
- package/dist/core/joiner-evidence.js +254 -0
- package/dist/core/joiner-evidence.js.map +1 -0
- package/dist/core/lab/credential-map.d.ts +50 -0
- package/dist/core/lab/credential-map.js +163 -0
- package/dist/core/lab/credential-map.js.map +1 -0
- package/dist/core/lab/javadate.d.ts +7 -0
- package/dist/core/lab/javadate.js +307 -0
- package/dist/core/lab/javadate.js.map +1 -0
- package/dist/core/lab/jsonpath.d.ts +11 -0
- package/dist/core/lab/jsonpath.js +273 -0
- package/dist/core/lab/jsonpath.js.map +1 -0
- package/dist/core/lab/policy-preview.d.ts +43 -0
- package/dist/core/lab/policy-preview.js +78 -0
- package/dist/core/lab/policy-preview.js.map +1 -0
- package/dist/core/lab/rfc5646.d.ts +2 -0
- package/dist/core/lab/rfc5646.js +421 -0
- package/dist/core/lab/rfc5646.js.map +1 -0
- package/dist/core/lab/transform-impact.d.ts +63 -0
- package/dist/core/lab/transform-impact.js +138 -0
- package/dist/core/lab/transform-impact.js.map +1 -0
- package/dist/core/lab/transform-people.d.ts +61 -0
- package/dist/core/lab/transform-people.js +132 -0
- package/dist/core/lab/transform-people.js.map +1 -0
- package/dist/core/lab/transforms.d.ts +79 -0
- package/dist/core/lab/transforms.js +738 -0
- package/dist/core/lab/transforms.js.map +1 -0
- package/dist/core/lab/velocity.d.ts +33 -0
- package/dist/core/lab/velocity.js +874 -0
- package/dist/core/lab/velocity.js.map +1 -0
- package/dist/core/lab/workflow-health.d.ts +80 -0
- package/dist/core/lab/workflow-health.js +234 -0
- package/dist/core/lab/workflow-health.js.map +1 -0
- package/dist/core/lab/workflows.d.ts +87 -0
- package/dist/core/lab/workflows.js +568 -0
- package/dist/core/lab/workflows.js.map +1 -0
- package/dist/core/lifecycle-gaps.d.ts +192 -0
- package/dist/core/lifecycle-gaps.js +389 -0
- package/dist/core/lifecycle-gaps.js.map +1 -0
- package/dist/core/logs.d.ts +145 -0
- package/dist/core/logs.js +342 -0
- package/dist/core/logs.js.map +1 -0
- package/dist/core/lookup.d.ts +129 -0
- package/dist/core/lookup.js +289 -0
- package/dist/core/lookup.js.map +1 -0
- package/dist/core/model-insights.d.ts +247 -0
- package/dist/core/model-insights.js +474 -0
- package/dist/core/model-insights.js.map +1 -0
- package/dist/core/narrow.d.ts +23 -0
- package/dist/core/narrow.js +137 -0
- package/dist/core/narrow.js.map +1 -0
- package/dist/core/nerm.d.ts +154 -0
- package/dist/core/nerm.js +397 -0
- package/dist/core/nerm.js.map +1 -0
- package/dist/core/operations-watch.d.ts +232 -0
- package/dist/core/operations-watch.js +491 -0
- package/dist/core/operations-watch.js.map +1 -0
- package/dist/core/output/csv.d.ts +6 -0
- package/dist/core/output/csv.js +22 -0
- package/dist/core/output/csv.js.map +1 -0
- package/dist/core/output/html.d.ts +11 -0
- package/dist/core/output/html.js +66 -0
- package/dist/core/output/html.js.map +1 -0
- package/dist/core/output/xlsx.d.ts +3 -0
- package/dist/core/output/xlsx.js +130 -0
- package/dist/core/output/xlsx.js.map +1 -0
- package/dist/core/output/zip.d.ts +16 -0
- package/dist/core/output/zip.js +106 -0
- package/dist/core/output/zip.js.map +1 -0
- package/dist/core/ownership.d.ts +39 -0
- package/dist/core/ownership.js +100 -0
- package/dist/core/ownership.js.map +1 -0
- package/dist/core/patterns.d.ts +11 -0
- package/dist/core/patterns.js +31 -0
- package/dist/core/patterns.js.map +1 -0
- package/dist/core/preview.d.ts +96 -0
- package/dist/core/preview.js +173 -0
- package/dist/core/preview.js.map +1 -0
- package/dist/core/roles.d.ts +125 -0
- package/dist/core/roles.js +420 -0
- package/dist/core/roles.js.map +1 -0
- package/dist/core/tenant.d.ts +67 -0
- package/dist/core/tenant.js +194 -0
- package/dist/core/tenant.js.map +1 -0
- package/dist/core/threat-signals.d.ts +112 -0
- package/dist/core/threat-signals.js +250 -0
- package/dist/core/threat-signals.js.map +1 -0
- package/dist/core/threat-watch.d.ts +144 -0
- package/dist/core/threat-watch.js +282 -0
- package/dist/core/threat-watch.js.map +1 -0
- package/dist/core/transport.d.ts +82 -0
- package/dist/core/transport.js +312 -0
- package/dist/core/transport.js.map +1 -0
- package/dist/core/types.d.ts +137 -0
- package/dist/core/types.js +10 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/warnings.d.ts +236 -0
- package/dist/core/warnings.js +504 -0
- package/dist/core/warnings.js.map +1 -0
- package/dist/demo/tenant.d.ts +1572 -0
- package/dist/demo/tenant.js +1023 -0
- package/dist/demo/tenant.js.map +1 -0
- package/dist/node/attribute-history.d.ts +22 -0
- package/dist/node/attribute-history.js +86 -0
- package/dist/node/attribute-history.js.map +1 -0
- package/dist/node/changes.d.ts +20 -0
- package/dist/node/changes.js +78 -0
- package/dist/node/changes.js.map +1 -0
- package/dist/node/cli.d.ts +2 -0
- package/dist/node/cli.js +291 -0
- package/dist/node/cli.js.map +1 -0
- package/dist/node/config.d.ts +72 -0
- package/dist/node/config.js +203 -0
- package/dist/node/config.js.map +1 -0
- package/dist/node/credentials.d.ts +13 -0
- package/dist/node/credentials.js +24 -0
- package/dist/node/credentials.js.map +1 -0
- package/dist/node/delivery.d.ts +10 -0
- package/dist/node/delivery.js +105 -0
- package/dist/node/delivery.js.map +1 -0
- package/dist/node/doctor.d.ts +2 -0
- package/dist/node/doctor.js +151 -0
- package/dist/node/doctor.js.map +1 -0
- package/dist/node/drift.d.ts +31 -0
- package/dist/node/drift.js +56 -0
- package/dist/node/drift.js.map +1 -0
- package/dist/node/evidence.d.ts +42 -0
- package/dist/node/evidence.js +129 -0
- package/dist/node/evidence.js.map +1 -0
- package/dist/node/exceptions.d.ts +30 -0
- package/dist/node/exceptions.js +83 -0
- package/dist/node/exceptions.js.map +1 -0
- package/dist/node/history.d.ts +35 -0
- package/dist/node/history.js +74 -0
- package/dist/node/history.js.map +1 -0
- package/dist/node/index.d.ts +7 -0
- package/dist/node/index.js +8 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/keep.d.ts +9 -0
- package/dist/node/keep.js +39 -0
- package/dist/node/keep.js.map +1 -0
- package/dist/node/loader.d.ts +7 -0
- package/dist/node/loader.js +35 -0
- package/dist/node/loader.js.map +1 -0
- package/dist/node/log-files.d.ts +16 -0
- package/dist/node/log-files.js +93 -0
- package/dist/node/log-files.js.map +1 -0
- package/dist/node/monthly.d.ts +41 -0
- package/dist/node/monthly.js +108 -0
- package/dist/node/monthly.js.map +1 -0
- package/dist/node/oauth-login.d.ts +45 -0
- package/dist/node/oauth-login.js +121 -0
- package/dist/node/oauth-login.js.map +1 -0
- package/dist/node/packs.d.ts +32 -0
- package/dist/node/packs.js +43 -0
- package/dist/node/packs.js.map +1 -0
- package/dist/node/privileged-seen.d.ts +11 -0
- package/dist/node/privileged-seen.js +41 -0
- package/dist/node/privileged-seen.js.map +1 -0
- package/dist/node/recipients.d.ts +17 -0
- package/dist/node/recipients.js +51 -0
- package/dist/node/recipients.js.map +1 -0
- package/dist/node/runner.d.ts +51 -0
- package/dist/node/runner.js +298 -0
- package/dist/node/runner.js.map +1 -0
- package/dist/node/runtime.d.ts +12 -0
- package/dist/node/runtime.js +13 -0
- package/dist/node/runtime.js.map +1 -0
- package/dist/node/schedules.d.ts +87 -0
- package/dist/node/schedules.js +141 -0
- package/dist/node/schedules.js.map +1 -0
- package/dist/node/secrets.d.ts +37 -0
- package/dist/node/secrets.js +219 -0
- package/dist/node/secrets.js.map +1 -0
- package/dist/node/support.d.ts +14 -0
- package/dist/node/support.js +133 -0
- package/dist/node/support.js.map +1 -0
- package/dist/node/tenants.d.ts +93 -0
- package/dist/node/tenants.js +255 -0
- package/dist/node/tenants.js.map +1 -0
- package/dist/node/ui-page.d.ts +1 -0
- package/dist/node/ui-page.js +3 -0
- package/dist/node/ui-page.js.map +1 -0
- package/dist/node/ui-server.d.ts +48 -0
- package/dist/node/ui-server.js +2665 -0
- package/dist/node/ui-server.js.map +1 -0
- package/dist/node/write.d.ts +9 -0
- package/dist/node/write.js +53 -0
- package/dist/node/write.js.map +1 -0
- package/dist/reports/builtin.generated.d.ts +1 -0
- package/dist/reports/builtin.generated.js +49 -0
- package/dist/reports/builtin.generated.js.map +1 -0
- package/dist/reports/library.d.ts +6 -0
- package/dist/reports/library.js +18 -0
- package/dist/reports/library.js.map +1 -0
- package/launcher/IdentityScope.cmd +11 -0
- package/package.json +69 -4
- package/reports/access-profile-members.yaml +29 -0
- package/reports/access-profile-membership-counts.yaml +17 -0
- package/reports/access-profiles-without-owner.yaml +16 -0
- package/reports/access-request-audit-trail.yaml +36 -0
- package/reports/accounts-by-source.yaml +19 -0
- package/reports/active-identities-without-manager.yaml +22 -0
- package/reports/aggregation-failures.yaml +29 -0
- package/reports/aggregation-history.yaml +27 -0
- package/reports/all-sources.yaml +16 -0
- package/reports/application-accounts.yaml +32 -0
- package/reports/application-entitlements.yaml +31 -0
- package/reports/campaign-progress.yaml +23 -0
- package/reports/certification-decisions.yaml +31 -0
- package/reports/direct-reports-per-manager.yaml +20 -0
- package/reports/disabled-accounts-of-active-people.yaml +33 -0
- package/reports/duplicate-emails.yaml +16 -0
- package/reports/entitlement-holders.yaml +35 -0
- package/reports/entitlements-held-by-inactive-identities.yaml +31 -0
- package/reports/entitlements-without-owner.yaml +28 -0
- package/reports/identities-by-lifecycle-state.yaml +15 -0
- package/reports/identities-missing-key-attributes.yaml +27 -0
- package/reports/identities-with-processing-errors.yaml +19 -0
- package/reports/identity-attribute-mappings.yaml +27 -0
- package/reports/machine-accounts.yaml +28 -0
- package/reports/managers-and-direct-reports.yaml +23 -0
- package/reports/most-access.yaml +18 -0
- package/reports/new-identities.yaml +24 -0
- package/reports/old-passwords.yaml +35 -0
- package/reports/pending-reviews-by-reviewer.yaml +20 -0
- package/reports/person-access.yaml +31 -0
- package/reports/privileged-access.yaml +29 -0
- package/reports/provisioning-error-causes.yaml +27 -0
- package/reports/provisioning-errors.yaml +32 -0
- package/reports/provisioning-failures.yaml +28 -0
- package/reports/recent-access-requests.yaml +22 -0
- package/reports/recent-activity.yaml +32 -0
- package/reports/recent-leavers.yaml +34 -0
- package/reports/role-members.yaml +29 -0
- package/reports/role-membership-counts.yaml +18 -0
- package/reports/roles-without-owner.yaml +17 -0
- package/reports/sources-needing-attention.yaml +23 -0
- package/reports/stuck-access-requests.yaml +29 -0
- package/reports/team-access.yaml +30 -0
- package/reports/terminated-users-with-active-accounts.yaml +46 -0
- package/reports/uncorrelated-accounts.yaml +38 -0
- package/ui/js/00-setup.js +6 -0
- package/ui/js/01-small-helpers.js +143 -0
- package/ui/js/02-connection.js +150 -0
- package/ui/js/03-health-check.js +17 -0
- package/ui/js/04-library.js +135 -0
- package/ui/js/05-pickers.js +163 -0
- package/ui/js/06-report-view.js +157 -0
- package/ui/js/07-fields.js +85 -0
- package/ui/js/08-designer.js +360 -0
- package/ui/js/09-yaml.js +22 -0
- package/ui/js/10-instant-check.js +171 -0
- package/ui/js/11-lookup.js +161 -0
- package/ui/js/12-tenant.js +115 -0
- package/ui/js/13-source-configuration-and-diagnostics.js +64 -0
- package/ui/js/14-certifications.js +68 -0
- package/ui/js/15-monthly-report.js +24 -0
- package/ui/js/16-ownership.js +39 -0
- package/ui/js/17-compare-tenants.js +102 -0
- package/ui/js/18-audit.js +181 -0
- package/ui/js/19-insights.js +108 -0
- package/ui/js/20-role-mining.js +35 -0
- package/ui/js/21-share-reports.js +45 -0
- package/ui/js/22-partner-overview-all-customer-tenants.js +228 -0
- package/ui/js/23-in-app-guidance.js +217 -0
- package/ui/js/24-role-tools.js +220 -0
- package/ui/js/25-schedules.js +264 -0
- package/ui/js/26-start.js +7 -0
- package/ui/js/27-warnings.js +224 -0
- package/ui/js/28-audit-readiness.js +99 -0
- package/ui/js/29-lifecycle.js +182 -0
- package/ui/js/30-labs.js +265 -0
- package/ui/js/31-build.js +203 -0
- package/ui/js/32-lab-examples.js +148 -0
- package/ui/js/33-finder.js +89 -0
- package/ui/js/34-governance.js +129 -0
- package/ui/js/35-watch.js +266 -0
- package/ui/js/36-model.js +247 -0
- package/ui/js/37-logs-and-watch.js +224 -0
- package/ui/shell.html +112 -0
- package/ui/style.css +350 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where each transform is used, before you change it: identity profile
|
|
3
|
+
* mappings, other transforms (followed through chains of references) and
|
|
4
|
+
* source provisioning policies, with how many people each identity profile
|
|
5
|
+
* covers. Also lists transforms nothing uses. Read-only.
|
|
6
|
+
*/
|
|
7
|
+
import { pageList } from '../transport.js';
|
|
8
|
+
import { readMappings, readTransforms } from './transform-people.js';
|
|
9
|
+
/** Names (or ids) of the transforms a definition refers to with "reference". */
|
|
10
|
+
export function referencesIn(def, out = new Set()) {
|
|
11
|
+
if (Array.isArray(def)) {
|
|
12
|
+
for (const x of def)
|
|
13
|
+
referencesIn(x, out);
|
|
14
|
+
}
|
|
15
|
+
else if (def && typeof def === 'object') {
|
|
16
|
+
const o = def;
|
|
17
|
+
if (o['type'] === 'reference') {
|
|
18
|
+
const id = o['attributes']?.['id'];
|
|
19
|
+
if (typeof id === 'string')
|
|
20
|
+
out.add(id);
|
|
21
|
+
}
|
|
22
|
+
for (const v of Object.values(o))
|
|
23
|
+
referencesIn(v, out);
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
/** Every use of each transform, following chains. Pure: for tests and for the server. */
|
|
28
|
+
export function impactFrom(transforms, definitions, people) {
|
|
29
|
+
const all = [
|
|
30
|
+
...transforms.map((t) => ({ kind: 'Transform', where: String(t['name'] ?? t['id']), def: { type: t['type'], attributes: t['attributes'] } })),
|
|
31
|
+
...definitions,
|
|
32
|
+
];
|
|
33
|
+
const refs = all.map((d) => referencesIn(d.def));
|
|
34
|
+
const keyOf = (t) => [String(t['name'] ?? ''), String(t['id'] ?? '')].filter(Boolean);
|
|
35
|
+
const out = [];
|
|
36
|
+
for (const t of transforms) {
|
|
37
|
+
const name = String(t['name'] ?? t['id']);
|
|
38
|
+
// Breadth first: names that lead to this transform, each with the chain that got there.
|
|
39
|
+
const chains = new Map(keyOf(t).map((k) => [k, []]));
|
|
40
|
+
const uses = [];
|
|
41
|
+
const seen = new Set();
|
|
42
|
+
let frontier = [...chains.keys()];
|
|
43
|
+
for (let depth = 0; frontier.length && depth < 20; depth++) {
|
|
44
|
+
const next = [];
|
|
45
|
+
all.forEach((d, i) => {
|
|
46
|
+
if (seen.has(i) || (d.kind === 'Transform' && d.where === name))
|
|
47
|
+
return;
|
|
48
|
+
const hit = frontier.find((k) => refs[i].has(k));
|
|
49
|
+
if (hit === undefined)
|
|
50
|
+
return;
|
|
51
|
+
seen.add(i);
|
|
52
|
+
const via = chains.get(hit);
|
|
53
|
+
uses.push({ kind: d.kind, where: d.where, detail: d.detail, via, profileId: d.profileId, sourceId: d.sourceId });
|
|
54
|
+
if (d.kind === 'Transform') {
|
|
55
|
+
const user = transforms.find((x) => String(x['name'] ?? x['id']) === d.where);
|
|
56
|
+
for (const k of user ? keyOf(user) : [d.where]) {
|
|
57
|
+
if (!chains.has(k)) {
|
|
58
|
+
chains.set(k, [d.where, ...via]);
|
|
59
|
+
next.push(k);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
frontier = next;
|
|
65
|
+
}
|
|
66
|
+
const profileIds = [...new Set(uses.filter((u) => u.profileId).map((u) => u.profileId))];
|
|
67
|
+
const counts = profileIds.map((id) => people.get(id));
|
|
68
|
+
out.push({
|
|
69
|
+
name,
|
|
70
|
+
id: String(t['id'] ?? ''),
|
|
71
|
+
type: String(t['type'] ?? ''),
|
|
72
|
+
uses: uses.sort((a, b) => a.via.length - b.via.length || a.kind.localeCompare(b.kind) || a.where.localeCompare(b.where)),
|
|
73
|
+
direct: uses.filter((u) => !u.via.length).length,
|
|
74
|
+
people: counts.some((c) => c === null || c === undefined) ? null : counts.reduce((s, c) => s + (c ?? 0), 0),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
out.sort((a, b) => a.name.localeCompare(b.name));
|
|
78
|
+
return { transforms: out, unused: out.filter((x) => !x.uses.length).map((x) => x.name) };
|
|
79
|
+
}
|
|
80
|
+
export async function readPolicies(t, sourceId) {
|
|
81
|
+
const r = await t.request({ method: 'GET', path: `/sources/v1/${encodeURIComponent(sourceId)}/provisioning-policies` });
|
|
82
|
+
return Array.isArray(r.data) ? r.data : [];
|
|
83
|
+
}
|
|
84
|
+
async function peopleIn(t, profileId) {
|
|
85
|
+
try {
|
|
86
|
+
const r = await t.request({ method: 'POST', path: '/search/v1', query: { limit: 1, count: true }, body: { indices: ['identities'], query: { query: `identityProfile.id:"${profileId}"` }, includeNested: false } });
|
|
87
|
+
const n = Number(r.headers['x-total-count']);
|
|
88
|
+
return Number.isFinite(n) ? n : null;
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export async function transformImpact(t, onProgress) {
|
|
95
|
+
const notes = [];
|
|
96
|
+
onProgress?.('Reading transforms and identity profiles...');
|
|
97
|
+
const [transforms, mappings] = await Promise.all([readTransforms(t), readMappings(t)]);
|
|
98
|
+
const defs = mappings.map((m) => ({ kind: 'Identity profile', where: m.profile, detail: m.attribute, def: m.transformDefinition, profileId: m.profileId }));
|
|
99
|
+
const sources = [];
|
|
100
|
+
for await (const s of pageList(t, '/sources/v1', {}))
|
|
101
|
+
sources.push(s);
|
|
102
|
+
let policiesRead = 0;
|
|
103
|
+
let refused = 0;
|
|
104
|
+
for (const [i, s] of sources.entries()) {
|
|
105
|
+
onProgress?.(`Reading provisioning policies... ${i + 1} of ${sources.length} sources`);
|
|
106
|
+
const id = String(s['id'] ?? '');
|
|
107
|
+
if (!/^[A-Za-z0-9-]+$/.test(id))
|
|
108
|
+
continue;
|
|
109
|
+
let policies;
|
|
110
|
+
try {
|
|
111
|
+
policies = await readPolicies(t, id);
|
|
112
|
+
}
|
|
113
|
+
catch (e) {
|
|
114
|
+
refused++;
|
|
115
|
+
if (e.status !== 403 && e.status !== 404)
|
|
116
|
+
throw e;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
policiesRead += policies.length;
|
|
120
|
+
for (const p of policies) {
|
|
121
|
+
for (const f of p.fields ?? []) {
|
|
122
|
+
if (f.transform)
|
|
123
|
+
defs.push({ kind: 'Provisioning policy', where: `${s['name']} (${p.usageType ?? p.name ?? 'policy'})`, detail: f.name, def: f.transform, sourceId: id });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (refused)
|
|
128
|
+
notes.push(`The provisioning policies of ${refused} source${refused === 1 ? '' : 's'} could not be read (no permission), so uses there are not shown.`);
|
|
129
|
+
onProgress?.('Counting people per identity profile...');
|
|
130
|
+
const profileIds = [...new Map(mappings.map((m) => [m.profileId, m.profile])).entries()];
|
|
131
|
+
const people = new Map();
|
|
132
|
+
for (const [id] of profileIds)
|
|
133
|
+
people.set(id, await peopleIn(t, id));
|
|
134
|
+
const r = impactFrom(transforms, defs, people);
|
|
135
|
+
notes.push('Rules run code that IdentityScope cannot read, so anything a rule does is not included.');
|
|
136
|
+
return { ...r, profiles: profileIds.map(([id, name]) => ({ id, name, people: people.get(id) ?? null })), policiesRead, notes };
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=transform-impact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-impact.js","sourceRoot":"","sources":["../../../src/core/lab/transform-impact.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAkB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAyCrE,gFAAgF;AAChF,MAAM,UAAU,YAAY,CAAC,GAAY,EAAE,MAAM,IAAI,GAAG,EAAU;IAChE,IAAI,KAAK,CAAC,OAAO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CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACzF,MAAM,MAAM,GAAG,IAAI,GAAG,EAAyB,CAAC;IAChD,KAAK,MAAM,CAAC,EAAE,CAAC,IAAI,UAAU;QAAE,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACrE,MAAM,CAAC,GAAG,UAAU,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/C,KAAK,CAAC,IAAI,CAAC,yFAAyF,CAAC,CAAC;IACtG,OAAO,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;AACjI,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a transform on real people, offline: reads a sample of identities and
|
|
3
|
+
* their accounts (read-only), evaluates the transform locally for each, and
|
|
4
|
+
* compares with the value ISC has now. With a transform taken from an identity
|
|
5
|
+
* profile mapping, that comparison shows how faithful the offline engine is
|
|
6
|
+
* ("matches ISC for 498 of 500 people").
|
|
7
|
+
*/
|
|
8
|
+
import { type Transport } from '../transport.js';
|
|
9
|
+
import { type EvalResult, type LabAccount, type LabInput, type Value } from './transforms.js';
|
|
10
|
+
export interface Mapping {
|
|
11
|
+
profileId: string;
|
|
12
|
+
profile: string;
|
|
13
|
+
attribute: string;
|
|
14
|
+
transformDefinition: Record<string, unknown>;
|
|
15
|
+
/** Short description: "reference Department Lookup ← Workday.DEPT". */
|
|
16
|
+
summary: string;
|
|
17
|
+
}
|
|
18
|
+
/** The transform engine's input for one person from ISC search: identity attributes and accounts. */
|
|
19
|
+
export declare function identityInput(p: Record<string, unknown>, accounts: LabAccount[]): LabInput;
|
|
20
|
+
/** Reads the accounts of up to 50 people per request, with their attributes. */
|
|
21
|
+
export declare function accountsOf(t: Transport, ids: string[], onProgress?: (m: string) => void): Promise<Map<string, LabAccount[]>>;
|
|
22
|
+
export declare function readTransforms(t: Transport): Promise<Record<string, unknown>[]>;
|
|
23
|
+
export declare function readMappings(t: Transport): Promise<Mapping[]>;
|
|
24
|
+
export interface PersonResult {
|
|
25
|
+
person: string;
|
|
26
|
+
id: string;
|
|
27
|
+
current: Value | undefined;
|
|
28
|
+
result: Value;
|
|
29
|
+
status: EvalResult['status'];
|
|
30
|
+
error?: string;
|
|
31
|
+
same: boolean | null;
|
|
32
|
+
}
|
|
33
|
+
export interface PeopleRun {
|
|
34
|
+
people: number;
|
|
35
|
+
rows: PersonResult[];
|
|
36
|
+
summary: {
|
|
37
|
+
same: number;
|
|
38
|
+
different: number;
|
|
39
|
+
empty: number;
|
|
40
|
+
errors: number;
|
|
41
|
+
iscOnly: number;
|
|
42
|
+
random: number;
|
|
43
|
+
};
|
|
44
|
+
distinct: {
|
|
45
|
+
value: string;
|
|
46
|
+
people: number;
|
|
47
|
+
}[];
|
|
48
|
+
assumptions: string[];
|
|
49
|
+
attribute?: string;
|
|
50
|
+
notes: string[];
|
|
51
|
+
}
|
|
52
|
+
export declare function runOnPeople(t: Transport, o: {
|
|
53
|
+
transform: Record<string, unknown>;
|
|
54
|
+
transforms: Record<string, unknown>[];
|
|
55
|
+
attribute?: string;
|
|
56
|
+
implicit?: Record<string, unknown>;
|
|
57
|
+
query?: string;
|
|
58
|
+
count?: number;
|
|
59
|
+
now?: Date;
|
|
60
|
+
onProgress?: (m: string) => void;
|
|
61
|
+
}): Promise<PeopleRun>;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a transform on real people, offline: reads a sample of identities and
|
|
3
|
+
* their accounts (read-only), evaluates the transform locally for each, and
|
|
4
|
+
* compares with the value ISC has now. With a transform taken from an identity
|
|
5
|
+
* profile mapping, that comparison shows how faithful the offline engine is
|
|
6
|
+
* ("matches ISC for 498 of 500 people").
|
|
7
|
+
*/
|
|
8
|
+
import { pageList, pageSearch } from '../transport.js';
|
|
9
|
+
import { TransformEngine } from './transforms.js';
|
|
10
|
+
/** The transform engine's input for one person from ISC search: identity attributes and accounts. */
|
|
11
|
+
export function identityInput(p, accounts) {
|
|
12
|
+
const attrs = (p['attributes'] ?? {});
|
|
13
|
+
return { identity: { uid: p['name'], email: p['email'], displayName: p['displayName'], ...attrs }, accounts };
|
|
14
|
+
}
|
|
15
|
+
/** Reads the accounts of up to 50 people per request, with their attributes. */
|
|
16
|
+
export async function accountsOf(t, ids, onProgress) {
|
|
17
|
+
const accounts = new Map();
|
|
18
|
+
for (let i = 0; i < ids.length; i += 50) {
|
|
19
|
+
const chunk = ids.slice(i, i + 50);
|
|
20
|
+
const filters = `identityId in (${chunk.map((x) => JSON.stringify(x)).join(',')})`;
|
|
21
|
+
for await (const a of pageList(t, '/accounts/v1', { filters })) {
|
|
22
|
+
const id = String(a['identityId'] ?? a['identity']?.['id'] ?? '');
|
|
23
|
+
if (!chunk.includes(id))
|
|
24
|
+
continue;
|
|
25
|
+
const list = accounts.get(id) ?? [];
|
|
26
|
+
list.push({ source: String(a['sourceName'] ?? a['source']?.['name'] ?? ''), sourceId: String(a['sourceId'] ?? a['source']?.['id'] ?? ''), nativeIdentity: a['nativeIdentity'], name: a['name'], created: a['created'], attributes: (a['attributes'] ?? {}) });
|
|
27
|
+
accounts.set(id, list);
|
|
28
|
+
}
|
|
29
|
+
onProgress?.(`Reading accounts... ${Math.min(i + 50, ids.length)} of ${ids.length} people`);
|
|
30
|
+
}
|
|
31
|
+
return accounts;
|
|
32
|
+
}
|
|
33
|
+
export async function readTransforms(t) {
|
|
34
|
+
const out = [];
|
|
35
|
+
for await (const x of pageList(t, '/transforms/v1', {}))
|
|
36
|
+
out.push(x);
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
export async function readMappings(t) {
|
|
40
|
+
const out = [];
|
|
41
|
+
for await (const p of pageList(t, '/identity-profiles/v1', {})) {
|
|
42
|
+
const cfg = (p['identityAttributeConfig'] ?? {});
|
|
43
|
+
for (const m of cfg.attributeTransforms ?? []) {
|
|
44
|
+
if (!m.identityAttributeName || !m.transformDefinition)
|
|
45
|
+
continue;
|
|
46
|
+
out.push({ profileId: String(p['id']), profile: String(p['name'] ?? p['id']), attribute: m.identityAttributeName, transformDefinition: m.transformDefinition, summary: summarize(m.transformDefinition) });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
function summarize(d) {
|
|
52
|
+
const a = (d['attributes'] ?? {});
|
|
53
|
+
const src = (x) => `${x['sourceName'] ?? x['applicationName'] ?? '?'}.${x['attributeName'] ?? '?'}`;
|
|
54
|
+
if (d['type'] === 'accountAttribute')
|
|
55
|
+
return `account attribute ${src(a)}`;
|
|
56
|
+
if (d['type'] === 'reference') {
|
|
57
|
+
const inp = a['input'];
|
|
58
|
+
return `transform "${a['id']}"${inp && inp['type'] === 'accountAttribute' ? ` on ${src((inp['attributes'] ?? {}))}` : ''}`;
|
|
59
|
+
}
|
|
60
|
+
if (d['type'] === 'rule')
|
|
61
|
+
return `rule "${a['name']}"`;
|
|
62
|
+
return String(d['type']);
|
|
63
|
+
}
|
|
64
|
+
const empty = (v) => v === null || v === undefined || v === '' || (Array.isArray(v) && v.length === 0);
|
|
65
|
+
const norm = (v) => (empty(v) ? '' : Array.isArray(v) ? v.map(String).join('|') : String(v));
|
|
66
|
+
export async function runOnPeople(t, o) {
|
|
67
|
+
const count = Math.min(Math.max(o.count ?? 200, 1), 2000);
|
|
68
|
+
const notes = [];
|
|
69
|
+
o.onProgress?.('Reading people...');
|
|
70
|
+
const people = [];
|
|
71
|
+
for await (const d of pageSearch(t, ['identities'], o.query?.trim() || '*', { includeNested: false, max: count, fields: ['id', 'name', 'displayName', 'email', 'attributes', 'manager'] })) {
|
|
72
|
+
people.push(d);
|
|
73
|
+
if (people.length >= count)
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
o.onProgress?.(`Reading the accounts of ${people.length} people...`);
|
|
77
|
+
const accounts = new Map();
|
|
78
|
+
for (let i = 0; i < people.length; i += 50) {
|
|
79
|
+
const ids = people.slice(i, i + 50).map((p) => String(p['id']));
|
|
80
|
+
const filters = `identityId in (${ids.map((x) => JSON.stringify(x)).join(',')})`;
|
|
81
|
+
for await (const a of pageList(t, '/accounts/v1', { filters })) {
|
|
82
|
+
const id = String(a['identityId'] ?? a['identity']?.['id'] ?? '');
|
|
83
|
+
if (!ids.includes(id))
|
|
84
|
+
continue;
|
|
85
|
+
const list = accounts.get(id) ?? [];
|
|
86
|
+
list.push({ source: String(a['sourceName'] ?? a['source']?.['name'] ?? ''), sourceId: String(a['sourceId'] ?? a['source']?.['id'] ?? ''), nativeIdentity: a['nativeIdentity'], name: a['name'], created: a['created'], attributes: (a['attributes'] ?? {}) });
|
|
87
|
+
accounts.set(id, list);
|
|
88
|
+
}
|
|
89
|
+
o.onProgress?.(`Reading accounts... ${Math.min(i + 50, people.length)} of ${people.length} people`);
|
|
90
|
+
}
|
|
91
|
+
const engine = TransformEngine.fromList(o.transforms, o.now);
|
|
92
|
+
const rows = [];
|
|
93
|
+
const assumptions = new Set();
|
|
94
|
+
o.onProgress?.('Evaluating...');
|
|
95
|
+
for (const p of people) {
|
|
96
|
+
const id = String(p['id']);
|
|
97
|
+
const attrs = (p['attributes'] ?? {});
|
|
98
|
+
const input = identityInput(p, accounts.get(id) ?? []);
|
|
99
|
+
if (o.implicit) {
|
|
100
|
+
const imp = engine.run(o.implicit, input);
|
|
101
|
+
input.implicit = imp.value;
|
|
102
|
+
}
|
|
103
|
+
const r = engine.run(o.transform, input);
|
|
104
|
+
r.assumptions.forEach((x) => assumptions.add(x));
|
|
105
|
+
const current = o.attribute ? (attrs[o.attribute] ?? p[o.attribute]) : undefined;
|
|
106
|
+
const comparable = o.attribute && (r.status === 'ok');
|
|
107
|
+
rows.push({ person: String(p['displayName'] ?? p['name'] ?? id), id, current, result: r.value, status: r.status, error: r.error, same: comparable ? norm(r.value) === norm(current) : null });
|
|
108
|
+
}
|
|
109
|
+
const dist = new Map();
|
|
110
|
+
for (const r of rows)
|
|
111
|
+
if (r.status === 'ok' || r.status === 'random')
|
|
112
|
+
dist.set(norm(r.result) || '(empty)', (dist.get(norm(r.result) || '(empty)') ?? 0) + 1);
|
|
113
|
+
if (o.attribute && people.length && people.every((p) => (p['attributes'] ?? {})[o.attribute] === undefined && p[o.attribute] === undefined))
|
|
114
|
+
notes.push(`No one in the sample has the identity attribute "${o.attribute}" in search; check its system name.`);
|
|
115
|
+
return {
|
|
116
|
+
people: rows.length,
|
|
117
|
+
rows: rows.sort((a, b) => Number(a.same === true) - Number(b.same === true) || a.person.localeCompare(b.person)),
|
|
118
|
+
summary: {
|
|
119
|
+
same: rows.filter((r) => r.same === true).length,
|
|
120
|
+
different: rows.filter((r) => r.same === false).length,
|
|
121
|
+
empty: rows.filter((r) => r.status === 'ok' && empty(r.result)).length,
|
|
122
|
+
errors: rows.filter((r) => r.status === 'error').length,
|
|
123
|
+
iscOnly: rows.filter((r) => r.status === 'isc-only').length,
|
|
124
|
+
random: rows.filter((r) => r.status === 'random').length,
|
|
125
|
+
},
|
|
126
|
+
distinct: [...dist.entries()].map(([value, n]) => ({ value, people: n })).sort((a, b) => b.people - a.people).slice(0, 50),
|
|
127
|
+
assumptions: [...assumptions],
|
|
128
|
+
attribute: o.attribute,
|
|
129
|
+
notes,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=transform-people.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-people.js","sourceRoot":"","sources":["../../../src/core/lab/transform-people.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,E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AAG,WAAW,CAAC;QAC7B,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,KAAK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export type Value = string | number | boolean | null | Value[];
|
|
2
|
+
export interface LabAccount {
|
|
3
|
+
source: string;
|
|
4
|
+
sourceId?: string;
|
|
5
|
+
/** Account ID (nativeIdentity) and name, for accountFilter. */
|
|
6
|
+
nativeIdentity?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
created?: string;
|
|
9
|
+
attributes: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface LabInput {
|
|
12
|
+
/** Identity attributes (system names, e.g. firstname, lastname, email, uid). */
|
|
13
|
+
identity?: Record<string, unknown>;
|
|
14
|
+
/** The person's accounts with their attributes. */
|
|
15
|
+
accounts?: LabAccount[];
|
|
16
|
+
/** The manager's identity attributes, for getReferenceIdentityAttribute with uid "manager". */
|
|
17
|
+
manager?: Record<string, unknown>;
|
|
18
|
+
/** Other people by uid, for getReferenceIdentityAttribute. */
|
|
19
|
+
people?: Record<string, Record<string, unknown>>;
|
|
20
|
+
/** Implicit input: the source attribute value mapped in the identity profile. */
|
|
21
|
+
implicit?: unknown;
|
|
22
|
+
/** Previous value of the attribute ($oldValue). */
|
|
23
|
+
oldValue?: unknown;
|
|
24
|
+
}
|
|
25
|
+
export interface TraceStep {
|
|
26
|
+
depth: number;
|
|
27
|
+
type: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
input?: Value;
|
|
30
|
+
output?: Value;
|
|
31
|
+
note?: string;
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface EvalResult {
|
|
35
|
+
value: Value;
|
|
36
|
+
/** 'ok' | 'error' (ISC would fail too) | 'isc-only' (cannot be evaluated offline) | 'random' (differs every run) */
|
|
37
|
+
status: 'ok' | 'error' | 'isc-only' | 'random';
|
|
38
|
+
error?: string;
|
|
39
|
+
trace: TraceStep[];
|
|
40
|
+
/** Assumptions the engine made where SailPoint's documentation does not say. */
|
|
41
|
+
assumptions: string[];
|
|
42
|
+
}
|
|
43
|
+
export declare class TransformError extends Error {
|
|
44
|
+
constructor(msg: string);
|
|
45
|
+
}
|
|
46
|
+
type Def = {
|
|
47
|
+
type?: string;
|
|
48
|
+
name?: string;
|
|
49
|
+
id?: string;
|
|
50
|
+
attributes?: Record<string, unknown>;
|
|
51
|
+
};
|
|
52
|
+
export declare class TransformEngine {
|
|
53
|
+
private transforms;
|
|
54
|
+
private now;
|
|
55
|
+
private trace;
|
|
56
|
+
private assumptions;
|
|
57
|
+
private random;
|
|
58
|
+
private depth;
|
|
59
|
+
constructor(transforms: Map<string, Def>, now?: Date);
|
|
60
|
+
static fromList(list: Def[], now?: Date): TransformEngine;
|
|
61
|
+
run(def: unknown, input?: LabInput): EvalResult;
|
|
62
|
+
private evalAny;
|
|
63
|
+
private velocityCtx;
|
|
64
|
+
private render;
|
|
65
|
+
/** The transform's input: explicit attributes.input if set, else the implicit input. */
|
|
66
|
+
private inputOf;
|
|
67
|
+
/** Dynamic variables: attributes that are not reserved names, evaluated first. */
|
|
68
|
+
private variables;
|
|
69
|
+
private evalDef;
|
|
70
|
+
private apply;
|
|
71
|
+
private utility;
|
|
72
|
+
private accountAttribute;
|
|
73
|
+
}
|
|
74
|
+
export declare function dateMath(start: Date, expr: string, roundUp: boolean): Date;
|
|
75
|
+
/** sailpoint.object.Filter subset: (a == "x"), (a != "x"), a.startsWith("x"), a.containsAll({"x"}), &&, ||, !. */
|
|
76
|
+
export declare function matchFilter(expr: string, attrs: Record<string, unknown>): boolean;
|
|
77
|
+
/** nameNormalizer, following the documented rules. */
|
|
78
|
+
export declare function normalizeName(v: string): string;
|
|
79
|
+
export {};
|