identityscope 0.28.3 → 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.
Files changed (91) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +917 -917
  3. package/SECURITY.md +56 -56
  4. package/dist/node/cli.js +26 -26
  5. package/dist/node/monthly.js +17 -17
  6. package/package.json +2 -2
  7. package/reports/access-profile-members.yaml +29 -29
  8. package/reports/access-profile-membership-counts.yaml +17 -17
  9. package/reports/access-profiles-without-owner.yaml +16 -16
  10. package/reports/access-request-audit-trail.yaml +36 -36
  11. package/reports/accounts-by-source.yaml +19 -19
  12. package/reports/active-identities-without-manager.yaml +22 -22
  13. package/reports/aggregation-failures.yaml +29 -29
  14. package/reports/aggregation-history.yaml +27 -27
  15. package/reports/all-sources.yaml +16 -16
  16. package/reports/application-accounts.yaml +32 -32
  17. package/reports/application-entitlements.yaml +31 -31
  18. package/reports/campaign-progress.yaml +23 -23
  19. package/reports/certification-decisions.yaml +31 -31
  20. package/reports/direct-reports-per-manager.yaml +20 -20
  21. package/reports/disabled-accounts-of-active-people.yaml +33 -33
  22. package/reports/duplicate-emails.yaml +16 -16
  23. package/reports/entitlement-holders.yaml +35 -35
  24. package/reports/entitlements-held-by-inactive-identities.yaml +31 -31
  25. package/reports/entitlements-without-owner.yaml +28 -28
  26. package/reports/identities-by-lifecycle-state.yaml +15 -15
  27. package/reports/identities-missing-key-attributes.yaml +27 -27
  28. package/reports/identities-with-processing-errors.yaml +19 -19
  29. package/reports/identity-attribute-mappings.yaml +27 -27
  30. package/reports/machine-accounts.yaml +28 -28
  31. package/reports/managers-and-direct-reports.yaml +23 -23
  32. package/reports/most-access.yaml +18 -18
  33. package/reports/new-identities.yaml +24 -24
  34. package/reports/old-passwords.yaml +35 -35
  35. package/reports/pending-reviews-by-reviewer.yaml +20 -20
  36. package/reports/person-access.yaml +31 -31
  37. package/reports/privileged-access.yaml +29 -29
  38. package/reports/provisioning-error-causes.yaml +27 -27
  39. package/reports/provisioning-errors.yaml +32 -32
  40. package/reports/provisioning-failures.yaml +28 -28
  41. package/reports/recent-access-requests.yaml +22 -22
  42. package/reports/recent-activity.yaml +32 -32
  43. package/reports/recent-leavers.yaml +34 -34
  44. package/reports/role-members.yaml +29 -29
  45. package/reports/role-membership-counts.yaml +18 -18
  46. package/reports/roles-without-owner.yaml +17 -17
  47. package/reports/sources-needing-attention.yaml +23 -23
  48. package/reports/stuck-access-requests.yaml +29 -29
  49. package/reports/team-access.yaml +30 -30
  50. package/reports/terminated-users-with-active-accounts.yaml +46 -46
  51. package/reports/uncorrelated-accounts.yaml +38 -38
  52. package/ui/js/00-setup.js +6 -6
  53. package/ui/js/01-small-helpers.js +143 -143
  54. package/ui/js/02-connection.js +150 -150
  55. package/ui/js/03-health-check.js +17 -17
  56. package/ui/js/04-library.js +135 -135
  57. package/ui/js/05-pickers.js +163 -163
  58. package/ui/js/06-report-view.js +157 -157
  59. package/ui/js/07-fields.js +85 -85
  60. package/ui/js/08-designer.js +360 -360
  61. package/ui/js/09-yaml.js +22 -22
  62. package/ui/js/10-instant-check.js +171 -171
  63. package/ui/js/11-lookup.js +161 -161
  64. package/ui/js/12-tenant.js +115 -115
  65. package/ui/js/13-source-configuration-and-diagnostics.js +64 -64
  66. package/ui/js/14-certifications.js +68 -68
  67. package/ui/js/15-monthly-report.js +24 -24
  68. package/ui/js/16-ownership.js +39 -39
  69. package/ui/js/17-compare-tenants.js +102 -102
  70. package/ui/js/18-audit.js +181 -181
  71. package/ui/js/19-insights.js +108 -108
  72. package/ui/js/20-role-mining.js +35 -35
  73. package/ui/js/21-share-reports.js +45 -45
  74. package/ui/js/22-partner-overview-all-customer-tenants.js +228 -228
  75. package/ui/js/23-in-app-guidance.js +217 -217
  76. package/ui/js/24-role-tools.js +220 -220
  77. package/ui/js/25-schedules.js +264 -264
  78. package/ui/js/26-start.js +7 -7
  79. package/ui/js/27-warnings.js +224 -224
  80. package/ui/js/28-audit-readiness.js +99 -99
  81. package/ui/js/29-lifecycle.js +182 -182
  82. package/ui/js/30-labs.js +265 -265
  83. package/ui/js/31-build.js +203 -203
  84. package/ui/js/32-lab-examples.js +148 -148
  85. package/ui/js/33-finder.js +89 -89
  86. package/ui/js/34-governance.js +129 -129
  87. package/ui/js/35-watch.js +266 -266
  88. package/ui/js/36-model.js +247 -247
  89. package/ui/js/37-logs-and-watch.js +224 -224
  90. package/ui/shell.html +112 -112
  91. package/ui/style.css +350 -350
@@ -1,30 +1,30 @@
1
- id: team-access
2
- name: My team's access
3
- description: >-
4
- The access of everyone who reports to a manager, one row per person and access item. Give the
5
- manager's username or display name.
6
- category: People
7
- tags: [manager, review]
8
- params:
9
- manager:
10
- type: string
11
- description: Manager (username or display name)
12
- required: true
13
- from:
14
- dataset: identities
15
- query: "manager.name:${manager|q} OR manager.displayName:${manager|q}"
16
- where:
17
- any:
18
- - { field: identity.manager.name, op: eq, value: "${manager}" }
19
- - { field: identity.manager.displayName, op: eq, value: "${manager}" }
20
- expand:
21
- path: identity.access
22
- as: access
23
- columns:
24
- - { field: identity.displayName, label: Person }
25
- - { field: identity.attributes.cloudLifecycleState, label: Lifecycle state }
26
- - { field: access.type, label: Type }
27
- - { field: access.displayName, label: Access }
28
- - { field: access.source.name, label: Source }
29
- - { field: access.privileged, label: Privileged, format: boolean }
30
- sort: [identity.displayName, access.displayName]
1
+ id: team-access
2
+ name: My team's access
3
+ description: >-
4
+ The access of everyone who reports to a manager, one row per person and access item. Give the
5
+ manager's username or display name.
6
+ category: People
7
+ tags: [manager, review]
8
+ params:
9
+ manager:
10
+ type: string
11
+ description: Manager (username or display name)
12
+ required: true
13
+ from:
14
+ dataset: identities
15
+ query: "manager.name:${manager|q} OR manager.displayName:${manager|q}"
16
+ where:
17
+ any:
18
+ - { field: identity.manager.name, op: eq, value: "${manager}" }
19
+ - { field: identity.manager.displayName, op: eq, value: "${manager}" }
20
+ expand:
21
+ path: identity.access
22
+ as: access
23
+ columns:
24
+ - { field: identity.displayName, label: Person }
25
+ - { field: identity.attributes.cloudLifecycleState, label: Lifecycle state }
26
+ - { field: access.type, label: Type }
27
+ - { field: access.displayName, label: Access }
28
+ - { field: access.source.name, label: Source }
29
+ - { field: access.privileged, label: Privileged, format: boolean }
30
+ sort: [identity.displayName, access.displayName]
@@ -1,46 +1,46 @@
1
- id: terminated-users-with-active-accounts
2
- name: Terminated users with active accounts
3
- description: >-
4
- People who have left (inactive identity or a leaver lifecycle state) but still have enabled
5
- accounts on non-authoritative sources. Each row is one account that should probably be disabled.
6
- category: Lifecycle
7
- tags: [audit, leaver, sox]
8
- params:
9
- lifecycleStates:
10
- type: list
11
- description: Lifecycle states that mean the person has left
12
- default: [inactive, terminated]
13
- sources:
14
- type: list
15
- pick: sources
16
- description: Sources (leave empty for all)
17
- from:
18
- dataset: identities
19
- where:
20
- any:
21
- - { field: identity.inactive, op: isTrue }
22
- - { field: identity.attributes.cloudLifecycleState, op: in, value: "${lifecycleStates}" }
23
- expand:
24
- path: identity.accounts
25
- as: account
26
- where:
27
- all:
28
- - { field: account.disabled, op: isFalse }
29
- - { field: account.source.id, op: in, value: "${sources}" }
30
- joins:
31
- - dataset: sources
32
- as: source
33
- on: { field: account.source.id, equals: id }
34
- filter:
35
- { field: source.authoritative, op: isFalse }
36
- columns:
37
- - { field: identity.displayName, label: Person }
38
- - { field: identity.name, label: Username }
39
- - { field: identity.email, label: Email }
40
- - { field: identity.attributes.cloudLifecycleState, label: Lifecycle state }
41
- - { field: identity.manager.displayName, label: Manager }
42
- - { field: account.source.name, label: Source }
43
- - { field: account.name, label: Account }
44
- - { field: account.privileged, label: Privileged account, format: boolean }
45
- - { field: identity.modified, label: Identity last changed, format: date }
46
- sort: [account.source.name, identity.displayName]
1
+ id: terminated-users-with-active-accounts
2
+ name: Terminated users with active accounts
3
+ description: >-
4
+ People who have left (inactive identity or a leaver lifecycle state) but still have enabled
5
+ accounts on non-authoritative sources. Each row is one account that should probably be disabled.
6
+ category: Lifecycle
7
+ tags: [audit, leaver, sox]
8
+ params:
9
+ lifecycleStates:
10
+ type: list
11
+ description: Lifecycle states that mean the person has left
12
+ default: [inactive, terminated]
13
+ sources:
14
+ type: list
15
+ pick: sources
16
+ description: Sources (leave empty for all)
17
+ from:
18
+ dataset: identities
19
+ where:
20
+ any:
21
+ - { field: identity.inactive, op: isTrue }
22
+ - { field: identity.attributes.cloudLifecycleState, op: in, value: "${lifecycleStates}" }
23
+ expand:
24
+ path: identity.accounts
25
+ as: account
26
+ where:
27
+ all:
28
+ - { field: account.disabled, op: isFalse }
29
+ - { field: account.source.id, op: in, value: "${sources}" }
30
+ joins:
31
+ - dataset: sources
32
+ as: source
33
+ on: { field: account.source.id, equals: id }
34
+ filter:
35
+ { field: source.authoritative, op: isFalse }
36
+ columns:
37
+ - { field: identity.displayName, label: Person }
38
+ - { field: identity.name, label: Username }
39
+ - { field: identity.email, label: Email }
40
+ - { field: identity.attributes.cloudLifecycleState, label: Lifecycle state }
41
+ - { field: identity.manager.displayName, label: Manager }
42
+ - { field: account.source.name, label: Source }
43
+ - { field: account.name, label: Account }
44
+ - { field: account.privileged, label: Privileged account, format: boolean }
45
+ - { field: identity.modified, label: Identity last changed, format: date }
46
+ sort: [account.source.name, identity.displayName]
@@ -1,38 +1,38 @@
1
- id: uncorrelated-accounts
2
- name: Accounts not linked to any person
3
- description: >-
4
- Accounts that ISC could not correlate to an identity. They are not covered by certifications
5
- or leaver processing until someone links or removes them. Pick one or more sources to read only
6
- those (much faster on large tenants).
7
- category: Hygiene
8
- tags: [audit, orphan]
9
- params:
10
- sources:
11
- type: list
12
- pick: sources
13
- description: Sources (leave empty for all)
14
- from:
15
- dataset: accounts
16
- filter:
17
- - uncorrelated eq true
18
- - sourceId in ${sources|list}
19
- where:
20
- all:
21
- # Checked again here, so the report never depends on ISC applying the filter.
22
- - { field: account.uncorrelated, op: isTrue }
23
- - { field: account.sourceId, op: in, value: "${sources}" }
24
- joins:
25
- - dataset: sources
26
- as: source
27
- on: { field: account.sourceId, equals: id }
28
- columns:
29
- - { field: account.sourceName, label: Source }
30
- - { field: account.name, label: Account }
31
- - { field: account.nativeIdentity, label: Native identity }
32
- - { field: account.uncorrelated, label: Uncorrelated, format: boolean }
33
- - { field: account.disabled, label: Disabled, format: boolean }
34
- - { field: account.hasEntitlements, label: Has entitlements, format: boolean }
35
- - { field: account.isMachine, label: Machine account, format: boolean }
36
- - { field: source.owner.name, label: Source owner }
37
- - { field: account.created, label: First seen, format: date }
38
- sort: [account.sourceName, account.name]
1
+ id: uncorrelated-accounts
2
+ name: Accounts not linked to any person
3
+ description: >-
4
+ Accounts that ISC could not correlate to an identity. They are not covered by certifications
5
+ or leaver processing until someone links or removes them. Pick one or more sources to read only
6
+ those (much faster on large tenants).
7
+ category: Hygiene
8
+ tags: [audit, orphan]
9
+ params:
10
+ sources:
11
+ type: list
12
+ pick: sources
13
+ description: Sources (leave empty for all)
14
+ from:
15
+ dataset: accounts
16
+ filter:
17
+ - uncorrelated eq true
18
+ - sourceId in ${sources|list}
19
+ where:
20
+ all:
21
+ # Checked again here, so the report never depends on ISC applying the filter.
22
+ - { field: account.uncorrelated, op: isTrue }
23
+ - { field: account.sourceId, op: in, value: "${sources}" }
24
+ joins:
25
+ - dataset: sources
26
+ as: source
27
+ on: { field: account.sourceId, equals: id }
28
+ columns:
29
+ - { field: account.sourceName, label: Source }
30
+ - { field: account.name, label: Account }
31
+ - { field: account.nativeIdentity, label: Native identity }
32
+ - { field: account.uncorrelated, label: Uncorrelated, format: boolean }
33
+ - { field: account.disabled, label: Disabled, format: boolean }
34
+ - { field: account.hasEntitlements, label: Has entitlements, format: boolean }
35
+ - { field: account.isMachine, label: Machine account, format: boolean }
36
+ - { field: source.owner.name, label: Source owner }
37
+ - { field: account.created, label: First seen, format: date }
38
+ sort: [account.sourceName, account.name]
package/ui/js/00-setup.js CHANGED
@@ -1,6 +1,6 @@
1
- var hash = new URLSearchParams(location.hash.slice(1));
2
- var KEY = hash.get('k') || sessionStorage.getItem('isc-reports-key') || '';
3
- if (hash.get('k')) { sessionStorage.setItem('isc-reports-key', KEY); history.replaceState(null, '', location.pathname); }
4
-
5
- var state = { reports: [], catalog: null, current: null, tab: 'run', job: null, result: null, dirty: false, picks: {}, disc: {}, homeCat: '' };
6
-
1
+ var hash = new URLSearchParams(location.hash.slice(1));
2
+ var KEY = hash.get('k') || sessionStorage.getItem('isc-reports-key') || '';
3
+ if (hash.get('k')) { sessionStorage.setItem('isc-reports-key', KEY); history.replaceState(null, '', location.pathname); }
4
+
5
+ var state = { reports: [], catalog: null, current: null, tab: 'run', job: null, result: null, dirty: false, picks: {}, disc: {}, homeCat: '' };
6
+
@@ -1,143 +1,143 @@
1
- // ---------- small helpers ----------
2
- function $(id) { return document.getElementById(id); }
3
- function el(tag, attrs) {
4
- var e = document.createElement(tag);
5
- if (attrs) for (var k in attrs) {
6
- var v = attrs[k];
7
- if (v === undefined || v === null || v === false) continue;
8
- if (k === 'text') e.textContent = v;
9
- else if (k === 'className') e.className = v;
10
- else if (k.slice(0, 2) === 'on') e.addEventListener(k.slice(2), v);
11
- else if (k === 'value') e.value = v;
12
- else if (k === 'checked') e.checked = !!v;
13
- else e.setAttribute(k, v === true ? '' : v);
14
- }
15
- for (var i = 2; i < arguments.length; i++) add(e, arguments[i]);
16
- return e;
17
- }
18
- function add(e, c) {
19
- if (c === null || c === undefined || c === false) return;
20
- if (Array.isArray(c)) c.forEach(function (x) { add(e, x); });
21
- else e.appendChild(typeof c === 'string' ? document.createTextNode(c) : c);
22
- }
23
- function clone(x) { return JSON.parse(JSON.stringify(x)); }
24
- var ICONS = {
25
- people: 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 20c0-3.5 3.6-6 8-6s8 2.5 8 6',
26
- lifecycle: 'M4 12a8 8 0 0 1 14-5.3L20 9M20 4v5h-5M20 12a8 8 0 0 1-14 5.3L4 15M4 20v-5h5',
27
- shield: 'M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6zM8.5 12l2.5 2.5 4.5-5',
28
- layers: 'M12 3l9 5-9 5-9-5zM3 13l9 5 9-5',
29
- apps: 'M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z',
30
- cert: 'M9 3h6v3H9zM7 4.5H5V21h14V4.5h-2M9 13.5l2 2 4-4',
31
- inbox: 'M4 13h4l2 3h4l2-3h4M4 13l3-8h10l3 8v6H4z',
32
- pulse: 'M3 12h4l3-7 4 14 3-7h4',
33
- file: 'M6 3h9l4 4v14H6zM14 3v5h5M9 13h7M9 17h5',
34
- search: 'M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM21 21l-5-5',
35
- download: 'M12 4v11M7 10l5 5 5-5M5 20h14',
36
- play: 'M7 5l12 7-12 7z',
37
- plus: 'M12 5v14M5 12h14',
38
- x: 'M6 6l12 12M18 6L6 18',
39
- chev: 'M6 9l6 6 6-6',
40
- clock: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2',
41
- up: 'M12 19V5M6 11l6-6 6 6',
42
- down: 'M12 5v14M6 13l6 6 6-6',
43
- trash: 'M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13',
44
- logout: 'M15 4h4v16h-4M10 8l-4 4 4 4M6 12h10',
45
- eye: 'M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z',
46
- save: 'M5 3h11l3 3v15H5zM8 3v5h7M8 14h8v7H8z',
47
- filter: 'M4 5h16l-6 7v6l-4 2v-8z',
48
- cols: 'M4 4h16v16H4zM10 4v16M16 4v16',
49
- sigma: 'M18 5H6l6 7-6 7h12',
50
- sort: 'M7 4v16M3 16l4 4 4-4M17 20V4M13 8l4-4 4 4',
51
- db: 'M12 8c4.4 0 8-1.3 8-3s-3.6-3-8-3-8 1.3-8 3 3.6 3 8 3zM4 5v14c0 1.7 3.6 3 8 3s8-1.3 8-3V5M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3',
52
- grid: 'M4 4h16v16H4zM4 10h16M4 16h16M10 4v16',
53
- code: 'M8 8l-4 4 4 4M16 8l4 4-4 4M14 5l-4 14',
54
- sliders: 'M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0M14 4v4M8 10v4M16 16v4',
55
- copy: 'M8 8h12v12H8zM4 16V4h12',
56
- heart: 'M3 12h4l2-4 3 8 2-4h7'
57
- };
58
- function icon(name, cls) {
59
- var NS = 'http://www.w3.org/2000/svg';
60
- var s = document.createElementNS(NS, 'svg');
61
- s.setAttribute('viewBox', '0 0 24 24');
62
- s.setAttribute('class', 'i' + (cls ? ' ' + cls : ''));
63
- s.setAttribute('aria-hidden', 'true');
64
- var p = document.createElementNS(NS, 'path');
65
- p.setAttribute('d', ICONS[name] || ICONS.file);
66
- if (name === 'play') { p.setAttribute('fill', 'currentColor'); }
67
- s.appendChild(p);
68
- return s;
69
- }
70
- var CATS = {
71
- 'People': ['people', '#2457d6', '#eaf0fd'],
72
- 'Lifecycle': ['lifecycle', '#7c3aed', '#f1ebfe'],
73
- 'Hygiene': ['shield', '#0e7c66', '#e3f5f0'],
74
- 'Access model': ['layers', '#b45309', '#fdf1e2'],
75
- 'Application owners': ['apps', '#0369a1', '#e2f1fa'],
76
- 'Certifications': ['cert', '#be185d', '#fce8f1'],
77
- 'Requests': ['inbox', '#4d7c0f', '#eef6df'],
78
- 'Operations': ['pulse', '#b91c1c', '#fdeaea'],
79
- 'Configuration': ['sliders', '#0f766e', '#e0f4f1'],
80
- 'My reports': ['file', '#334155', '#eef1f5']
81
- };
82
- var CAT_ORDER = ['My reports', 'People', 'Lifecycle', 'Hygiene', 'Operations', 'Access model', 'Application owners', 'Certifications', 'Requests', 'Configuration'];
83
- function catOf(r) { return r.custom ? 'My reports' : (r.definition.category || 'Other'); }
84
- function catIcon(cat) {
85
- var c = CATS[cat] || ['file', '#334155', '#eef1f5'];
86
- return el('span', { className: 'cat-ico', style: 'color:' + c[1] + ';background:' + c[2] }, icon(c[0]));
87
- }
88
- var POPULAR = ['provisioning-errors', 'aggregation-failures', 'uncorrelated-accounts', 'terminated-users-with-active-accounts', 'person-access', 'application-accounts', 'identity-attribute-mappings', 'privileged-access', 'new-identities'];
89
-
90
- function api(path, method, body) {
91
- return fetch(path, {
92
- method: method || 'GET',
93
- headers: Object.assign({ 'x-isc-reports-key': KEY }, body ? { 'content-type': 'application/json' } : {}),
94
- body: body ? JSON.stringify(body) : undefined
95
- }).then(function (res) {
96
- var n = res.headers.get('x-isc-api-calls');
97
- if (n !== null && $('calls')) $('calls').textContent = Number(n).toLocaleString('en-US');
98
- return res.json().catch(function () { return {}; }).then(function (data) {
99
- if (!res.ok) {
100
- var err = new Error(data.error || ('Request failed (' + res.status + ')'));
101
- err.problems = data.problems || [];
102
- err.data = data;
103
- throw err;
104
- }
105
- return data;
106
- });
107
- });
108
- }
109
- var NOT_ANSWERING = 'IdentityScope on this computer is not answering. If its window was closed or shows an error, start it again and reload this page.';
110
- function errorText(e) { if (e && e.name === 'TypeError' && /fetch|network|load failed/i.test(e.message || '')) return NOT_ANSWERING; return e.message + (e.problems && e.problems.length ? '\n- ' + e.problems.join('\n- ') : ''); }
111
- var toastTimer;
112
- function toast(text) {
113
- var t = $('toast');
114
- t.textContent = text;
115
- t.classList.remove('hidden');
116
- clearTimeout(toastTimer);
117
- toastTimer = setTimeout(function () { t.classList.add('hidden'); }, 2600);
118
- }
119
- function fmtNum(n) { return Number(n).toLocaleString('en-US'); }
120
-
121
- // static icons in the page frame
122
- add($('nav-reports'), [icon('grid'), 'Reports']);
123
- add($('nav-schedules'), [icon('clock'), 'Schedules']);
124
- add($('nav-roles'), [icon('layers'), 'Role tools']);
125
- add($('nav-checks'), [icon('pulse'), 'Instant check']);
126
- add($('nav-warnings'), [icon('clock'), 'Warnings']);
127
- add($('nav-nerm'), [icon('people'), 'Non-employees']);
128
- add($('nav-logs'), [icon('file'), 'Logs']);
129
- add($('nav-lookup'), [icon('search'), 'Lookup']);
130
- add($('nav-tenant'), [icon('db'), 'Tenant']);
131
- add($('nav-build'), [icon('code'), 'Build & test']);
132
- add($('nav-certs'), [icon('cert'), 'Audit']);
133
- add($('nav-monthly'), [icon('sigma'), 'Insights']);
134
- add($('btn-doctor'), [icon('heart'), 'Health check']);
135
- add($('btn-help'), ['? Help']);
136
- add($('btn-partner-nav'), [icon('db'), 'All tenants']);
137
- $('btn-partner-nav').addEventListener('click', function () { showPartner(); });
138
- $('btn-partner').addEventListener('click', function () { showPartner(); });
139
- $('btn-help').addEventListener('click', function () { openHelp(); });
140
- add($('btn-disconnect'), [icon('logout'), 'Disconnect']);
141
- add($('btn-new'), [icon('plus'), 'New report']);
142
- add($('search-ico'), icon('search'));
143
-
1
+ // ---------- small helpers ----------
2
+ function $(id) { return document.getElementById(id); }
3
+ function el(tag, attrs) {
4
+ var e = document.createElement(tag);
5
+ if (attrs) for (var k in attrs) {
6
+ var v = attrs[k];
7
+ if (v === undefined || v === null || v === false) continue;
8
+ if (k === 'text') e.textContent = v;
9
+ else if (k === 'className') e.className = v;
10
+ else if (k.slice(0, 2) === 'on') e.addEventListener(k.slice(2), v);
11
+ else if (k === 'value') e.value = v;
12
+ else if (k === 'checked') e.checked = !!v;
13
+ else e.setAttribute(k, v === true ? '' : v);
14
+ }
15
+ for (var i = 2; i < arguments.length; i++) add(e, arguments[i]);
16
+ return e;
17
+ }
18
+ function add(e, c) {
19
+ if (c === null || c === undefined || c === false) return;
20
+ if (Array.isArray(c)) c.forEach(function (x) { add(e, x); });
21
+ else e.appendChild(typeof c === 'string' ? document.createTextNode(c) : c);
22
+ }
23
+ function clone(x) { return JSON.parse(JSON.stringify(x)); }
24
+ var ICONS = {
25
+ people: 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 20c0-3.5 3.6-6 8-6s8 2.5 8 6',
26
+ lifecycle: 'M4 12a8 8 0 0 1 14-5.3L20 9M20 4v5h-5M20 12a8 8 0 0 1-14 5.3L4 15M4 20v-5h5',
27
+ shield: 'M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6zM8.5 12l2.5 2.5 4.5-5',
28
+ layers: 'M12 3l9 5-9 5-9-5zM3 13l9 5 9-5',
29
+ apps: 'M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z',
30
+ cert: 'M9 3h6v3H9zM7 4.5H5V21h14V4.5h-2M9 13.5l2 2 4-4',
31
+ inbox: 'M4 13h4l2 3h4l2-3h4M4 13l3-8h10l3 8v6H4z',
32
+ pulse: 'M3 12h4l3-7 4 14 3-7h4',
33
+ file: 'M6 3h9l4 4v14H6zM14 3v5h5M9 13h7M9 17h5',
34
+ search: 'M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM21 21l-5-5',
35
+ download: 'M12 4v11M7 10l5 5 5-5M5 20h14',
36
+ play: 'M7 5l12 7-12 7z',
37
+ plus: 'M12 5v14M5 12h14',
38
+ x: 'M6 6l12 12M18 6L6 18',
39
+ chev: 'M6 9l6 6 6-6',
40
+ clock: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2',
41
+ up: 'M12 19V5M6 11l6-6 6 6',
42
+ down: 'M12 5v14M6 13l6 6 6-6',
43
+ trash: 'M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13',
44
+ logout: 'M15 4h4v16h-4M10 8l-4 4 4 4M6 12h10',
45
+ eye: 'M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z',
46
+ save: 'M5 3h11l3 3v15H5zM8 3v5h7M8 14h8v7H8z',
47
+ filter: 'M4 5h16l-6 7v6l-4 2v-8z',
48
+ cols: 'M4 4h16v16H4zM10 4v16M16 4v16',
49
+ sigma: 'M18 5H6l6 7-6 7h12',
50
+ sort: 'M7 4v16M3 16l4 4 4-4M17 20V4M13 8l4-4 4 4',
51
+ db: 'M12 8c4.4 0 8-1.3 8-3s-3.6-3-8-3-8 1.3-8 3 3.6 3 8 3zM4 5v14c0 1.7 3.6 3 8 3s8-1.3 8-3V5M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3',
52
+ grid: 'M4 4h16v16H4zM4 10h16M4 16h16M10 4v16',
53
+ code: 'M8 8l-4 4 4 4M16 8l4 4-4 4M14 5l-4 14',
54
+ sliders: 'M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0M14 4v4M8 10v4M16 16v4',
55
+ copy: 'M8 8h12v12H8zM4 16V4h12',
56
+ heart: 'M3 12h4l2-4 3 8 2-4h7'
57
+ };
58
+ function icon(name, cls) {
59
+ var NS = 'http://www.w3.org/2000/svg';
60
+ var s = document.createElementNS(NS, 'svg');
61
+ s.setAttribute('viewBox', '0 0 24 24');
62
+ s.setAttribute('class', 'i' + (cls ? ' ' + cls : ''));
63
+ s.setAttribute('aria-hidden', 'true');
64
+ var p = document.createElementNS(NS, 'path');
65
+ p.setAttribute('d', ICONS[name] || ICONS.file);
66
+ if (name === 'play') { p.setAttribute('fill', 'currentColor'); }
67
+ s.appendChild(p);
68
+ return s;
69
+ }
70
+ var CATS = {
71
+ 'People': ['people', '#2457d6', '#eaf0fd'],
72
+ 'Lifecycle': ['lifecycle', '#7c3aed', '#f1ebfe'],
73
+ 'Hygiene': ['shield', '#0e7c66', '#e3f5f0'],
74
+ 'Access model': ['layers', '#b45309', '#fdf1e2'],
75
+ 'Application owners': ['apps', '#0369a1', '#e2f1fa'],
76
+ 'Certifications': ['cert', '#be185d', '#fce8f1'],
77
+ 'Requests': ['inbox', '#4d7c0f', '#eef6df'],
78
+ 'Operations': ['pulse', '#b91c1c', '#fdeaea'],
79
+ 'Configuration': ['sliders', '#0f766e', '#e0f4f1'],
80
+ 'My reports': ['file', '#334155', '#eef1f5']
81
+ };
82
+ var CAT_ORDER = ['My reports', 'People', 'Lifecycle', 'Hygiene', 'Operations', 'Access model', 'Application owners', 'Certifications', 'Requests', 'Configuration'];
83
+ function catOf(r) { return r.custom ? 'My reports' : (r.definition.category || 'Other'); }
84
+ function catIcon(cat) {
85
+ var c = CATS[cat] || ['file', '#334155', '#eef1f5'];
86
+ return el('span', { className: 'cat-ico', style: 'color:' + c[1] + ';background:' + c[2] }, icon(c[0]));
87
+ }
88
+ var POPULAR = ['provisioning-errors', 'aggregation-failures', 'uncorrelated-accounts', 'terminated-users-with-active-accounts', 'person-access', 'application-accounts', 'identity-attribute-mappings', 'privileged-access', 'new-identities'];
89
+
90
+ function api(path, method, body) {
91
+ return fetch(path, {
92
+ method: method || 'GET',
93
+ headers: Object.assign({ 'x-isc-reports-key': KEY }, body ? { 'content-type': 'application/json' } : {}),
94
+ body: body ? JSON.stringify(body) : undefined
95
+ }).then(function (res) {
96
+ var n = res.headers.get('x-isc-api-calls');
97
+ if (n !== null && $('calls')) $('calls').textContent = Number(n).toLocaleString('en-US');
98
+ return res.json().catch(function () { return {}; }).then(function (data) {
99
+ if (!res.ok) {
100
+ var err = new Error(data.error || ('Request failed (' + res.status + ')'));
101
+ err.problems = data.problems || [];
102
+ err.data = data;
103
+ throw err;
104
+ }
105
+ return data;
106
+ });
107
+ });
108
+ }
109
+ var NOT_ANSWERING = 'IdentityScope on this computer is not answering. If its window was closed or shows an error, start it again and reload this page.';
110
+ function errorText(e) { if (e && e.name === 'TypeError' && /fetch|network|load failed/i.test(e.message || '')) return NOT_ANSWERING; return e.message + (e.problems && e.problems.length ? '\n- ' + e.problems.join('\n- ') : ''); }
111
+ var toastTimer;
112
+ function toast(text) {
113
+ var t = $('toast');
114
+ t.textContent = text;
115
+ t.classList.remove('hidden');
116
+ clearTimeout(toastTimer);
117
+ toastTimer = setTimeout(function () { t.classList.add('hidden'); }, 2600);
118
+ }
119
+ function fmtNum(n) { return Number(n).toLocaleString('en-US'); }
120
+
121
+ // static icons in the page frame
122
+ add($('nav-reports'), [icon('grid'), 'Reports']);
123
+ add($('nav-schedules'), [icon('clock'), 'Schedules']);
124
+ add($('nav-roles'), [icon('layers'), 'Role tools']);
125
+ add($('nav-checks'), [icon('pulse'), 'Instant check']);
126
+ add($('nav-warnings'), [icon('clock'), 'Warnings']);
127
+ add($('nav-nerm'), [icon('people'), 'Non-employees']);
128
+ add($('nav-logs'), [icon('file'), 'Logs']);
129
+ add($('nav-lookup'), [icon('search'), 'Lookup']);
130
+ add($('nav-tenant'), [icon('db'), 'Tenant']);
131
+ add($('nav-build'), [icon('code'), 'Build & test']);
132
+ add($('nav-certs'), [icon('cert'), 'Audit']);
133
+ add($('nav-monthly'), [icon('sigma'), 'Insights']);
134
+ add($('btn-doctor'), [icon('heart'), 'Health check']);
135
+ add($('btn-help'), ['? Help']);
136
+ add($('btn-partner-nav'), [icon('db'), 'All tenants']);
137
+ $('btn-partner-nav').addEventListener('click', function () { showPartner(); });
138
+ $('btn-partner').addEventListener('click', function () { showPartner(); });
139
+ $('btn-help').addEventListener('click', function () { openHelp(); });
140
+ add($('btn-disconnect'), [icon('logout'), 'Disconnect']);
141
+ add($('btn-new'), [icon('plus'), 'New report']);
142
+ add($('search-ico'), icon('search'));
143
+