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,224 +1,224 @@
1
- // ---------- 0.27.0: Logs page; privileged access gained, accounts created outside ISC, sensitive changes, risk by person; joiner and leaver preview; stuck requests ----------
2
- function lgState() {
3
- if (!state.lg) {
4
- var saved = '';
5
- try { saved = localStorage.getItem('identityscope.logpath') || ''; } catch (e) { saved = ''; }
6
- state.lg = { tab: 'ccg', ccg: { path: saved, level: 'WARN', source: '', text: '', from: '', to: '', open: {} }, isc: { days: 2, source: '', failedOnly: true } };
7
- }
8
- return state.lg;
9
- }
10
- var LG_TABS = [
11
- ['ccg', 'Connector log (ccg.log)', 'file', 'Read the connector log of a Virtual Appliance from a copy on this computer: errors grouped and counted, per source, with the full error detail.'],
12
- ['isc', 'What ISC recorded', 'pulse', 'One timeline per source of what ISC itself recorded: aggregations, source changes, provisioning that ended with an error, and the state of the Virtual Appliances.']
13
- ];
14
- function tw() {
15
- if (!state.tw) state.tw = { priv: { remember: true }, outacct: { days: 7 }, sensitive: { days: 7 }, risk: { days: 7 }, upcoming: { days: 14, startDateAttribute: '', endDateAttribute: '', query: '' }, stuckreq: { hours: 24 } };
16
- return state.tw;
17
- }
18
- function renderLogs() {
19
- var L = lgState();
20
- var outer = $('logs');
21
- outer.textContent = '';
22
- var w = el('div', { className: 'wrap', style: 'max-width:1240px' });
23
- outer.appendChild(w);
24
- w.appendChild(el('div', { className: 'rhead', style: 'margin-bottom:4px' }, el('span', { className: 'cat-ico', style: 'color:#1d4ed8;background:#dbeafe' }, icon('file')),
25
- el('div', {}, el('h2', { text: 'Logs' }), el('p', { className: 'desc', text: 'Find out why a source failed without signing in to a server. Read-only; nothing from a log is stored or sent anywhere.' }))));
26
- var tabs = el('div', { className: 'tabs', style: 'flex-wrap:wrap' });
27
- LG_TABS.forEach(function (t) { tabs.appendChild(el('button', { className: 'tab' + (L.tab === t[0] ? ' active' : ''), onclick: function () { L.tab = t[0]; renderLogs(); } }, icon(t[2]), t[1])); });
28
- w.appendChild(tabs);
29
- var spec = LG_TABS.filter(function (t) { return t[0] === L.tab; })[0];
30
- if (L.tab === 'ccg') lgCcg(w, L.ccg, spec[3]); else lgIsc(w, L.isc, spec[3]);
31
- }
32
- function lgField(H, key, label, placeholder, width, type) {
33
- var i = el('input', { className: 'input', value: H[key] || '', placeholder: placeholder || '', style: 'max-width:' + (width || 200) + 'px', 'aria-label': label, type: type || 'text' });
34
- i.addEventListener('input', function () { H[key] = i.value; });
35
- return el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: label }), i);
36
- }
37
- function lgFilter(H) { return { level: H.level, source: H.source || undefined, text: H.text || undefined, from: H.from || undefined, to: H.to || undefined }; }
38
- function lgCcg(w, H, desc) {
39
- w.appendChild(el('p', { className: 'muted', style: 'margin:0 0 10px', text: desc }));
40
- w.appendChild(el('div', { className: 'note', text: 'ISC has no way to hand out ccg.log, so IdentityScope reads a copy: copy the file from the Virtual Appliance (/home/sailpoint/log/ccg.log) to this computer or a shared folder once, then give its path here or choose the file. A folder reads every log file in it, rotated and .gz files included.' }));
41
- var path = el('input', { className: 'input', value: H.path || '', placeholder: 'C:\\logs\\ccg.log or /home/me/va-logs', style: 'min-width:320px;flex:1', 'aria-label': 'Path of ccg.log or its folder on this computer' });
42
- path.addEventListener('input', function () { H.path = path.value; });
43
- var picker = el('input', { type: 'file', className: 'hidden', 'aria-label': 'Choose a log file', accept: '.log,.txt,.json,.jsonl,.gz,*/*' });
44
- var run = function () {
45
- try { localStorage.setItem('identityscope.logpath', H.path || ''); } catch (e) { /* not kept */ }
46
- H.open = {};
47
- runJobInto(H, '/api/logs/ccg/run', Object.assign({ path: H.path }, lgFilter(H)), renderLogs);
48
- };
49
- picker.addEventListener('change', function () {
50
- var f = picker.files && picker.files[0];
51
- if (!f) return;
52
- var q = lgFilter(H); q.name = f.name;
53
- var qs = Object.keys(q).filter(function (k) { return q[k]; }).map(function (k) { return k + '=' + encodeURIComponent(q[k]); }).join('&');
54
- H.busy = 'Reading ' + f.name + ' (' + fmtNum(Math.round(f.size / 1048576)) + ' MB)...'; H.error = null; H.data = null; H.open = {}; renderLogs();
55
- fetch('/api/logs/ccg/upload?' + qs, { method: 'POST', headers: { 'x-isc-reports-key': KEY, 'content-type': 'application/octet-stream' }, body: f }).then(function (res) {
56
- return res.json().then(function (d) { if (!res.ok) throw new Error(d.error || 'The file could not be read.'); return d; });
57
- }).then(function (r) {
58
- H.job = r.job;
59
- pollJob(r.job, function (m) { H.busy = m; renderLogs(); }, function (s) { H.busy = null; H.data = s.extra; renderLogs(); }, function (e) { H.busy = null; H.error = e; renderLogs(); });
60
- }, function (e) { H.busy = null; H.error = errorText(e); renderLogs(); });
61
- });
62
- var level = el('select', { className: 'input', style: 'width:auto', 'aria-label': 'Which lines' }, [['ERROR', 'Errors only'], ['WARN', 'Errors and warnings'], ['INFO', 'Everything but debug'], ['DEBUG', 'Everything']].map(function (o) { return el('option', { value: o[0], text: o[1] }); }));
63
- level.value = H.level;
64
- level.addEventListener('change', function () { H.level = level.value; });
65
- w.appendChild(el('div', { className: 'card', style: 'padding:12px 16px' },
66
- el('div', { className: 'bar' }, el('label', { className: 'field', style: 'margin:0;flex:1;min-width:320px' }, el('span', { className: 'lbl', text: 'File or folder on this computer' }), path),
67
- el('button', { className: 'btn primary', disabled: !!H.busy || !(H.path || '').trim(), onclick: run }, icon('play'), H.data ? 'Read again' : 'Read the log'),
68
- el('span', { className: 'muted small', text: 'or' }),
69
- el('button', { className: 'btn', disabled: !!H.busy, onclick: function () { picker.click(); } }, icon('file'), 'Choose a file'), picker),
70
- el('div', { className: 'bar', style: 'margin-top:10px' },
71
- el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Lines' }), level),
72
- lgField(H, 'source', 'Source name contains', 'e.g. Active Directory', 200),
73
- lgField(H, 'text', 'Message contains', 'e.g. timeout', 180),
74
- lgField(H, 'from', 'From', '', 200, 'datetime-local'),
75
- lgField(H, 'to', 'To', '', 200, 'datetime-local'))));
76
- // The path field must be enabled as soon as something is typed.
77
- path.addEventListener('input', function () { var b = w.querySelector('button.primary'); if (b) b.disabled = !!H.busy || !path.value.trim(); });
78
- if (H.busy) { w.appendChild(busyBox(H.busy)); return; }
79
- if (H.error) { w.appendChild(el('div', { className: 'error', text: H.error })); return; }
80
- if (!H.data) return;
81
- var d = H.data, T = d.totals;
82
- (d.notes || []).forEach(function (n) { w.appendChild(el('div', { className: 'note', text: n })); });
83
- w.appendChild(el('div', { className: 'bigstats' }, stat(T.lines, 'lines in the file'), stat(T.matched, 'lines kept by the filter'), stat(T.errors, 'errors', 'lose'), stat(T.warnings, 'warnings', 'lose'), stat(T.groups, 'different errors and warnings'), stat(d.bySource.length, 'sources')));
84
- if (T.first) w.appendChild(el('p', { className: 'muted small', style: 'margin:-4px 0 12px', text: 'From ' + when16(T.first) + ' to ' + when16(T.last) + ' (times as written in the log, UTC). ' + (d.files || []).length + ' file' + ((d.files || []).length === 1 ? '' : 's') + ' read.' }));
85
- if (d.byHour.length > 1) {
86
- var max = Math.max.apply(null, d.byHour.map(function (h) { return h.errors + h.warnings; })) || 1;
87
- var strip = el('div', { style: 'display:flex;align-items:flex-end;gap:2px;height:64px;margin:4px 0 6px', role: 'img', 'aria-label': 'Errors and warnings per hour' });
88
- d.byHour.forEach(function (h) {
89
- var n = h.errors + h.warnings;
90
- strip.appendChild(el('div', { title: h.hour.replace('T', ' ') + ':00 ' + h.errors + ' errors, ' + h.warnings + ' warnings', style: 'flex:1;min-width:2px;max-width:18px;height:' + Math.max(2, Math.round(n * 60 / max)) + 'px;background:' + (h.errors ? '#dc2626' : n ? '#d97706' : '#e5e7eb') }));
91
- });
92
- w.appendChild(section('Errors and warnings per hour', d.byHour.length, el('div', {}, strip, el('div', { className: 'muted small', style: 'display:flex;justify-content:space-between' }, el('span', { text: d.byHour[0].hour.replace('T', ' ') + ':00' }), el('span', { text: d.byHour[d.byHour.length - 1].hour.replace('T', ' ') + ':00' })))));
93
- }
94
- if (d.bySource.length) w.appendChild(section('Per source', d.bySource.length, simpleTable(['Source', 'Type', 'Lines', 'Errors', 'Warnings', 'Last error', 'At'], d.bySource.map(function (r) {
95
- return [r.source, r.type, fmtNum(r.lines), r.errors ? pill(fmtNum(r.errors), 'lose') : '0', fmtNum(r.warnings), el('span', { className: 'small', text: r.lastError || '' }), when16(r.lastErrorAt)];
96
- }), 'Per source')));
97
- if (d.groups.length) {
98
- w.appendChild(section('Errors and warnings, repeats counted once', d.groups.length + (d.moreGroups || 0), filteredTable(H, d.groups, ['Level', 'Source', 'Operation', 'Times', 'First', 'Last', 'Message'], function (g) {
99
- var key = g.level + '|' + g.source + '|' + g.operation + '|' + g.pattern;
100
- var detail = el('div', { className: H.open[key] ? '' : 'hidden' }, el('pre', { className: 'small', style: 'white-space:pre-wrap;word-break:break-word;margin:6px 0 0;max-height:320px;overflow:auto', text: g.example + (g.exception ? '\n\n' + g.exception : '') }), g.logger ? el('div', { className: 'muted small', text: 'Logger: ' + g.logger }) : null);
101
- var btn = el('button', { className: 'linkbtn small', 'aria-expanded': String(!!H.open[key]), onclick: function () { H.open[key] = !H.open[key]; detail.classList.toggle('hidden', !H.open[key]); btn.setAttribute('aria-expanded', String(!!H.open[key])); btn.textContent = H.open[key] ? 'Hide detail' : 'Show detail'; } }, H.open[key] ? 'Hide detail' : 'Show detail');
102
- return [(/ERR|FATAL/.test(g.level) ? pill(g.level, 'lose') : el('span', { style: 'color:#92400e;font-weight:600', text: g.level })), g.source, g.operation, fmtNum(g.count), when16(g.first), when16(g.last), el('div', {}, el('div', { className: 'small', text: g.example.slice(0, 260) + (g.example.length > 260 ? '…' : '') }), btn, detail)];
103
- }, 'Errors and warnings')));
104
- } else w.appendChild(el('p', { className: 'muted', text: T.read ? 'No errors or warnings in what the filter kept.' : '' }));
105
- if (d.latest.length) w.appendChild(section('Latest lines kept by the filter', d.latest.length, simpleTable(['Time', 'Level', 'Source', 'Operation', 'Message'], d.latest.slice(0, 200).map(function (r) {
106
- return [when16(r.time), r.level, r.source, r.operation, el('span', { className: 'small', text: r.message.slice(0, 400) })];
107
- }), 'Latest lines')));
108
- }
109
- function lgIsc(w, H, desc) {
110
- var only = el('input', { type: 'checkbox', checked: !!H.failedOnly, 'aria-label': 'Only what failed' });
111
- only.addEventListener('change', function () { H.failedOnly = only.checked; });
112
- var extras = el('div', { className: 'bar' },
113
- el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'In the last' }), numSelect(H, 'days', [[1, '24 hours'], [2, '2 days'], [7, '7 days'], [14, '14 days'], [30, '30 days']], 'Period')),
114
- lgField(H, 'source', 'Source (exact name, optional)', 'all sources', 220),
115
- el('label', { style: 'display:flex;gap:6px;align-items:center' }, only, 'Only what failed'));
116
- if (!owRunBar(w, H, '/api/watch/source-log/run', 'Read what ISC recorded', desc, extras, function () { return { days: H.days, source: H.source || undefined, failedOnly: !!H.failedOnly }; }, renderLogs)) return;
117
- var d = H.data, T = d.totals;
118
- w.appendChild(el('div', { className: 'bigstats' }, stat(T.events, 'aggregation and source events'), stat(T.failed, 'failed', 'lose'), stat(T.provisioningErrors, 'provisioning errors', 'lose'), stat(T.appliancesNotNormal, 'Virtual Appliances not normal', 'lose')));
119
- if (d.appliances.length) w.appendChild(section('Virtual Appliances now', d.appliances.length, simpleTable(['Cluster', 'Appliance', 'Status', 'Alert', 'Last seen', 'Sources on the cluster'], d.appliances.map(function (a) {
120
- return [a.cluster, a.client, a.status === 'NORMAL' ? a.status : pill(a.status || 'unknown', 'lose'), a.alert, when16(a.lastSeen), fmtNum(a.sources)];
121
- }), 'Virtual Appliances')));
122
- if (d.bySource.length) w.appendChild(section('Per source', d.bySource.length, simpleTable(['Source', 'Type', 'Aggregations', 'Failed', 'Last aggregation', 'Provisioning errors', 'Last error', 'Cluster'], d.bySource.map(function (r) {
123
- return [r.source, r.type, fmtNum(r.aggregations), r.failedAggregations ? pill(String(r.failedAggregations), 'lose') : '0', r.lastAggregation ? el('span', {}, when16(r.lastAggregation), ' ', /fail|error/i.test(r.lastAggregationStatus || '') ? pill(r.lastAggregationStatus, 'lose') : el('span', { className: 'muted small', text: r.lastAggregationStatus || '' })) : '', r.provisioningErrors ? pill(String(r.provisioningErrors), 'lose') : '0', el('span', { className: 'small', text: r.lastError || '' }), r.cluster ? el('span', {}, r.cluster, r.clusterStatus && r.clusterStatus !== 'NORMAL' ? el('div', {}, pill(r.clusterStatus, 'lose')) : null) : ''];
124
- }), 'Per source')));
125
- if (d.rows.length) w.appendChild(section('Timeline', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['When', 'Source', 'Kind', 'Status', 'What', 'Detail', 'Who'], function (r) {
126
- return [when16(r.when), r.source, r.kind, /fail|error/i.test(r.status) ? pill(r.status, 'lose') : r.status, r.what, el('span', { className: 'small', style: 'word-break:break-word', text: r.detail }), r.who];
127
- }, 'Timeline')));
128
- else w.appendChild(el('p', { className: 'muted', text: 'ISC recorded nothing ' + (H.failedOnly ? 'that failed ' : '') + 'in the period.' }));
129
- }
130
-
131
- // Warnings > Threat signals > Privileged access gained
132
- function wnPrivGained(w, _H, desc) {
133
- var H = tw().priv;
134
- var keep = el('input', { type: 'checkbox', checked: H.remember !== false, 'aria-label': 'Remember this look' });
135
- keep.addEventListener('change', function () { H.remember = keep.checked; });
136
- var extras = el('label', { style: 'display:flex;gap:6px;align-items:center', title: 'Untick to compare again with the same earlier look' }, keep, 'Remember this look for next time');
137
- threatNote(w);
138
- if (!mdRun(w, H, 'priv-gained', 'Find new privileged access', desc, extras, function () { return { remember: H.remember !== false }; }, renderWarnings)) return;
139
- var d = H.data, T = d.totals;
140
- w.appendChild(el('div', { className: 'bigstats' }, stat(T.holdings, 'privileged entitlements held'), stat(T.people, 'people holding them'), stat(d.baseline ? null : T.fresh, 'gained since the previous look'), stat(d.baseline ? null : T.outside, 'of those with no ISC record', 'lose'), stat(d.baseline ? null : T.lost, 'no longer held')));
141
- if (d.since) w.appendChild(el('p', { className: 'muted small', style: 'margin:-4px 0 12px', text: 'Compared with the look of ' + when16(d.since) + '. Findings of the last 90 days stay listed while the person still holds the access.' }));
142
- var fresh = {}; (d.freshKeys || []).forEach(function (k) { fresh[k] = true; });
143
- if (d.findings && d.findings.length) w.appendChild(section('Privileged access gained', d.findings.length + (d.more || 0), filteredTable(H, d.findings, ['Found', 'Person', 'Privileged entitlement', 'Source', 'Held', 'How it got there', 'Requested by'], function (r) {
144
- return [el('span', {}, r.found.slice(0, 10), fresh[r.key] ? el('div', {}, pill('new', 'gain')) : null), el('span', {}, r.person, el('div', { className: 'muted small', text: r.personState + (r.newPerson ? ' · new identity' : '') })), r.entitlement, r.source, r.via, r.how === 'No ISC record' ? pill(r.how, 'lose') : el('span', {}, r.how, r.when ? el('div', { className: 'muted small', text: when16(r.when) }) : null), r.requestedBy || ''];
145
- }, 'Privileged access gained')));
146
- else if (!d.baseline) w.appendChild(el('p', { className: 'muted', text: 'Nobody gained a privileged entitlement since the previous look.' }));
147
- }
148
- // Warnings > Threat signals > Accounts created outside ISC
149
- function wnOutsideAccounts(w, _H, desc) {
150
- var H = tw().outacct;
151
- var extras = el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Appeared in the last' }), numSelect(H, 'days', [[1, '24 hours'], [7, '7 days'], [14, '14 days'], [30, '30 days'], [90, '90 days']], 'Period'));
152
- threatNote(w);
153
- if (!mdRun(w, H, 'outside-accounts', 'Find accounts created outside ISC', desc, extras, function () { return { days: H.days }; }, renderWarnings)) return;
154
- var d = H.data, T = d.totals;
155
- w.appendChild(el('div', { className: 'bigstats' }, stat(T.accounts, 'accounts ISC did not create'), stat(T.uncorrelated, 'owned by nobody', 'lose'), stat(T.ownerLeft, 'owner has left', 'lose'), stat(T.withAccess, 'already have access'), stat(T.provisioned, 'new accounts ISC created itself')));
156
- if (d.bySource.length) w.appendChild(section('Per source', d.bySource.length, simpleTable(['Source', 'New accounts not created by ISC', 'Accounts on the source', 'Note'], d.bySource.map(function (r) { return [r.source, fmtNum(r.fresh), r.total === null ? '—' : fmtNum(r.total), el('span', { className: 'muted small', text: r.note })]; }), 'Per source')));
157
- if (d.rows.length) w.appendChild(section('Accounts', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Appeared', 'Account', 'Source', 'Owner', 'Has access', 'State', 'Signals'], function (r) {
158
- return [when16(r.created), el('span', {}, r.account, r.nativeIdentity && r.nativeIdentity !== r.account ? el('div', { className: 'muted small', style: 'word-break:break-all', text: r.nativeIdentity }) : null), r.source, el('span', {}, r.owner || '—', el('div', { className: 'muted small', text: r.ownerState })), r.hasEntitlements ? 'yes' : 'no', r.disabled ? 'disabled' : 'enabled', r.signals.length ? (r.signals[0] === 'Source newly connected' ? el('span', { className: 'muted small', text: r.signals[0] }) : sigList(r.signals)) : ''];
159
- }, 'Accounts created outside ISC')));
160
- else w.appendChild(el('p', { className: 'muted', text: 'No account appeared in the period that ISC did not create itself.' }));
161
- }
162
- // Warnings > Threat signals > Sensitive changes
163
- function wnSensitive(w, _H, desc) {
164
- var H = tw().sensitive;
165
- var extras = el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Compared with' }), numSelect(H, 'days', [[1, 'yesterday or before'], [7, 'a week ago or before'], [30, 'a month ago or before'], [90, '3 months ago or before']], 'Compared with'));
166
- threatNote(w);
167
- if (!mdRun(w, H, 'sensitive', 'Find sensitive changes', desc, extras, function () { return { days: H.days }; }, renderWarnings)) return;
168
- var d = H.data, T = d.totals;
169
- if (d.baseline) return;
170
- w.appendChild(el('div', { className: 'bigstats' }, stat(T.high, 'high', 'lose'), stat(T.medium, 'medium'), stat(T.credentials, 'new API credentials'), stat(T.areas, 'areas touched')));
171
- if (d.rows.length) w.appendChild(section('Changes since ' + d.from, d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Severity', 'Area', 'Object', 'Change', 'Why it matters', 'Who', 'When'], function (r) {
172
- return [r.severity === 'high' ? pill('high', 'lose') : 'medium', r.area, r.object, el('span', { className: 'small', style: 'word-break:break-word', text: r.change }), el('span', { className: 'muted small', text: r.why }), r.who, when16(r.when)];
173
- }, 'Sensitive changes')));
174
- else w.appendChild(el('p', { className: 'muted', text: 'Nothing that touches a control changed since ' + d.from + '.' }));
175
- }
176
- // Warnings > Threat signals > Risk by person
177
- function wnRisk(w, _H, desc) {
178
- var H = tw().risk;
179
- var extras = el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Signals of the last' }), numSelect(H, 'days', [[1, '24 hours'], [7, '7 days'], [14, '14 days'], [30, '30 days']], 'Period'));
180
- threatNote(w);
181
- if (!mdRun(w, H, 'risk', 'Add up the signals', desc, extras, function () { return { days: H.days }; }, renderWarnings)) return;
182
- var d = H.data, T = d.totals;
183
- w.appendChild(el('div', { className: 'bigstats' }, stat(T.people, 'people with a signal'), stat(T.several, 'on more than one screen', 'lose'), stat(T.signals, 'signals in all')));
184
- if (d.rows.length) w.appendChild(section('People, highest first', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Person', 'Score', 'Screens', 'Signals'], function (r) {
185
- return [r.person, r.screens > 1 ? pill(String(r.score), 'lose') : String(r.score), String(r.screens), el('div', {}, r.signals.map(function (s) { return el('div', { className: 'small', text: s }); }))];
186
- }, 'Risk by person')));
187
- else w.appendChild(el('p', { className: 'muted', text: 'No person has a signal in the period.' }));
188
- }
189
- // Warnings > Joiners, movers, leavers > Coming up
190
- function wnUpcoming(w, _H, desc) {
191
- var H = tw().upcoming;
192
- var q = el('input', { className: 'input', value: H.query || '', placeholder: 'e.g. attributes.country:US', style: 'max-width:220px', 'aria-label': 'Only people matching (search query, optional)' });
193
- q.addEventListener('input', function () { H.query = q.value; });
194
- var extras = el('div', { className: 'bar' },
195
- el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Next' }), numSelect(H, 'days', [[3, '3 days'], [7, '7 days'], [14, '14 days'], [30, '30 days'], [90, '90 days']], 'Period')),
196
- attrInput(H, 'startDateAttribute', 'Start-date attribute', 'startDate'), attrInput(H, 'endDateAttribute', 'End-date attribute', 'endDate'),
197
- el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Only people matching (optional)' }), q));
198
- if (!mdRun(w, H, 'jml-preview', 'Show who is coming up', desc, extras, function () { return { days: H.days, startDateAttribute: H.startDateAttribute || undefined, endDateAttribute: H.endDateAttribute || undefined, query: H.query || undefined }; }, renderWarnings)) return;
199
- var d = H.data, T = d.totals;
200
- w.appendChild(el('div', { className: 'bigstats' }, stat(T.starts, 'start in the period'), stat(T.ends, 'end in the period'), stat(T.findings, 'with something to check', 'lose'), stat(T.checked, 'identities read')));
201
- var busy = d.perDay.filter(function (p) { return p.starts || p.ends; });
202
- if (busy.length) w.appendChild(section('Per day', busy.length, simpleTable(['Day', 'Start', 'End'], busy.map(function (p) { return [p.day, p.starts ? fmtNum(p.starts) : '', p.ends ? fmtNum(p.ends) : '']; }), 'Per day')));
203
- if (d.rows.length) w.appendChild(section('People', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Date', 'Kind', 'Person', 'Manager', 'Identity profile', 'Lifecycle state now', 'Accounts', 'Access', 'To check'], function (r) {
204
- return [el('span', {}, r.date, el('div', { className: 'muted small', text: daysText(r.inDays) })), pill(r.kind, r.kind === 'Ends' ? 'lose' : 'gain'), el('span', {}, r.person, r.email ? el('div', { className: 'muted small', text: r.email }) : null), r.manager || '', r.profile, el('span', {}, r.lifecycle, r.stateNow ? el('div', { className: 'muted small', text: r.stateNow }) : null), r.accounts === null ? '' : fmtNum(r.accounts), r.access === null ? '' : fmtNum(r.access), r.findings.length ? sigList(r.findings) : ''];
205
- }, 'Joiners and leavers coming up')));
206
- else w.appendChild(el('p', { className: 'muted', text: 'Nobody has a start or end date in the period.' }));
207
- if (d.states.length) w.appendChild(section('What the lifecycle states of these identity profiles do', d.states.length, simpleTable(['Identity profile', 'Lifecycle state', 'Kind', 'Accounts', 'Removes all access', 'Findings'], d.states.map(function (s) {
208
- return [s.profile, el('span', {}, s.state, s.enabled ? null : el('span', { className: 'muted small', text: ' (off)' })), s.kind === 'leaver' ? 'leaver state' : 'active state', el('span', { className: 'small', text: s.accounts }), s.removesAccess ? 'yes' : 'no', s.findings.length ? sigList(s.findings) : ''];
209
- }), 'Lifecycle states')));
210
- }
211
- // Warnings > Requests and reviews > Stuck requests
212
- function wnStuckReq(w, _H, desc) {
213
- var H = tw().stuckreq;
214
- var extras = el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Running for more than' }), numSelect(H, 'hours', [[4, '4 hours'], [24, '1 day'], [72, '3 days'], [168, '7 days'], [720, '30 days']], 'Running for more than'));
215
- if (!mdRun(w, H, 'stuck-requests', 'Find stuck requests', desc, extras, function () { return { hours: H.hours }; }, renderWarnings)) return;
216
- var d = H.data, T = d.totals;
217
- w.appendChild(el('div', { className: 'bigstats' }, stat(T.running, 'requests still running'), stat(T.stuck, 'longer than the limit', 'lose'), stat(T.approval, 'waiting in approval'), stat(T.provisioning, 'waiting in provisioning'), stat(T.churningSources, 'sources ISC keeps re-sending to', 'lose')));
218
- if (d.byPhase.length) w.appendChild(section('Where they wait', d.byPhase.length, simpleTable(['Phase', 'Requests', 'Oldest'], d.byPhase.map(function (p) { return [p.phase, fmtNum(p.requests), hrs(p.oldestHours)]; }), 'Where they wait')));
219
- if (d.churn.length) w.appendChild(section('Sources ISC keeps sending the same change to (last 2 days)', d.churn.length, simpleTable(['Source', 'Repeated changes', 'People', 'Example'], d.churn.map(function (c) { return [c.source, pill(fmtNum(c.changes), 'lose'), fmtNum(c.people), el('span', { className: 'small', text: c.example })]; }), 'Churning sources')));
220
- if (d.rows.length) w.appendChild(section('Stuck requests', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Submitted', 'Running', 'Access', 'Requested for', 'Phase', 'Waiting on', 'Why'], function (r) {
221
- return [when16(r.submitted), hrs(r.hours), el('span', {}, r.access, el('div', { className: 'muted small', text: r.type })), el('span', {}, r.requestedFor, r.requestedBy && r.requestedBy !== r.requestedFor ? el('div', { className: 'muted small', text: 'by ' + r.requestedBy }) : null), el('span', {}, r.phase, r.phaseHours === null ? null : el('div', { className: 'muted small', text: 'for ' + hrs(r.phaseHours) })), r.waitingOn, el('span', {}, r.reason, r.errors ? el('div', { className: 'small', style: 'color:var(--danger)', text: r.errors }) : null)];
222
- }, 'Stuck requests')));
223
- else w.appendChild(el('p', { className: 'muted', text: 'No request has been running that long.' }));
224
- }
1
+ // ---------- 0.27.0: Logs page; privileged access gained, accounts created outside ISC, sensitive changes, risk by person; joiner and leaver preview; stuck requests ----------
2
+ function lgState() {
3
+ if (!state.lg) {
4
+ var saved = '';
5
+ try { saved = localStorage.getItem('identityscope.logpath') || ''; } catch (e) { saved = ''; }
6
+ state.lg = { tab: 'ccg', ccg: { path: saved, level: 'WARN', source: '', text: '', from: '', to: '', open: {} }, isc: { days: 2, source: '', failedOnly: true } };
7
+ }
8
+ return state.lg;
9
+ }
10
+ var LG_TABS = [
11
+ ['ccg', 'Connector log (ccg.log)', 'file', 'Read the connector log of a Virtual Appliance from a copy on this computer: errors grouped and counted, per source, with the full error detail.'],
12
+ ['isc', 'What ISC recorded', 'pulse', 'One timeline per source of what ISC itself recorded: aggregations, source changes, provisioning that ended with an error, and the state of the Virtual Appliances.']
13
+ ];
14
+ function tw() {
15
+ if (!state.tw) state.tw = { priv: { remember: true }, outacct: { days: 7 }, sensitive: { days: 7 }, risk: { days: 7 }, upcoming: { days: 14, startDateAttribute: '', endDateAttribute: '', query: '' }, stuckreq: { hours: 24 } };
16
+ return state.tw;
17
+ }
18
+ function renderLogs() {
19
+ var L = lgState();
20
+ var outer = $('logs');
21
+ outer.textContent = '';
22
+ var w = el('div', { className: 'wrap', style: 'max-width:1240px' });
23
+ outer.appendChild(w);
24
+ w.appendChild(el('div', { className: 'rhead', style: 'margin-bottom:4px' }, el('span', { className: 'cat-ico', style: 'color:#1d4ed8;background:#dbeafe' }, icon('file')),
25
+ el('div', {}, el('h2', { text: 'Logs' }), el('p', { className: 'desc', text: 'Find out why a source failed without signing in to a server. Read-only; nothing from a log is stored or sent anywhere.' }))));
26
+ var tabs = el('div', { className: 'tabs', style: 'flex-wrap:wrap' });
27
+ LG_TABS.forEach(function (t) { tabs.appendChild(el('button', { className: 'tab' + (L.tab === t[0] ? ' active' : ''), onclick: function () { L.tab = t[0]; renderLogs(); } }, icon(t[2]), t[1])); });
28
+ w.appendChild(tabs);
29
+ var spec = LG_TABS.filter(function (t) { return t[0] === L.tab; })[0];
30
+ if (L.tab === 'ccg') lgCcg(w, L.ccg, spec[3]); else lgIsc(w, L.isc, spec[3]);
31
+ }
32
+ function lgField(H, key, label, placeholder, width, type) {
33
+ var i = el('input', { className: 'input', value: H[key] || '', placeholder: placeholder || '', style: 'max-width:' + (width || 200) + 'px', 'aria-label': label, type: type || 'text' });
34
+ i.addEventListener('input', function () { H[key] = i.value; });
35
+ return el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: label }), i);
36
+ }
37
+ function lgFilter(H) { return { level: H.level, source: H.source || undefined, text: H.text || undefined, from: H.from || undefined, to: H.to || undefined }; }
38
+ function lgCcg(w, H, desc) {
39
+ w.appendChild(el('p', { className: 'muted', style: 'margin:0 0 10px', text: desc }));
40
+ w.appendChild(el('div', { className: 'note', text: 'ISC has no way to hand out ccg.log, so IdentityScope reads a copy: copy the file from the Virtual Appliance (/home/sailpoint/log/ccg.log) to this computer or a shared folder once, then give its path here or choose the file. A folder reads every log file in it, rotated and .gz files included.' }));
41
+ var path = el('input', { className: 'input', value: H.path || '', placeholder: 'C:\\logs\\ccg.log or /home/me/va-logs', style: 'min-width:320px;flex:1', 'aria-label': 'Path of ccg.log or its folder on this computer' });
42
+ path.addEventListener('input', function () { H.path = path.value; });
43
+ var picker = el('input', { type: 'file', className: 'hidden', 'aria-label': 'Choose a log file', accept: '.log,.txt,.json,.jsonl,.gz,*/*' });
44
+ var run = function () {
45
+ try { localStorage.setItem('identityscope.logpath', H.path || ''); } catch (e) { /* not kept */ }
46
+ H.open = {};
47
+ runJobInto(H, '/api/logs/ccg/run', Object.assign({ path: H.path }, lgFilter(H)), renderLogs);
48
+ };
49
+ picker.addEventListener('change', function () {
50
+ var f = picker.files && picker.files[0];
51
+ if (!f) return;
52
+ var q = lgFilter(H); q.name = f.name;
53
+ var qs = Object.keys(q).filter(function (k) { return q[k]; }).map(function (k) { return k + '=' + encodeURIComponent(q[k]); }).join('&');
54
+ H.busy = 'Reading ' + f.name + ' (' + fmtNum(Math.round(f.size / 1048576)) + ' MB)...'; H.error = null; H.data = null; H.open = {}; renderLogs();
55
+ fetch('/api/logs/ccg/upload?' + qs, { method: 'POST', headers: { 'x-isc-reports-key': KEY, 'content-type': 'application/octet-stream' }, body: f }).then(function (res) {
56
+ return res.json().then(function (d) { if (!res.ok) throw new Error(d.error || 'The file could not be read.'); return d; });
57
+ }).then(function (r) {
58
+ H.job = r.job;
59
+ pollJob(r.job, function (m) { H.busy = m; renderLogs(); }, function (s) { H.busy = null; H.data = s.extra; renderLogs(); }, function (e) { H.busy = null; H.error = e; renderLogs(); });
60
+ }, function (e) { H.busy = null; H.error = errorText(e); renderLogs(); });
61
+ });
62
+ var level = el('select', { className: 'input', style: 'width:auto', 'aria-label': 'Which lines' }, [['ERROR', 'Errors only'], ['WARN', 'Errors and warnings'], ['INFO', 'Everything but debug'], ['DEBUG', 'Everything']].map(function (o) { return el('option', { value: o[0], text: o[1] }); }));
63
+ level.value = H.level;
64
+ level.addEventListener('change', function () { H.level = level.value; });
65
+ w.appendChild(el('div', { className: 'card', style: 'padding:12px 16px' },
66
+ el('div', { className: 'bar' }, el('label', { className: 'field', style: 'margin:0;flex:1;min-width:320px' }, el('span', { className: 'lbl', text: 'File or folder on this computer' }), path),
67
+ el('button', { className: 'btn primary', disabled: !!H.busy || !(H.path || '').trim(), onclick: run }, icon('play'), H.data ? 'Read again' : 'Read the log'),
68
+ el('span', { className: 'muted small', text: 'or' }),
69
+ el('button', { className: 'btn', disabled: !!H.busy, onclick: function () { picker.click(); } }, icon('file'), 'Choose a file'), picker),
70
+ el('div', { className: 'bar', style: 'margin-top:10px' },
71
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Lines' }), level),
72
+ lgField(H, 'source', 'Source name contains', 'e.g. Active Directory', 200),
73
+ lgField(H, 'text', 'Message contains', 'e.g. timeout', 180),
74
+ lgField(H, 'from', 'From', '', 200, 'datetime-local'),
75
+ lgField(H, 'to', 'To', '', 200, 'datetime-local'))));
76
+ // The path field must be enabled as soon as something is typed.
77
+ path.addEventListener('input', function () { var b = w.querySelector('button.primary'); if (b) b.disabled = !!H.busy || !path.value.trim(); });
78
+ if (H.busy) { w.appendChild(busyBox(H.busy)); return; }
79
+ if (H.error) { w.appendChild(el('div', { className: 'error', text: H.error })); return; }
80
+ if (!H.data) return;
81
+ var d = H.data, T = d.totals;
82
+ (d.notes || []).forEach(function (n) { w.appendChild(el('div', { className: 'note', text: n })); });
83
+ w.appendChild(el('div', { className: 'bigstats' }, stat(T.lines, 'lines in the file'), stat(T.matched, 'lines kept by the filter'), stat(T.errors, 'errors', 'lose'), stat(T.warnings, 'warnings', 'lose'), stat(T.groups, 'different errors and warnings'), stat(d.bySource.length, 'sources')));
84
+ if (T.first) w.appendChild(el('p', { className: 'muted small', style: 'margin:-4px 0 12px', text: 'From ' + when16(T.first) + ' to ' + when16(T.last) + ' (times as written in the log, UTC). ' + (d.files || []).length + ' file' + ((d.files || []).length === 1 ? '' : 's') + ' read.' }));
85
+ if (d.byHour.length > 1) {
86
+ var max = Math.max.apply(null, d.byHour.map(function (h) { return h.errors + h.warnings; })) || 1;
87
+ var strip = el('div', { style: 'display:flex;align-items:flex-end;gap:2px;height:64px;margin:4px 0 6px', role: 'img', 'aria-label': 'Errors and warnings per hour' });
88
+ d.byHour.forEach(function (h) {
89
+ var n = h.errors + h.warnings;
90
+ strip.appendChild(el('div', { title: h.hour.replace('T', ' ') + ':00 ' + h.errors + ' errors, ' + h.warnings + ' warnings', style: 'flex:1;min-width:2px;max-width:18px;height:' + Math.max(2, Math.round(n * 60 / max)) + 'px;background:' + (h.errors ? '#dc2626' : n ? '#d97706' : '#e5e7eb') }));
91
+ });
92
+ w.appendChild(section('Errors and warnings per hour', d.byHour.length, el('div', {}, strip, el('div', { className: 'muted small', style: 'display:flex;justify-content:space-between' }, el('span', { text: d.byHour[0].hour.replace('T', ' ') + ':00' }), el('span', { text: d.byHour[d.byHour.length - 1].hour.replace('T', ' ') + ':00' })))));
93
+ }
94
+ if (d.bySource.length) w.appendChild(section('Per source', d.bySource.length, simpleTable(['Source', 'Type', 'Lines', 'Errors', 'Warnings', 'Last error', 'At'], d.bySource.map(function (r) {
95
+ return [r.source, r.type, fmtNum(r.lines), r.errors ? pill(fmtNum(r.errors), 'lose') : '0', fmtNum(r.warnings), el('span', { className: 'small', text: r.lastError || '' }), when16(r.lastErrorAt)];
96
+ }), 'Per source')));
97
+ if (d.groups.length) {
98
+ w.appendChild(section('Errors and warnings, repeats counted once', d.groups.length + (d.moreGroups || 0), filteredTable(H, d.groups, ['Level', 'Source', 'Operation', 'Times', 'First', 'Last', 'Message'], function (g) {
99
+ var key = g.level + '|' + g.source + '|' + g.operation + '|' + g.pattern;
100
+ var detail = el('div', { className: H.open[key] ? '' : 'hidden' }, el('pre', { className: 'small', style: 'white-space:pre-wrap;word-break:break-word;margin:6px 0 0;max-height:320px;overflow:auto', text: g.example + (g.exception ? '\n\n' + g.exception : '') }), g.logger ? el('div', { className: 'muted small', text: 'Logger: ' + g.logger }) : null);
101
+ var btn = el('button', { className: 'linkbtn small', 'aria-expanded': String(!!H.open[key]), onclick: function () { H.open[key] = !H.open[key]; detail.classList.toggle('hidden', !H.open[key]); btn.setAttribute('aria-expanded', String(!!H.open[key])); btn.textContent = H.open[key] ? 'Hide detail' : 'Show detail'; } }, H.open[key] ? 'Hide detail' : 'Show detail');
102
+ return [(/ERR|FATAL/.test(g.level) ? pill(g.level, 'lose') : el('span', { style: 'color:#92400e;font-weight:600', text: g.level })), g.source, g.operation, fmtNum(g.count), when16(g.first), when16(g.last), el('div', {}, el('div', { className: 'small', text: g.example.slice(0, 260) + (g.example.length > 260 ? '…' : '') }), btn, detail)];
103
+ }, 'Errors and warnings')));
104
+ } else w.appendChild(el('p', { className: 'muted', text: T.read ? 'No errors or warnings in what the filter kept.' : '' }));
105
+ if (d.latest.length) w.appendChild(section('Latest lines kept by the filter', d.latest.length, simpleTable(['Time', 'Level', 'Source', 'Operation', 'Message'], d.latest.slice(0, 200).map(function (r) {
106
+ return [when16(r.time), r.level, r.source, r.operation, el('span', { className: 'small', text: r.message.slice(0, 400) })];
107
+ }), 'Latest lines')));
108
+ }
109
+ function lgIsc(w, H, desc) {
110
+ var only = el('input', { type: 'checkbox', checked: !!H.failedOnly, 'aria-label': 'Only what failed' });
111
+ only.addEventListener('change', function () { H.failedOnly = only.checked; });
112
+ var extras = el('div', { className: 'bar' },
113
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'In the last' }), numSelect(H, 'days', [[1, '24 hours'], [2, '2 days'], [7, '7 days'], [14, '14 days'], [30, '30 days']], 'Period')),
114
+ lgField(H, 'source', 'Source (exact name, optional)', 'all sources', 220),
115
+ el('label', { style: 'display:flex;gap:6px;align-items:center' }, only, 'Only what failed'));
116
+ if (!owRunBar(w, H, '/api/watch/source-log/run', 'Read what ISC recorded', desc, extras, function () { return { days: H.days, source: H.source || undefined, failedOnly: !!H.failedOnly }; }, renderLogs)) return;
117
+ var d = H.data, T = d.totals;
118
+ w.appendChild(el('div', { className: 'bigstats' }, stat(T.events, 'aggregation and source events'), stat(T.failed, 'failed', 'lose'), stat(T.provisioningErrors, 'provisioning errors', 'lose'), stat(T.appliancesNotNormal, 'Virtual Appliances not normal', 'lose')));
119
+ if (d.appliances.length) w.appendChild(section('Virtual Appliances now', d.appliances.length, simpleTable(['Cluster', 'Appliance', 'Status', 'Alert', 'Last seen', 'Sources on the cluster'], d.appliances.map(function (a) {
120
+ return [a.cluster, a.client, a.status === 'NORMAL' ? a.status : pill(a.status || 'unknown', 'lose'), a.alert, when16(a.lastSeen), fmtNum(a.sources)];
121
+ }), 'Virtual Appliances')));
122
+ if (d.bySource.length) w.appendChild(section('Per source', d.bySource.length, simpleTable(['Source', 'Type', 'Aggregations', 'Failed', 'Last aggregation', 'Provisioning errors', 'Last error', 'Cluster'], d.bySource.map(function (r) {
123
+ return [r.source, r.type, fmtNum(r.aggregations), r.failedAggregations ? pill(String(r.failedAggregations), 'lose') : '0', r.lastAggregation ? el('span', {}, when16(r.lastAggregation), ' ', /fail|error/i.test(r.lastAggregationStatus || '') ? pill(r.lastAggregationStatus, 'lose') : el('span', { className: 'muted small', text: r.lastAggregationStatus || '' })) : '', r.provisioningErrors ? pill(String(r.provisioningErrors), 'lose') : '0', el('span', { className: 'small', text: r.lastError || '' }), r.cluster ? el('span', {}, r.cluster, r.clusterStatus && r.clusterStatus !== 'NORMAL' ? el('div', {}, pill(r.clusterStatus, 'lose')) : null) : ''];
124
+ }), 'Per source')));
125
+ if (d.rows.length) w.appendChild(section('Timeline', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['When', 'Source', 'Kind', 'Status', 'What', 'Detail', 'Who'], function (r) {
126
+ return [when16(r.when), r.source, r.kind, /fail|error/i.test(r.status) ? pill(r.status, 'lose') : r.status, r.what, el('span', { className: 'small', style: 'word-break:break-word', text: r.detail }), r.who];
127
+ }, 'Timeline')));
128
+ else w.appendChild(el('p', { className: 'muted', text: 'ISC recorded nothing ' + (H.failedOnly ? 'that failed ' : '') + 'in the period.' }));
129
+ }
130
+
131
+ // Warnings > Threat signals > Privileged access gained
132
+ function wnPrivGained(w, _H, desc) {
133
+ var H = tw().priv;
134
+ var keep = el('input', { type: 'checkbox', checked: H.remember !== false, 'aria-label': 'Remember this look' });
135
+ keep.addEventListener('change', function () { H.remember = keep.checked; });
136
+ var extras = el('label', { style: 'display:flex;gap:6px;align-items:center', title: 'Untick to compare again with the same earlier look' }, keep, 'Remember this look for next time');
137
+ threatNote(w);
138
+ if (!mdRun(w, H, 'priv-gained', 'Find new privileged access', desc, extras, function () { return { remember: H.remember !== false }; }, renderWarnings)) return;
139
+ var d = H.data, T = d.totals;
140
+ w.appendChild(el('div', { className: 'bigstats' }, stat(T.holdings, 'privileged entitlements held'), stat(T.people, 'people holding them'), stat(d.baseline ? null : T.fresh, 'gained since the previous look'), stat(d.baseline ? null : T.outside, 'of those with no ISC record', 'lose'), stat(d.baseline ? null : T.lost, 'no longer held')));
141
+ if (d.since) w.appendChild(el('p', { className: 'muted small', style: 'margin:-4px 0 12px', text: 'Compared with the look of ' + when16(d.since) + '. Findings of the last 90 days stay listed while the person still holds the access.' }));
142
+ var fresh = {}; (d.freshKeys || []).forEach(function (k) { fresh[k] = true; });
143
+ if (d.findings && d.findings.length) w.appendChild(section('Privileged access gained', d.findings.length + (d.more || 0), filteredTable(H, d.findings, ['Found', 'Person', 'Privileged entitlement', 'Source', 'Held', 'How it got there', 'Requested by'], function (r) {
144
+ return [el('span', {}, r.found.slice(0, 10), fresh[r.key] ? el('div', {}, pill('new', 'gain')) : null), el('span', {}, r.person, el('div', { className: 'muted small', text: r.personState + (r.newPerson ? ' · new identity' : '') })), r.entitlement, r.source, r.via, r.how === 'No ISC record' ? pill(r.how, 'lose') : el('span', {}, r.how, r.when ? el('div', { className: 'muted small', text: when16(r.when) }) : null), r.requestedBy || ''];
145
+ }, 'Privileged access gained')));
146
+ else if (!d.baseline) w.appendChild(el('p', { className: 'muted', text: 'Nobody gained a privileged entitlement since the previous look.' }));
147
+ }
148
+ // Warnings > Threat signals > Accounts created outside ISC
149
+ function wnOutsideAccounts(w, _H, desc) {
150
+ var H = tw().outacct;
151
+ var extras = el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Appeared in the last' }), numSelect(H, 'days', [[1, '24 hours'], [7, '7 days'], [14, '14 days'], [30, '30 days'], [90, '90 days']], 'Period'));
152
+ threatNote(w);
153
+ if (!mdRun(w, H, 'outside-accounts', 'Find accounts created outside ISC', desc, extras, function () { return { days: H.days }; }, renderWarnings)) return;
154
+ var d = H.data, T = d.totals;
155
+ w.appendChild(el('div', { className: 'bigstats' }, stat(T.accounts, 'accounts ISC did not create'), stat(T.uncorrelated, 'owned by nobody', 'lose'), stat(T.ownerLeft, 'owner has left', 'lose'), stat(T.withAccess, 'already have access'), stat(T.provisioned, 'new accounts ISC created itself')));
156
+ if (d.bySource.length) w.appendChild(section('Per source', d.bySource.length, simpleTable(['Source', 'New accounts not created by ISC', 'Accounts on the source', 'Note'], d.bySource.map(function (r) { return [r.source, fmtNum(r.fresh), r.total === null ? '—' : fmtNum(r.total), el('span', { className: 'muted small', text: r.note })]; }), 'Per source')));
157
+ if (d.rows.length) w.appendChild(section('Accounts', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Appeared', 'Account', 'Source', 'Owner', 'Has access', 'State', 'Signals'], function (r) {
158
+ return [when16(r.created), el('span', {}, r.account, r.nativeIdentity && r.nativeIdentity !== r.account ? el('div', { className: 'muted small', style: 'word-break:break-all', text: r.nativeIdentity }) : null), r.source, el('span', {}, r.owner || '—', el('div', { className: 'muted small', text: r.ownerState })), r.hasEntitlements ? 'yes' : 'no', r.disabled ? 'disabled' : 'enabled', r.signals.length ? (r.signals[0] === 'Source newly connected' ? el('span', { className: 'muted small', text: r.signals[0] }) : sigList(r.signals)) : ''];
159
+ }, 'Accounts created outside ISC')));
160
+ else w.appendChild(el('p', { className: 'muted', text: 'No account appeared in the period that ISC did not create itself.' }));
161
+ }
162
+ // Warnings > Threat signals > Sensitive changes
163
+ function wnSensitive(w, _H, desc) {
164
+ var H = tw().sensitive;
165
+ var extras = el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Compared with' }), numSelect(H, 'days', [[1, 'yesterday or before'], [7, 'a week ago or before'], [30, 'a month ago or before'], [90, '3 months ago or before']], 'Compared with'));
166
+ threatNote(w);
167
+ if (!mdRun(w, H, 'sensitive', 'Find sensitive changes', desc, extras, function () { return { days: H.days }; }, renderWarnings)) return;
168
+ var d = H.data, T = d.totals;
169
+ if (d.baseline) return;
170
+ w.appendChild(el('div', { className: 'bigstats' }, stat(T.high, 'high', 'lose'), stat(T.medium, 'medium'), stat(T.credentials, 'new API credentials'), stat(T.areas, 'areas touched')));
171
+ if (d.rows.length) w.appendChild(section('Changes since ' + d.from, d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Severity', 'Area', 'Object', 'Change', 'Why it matters', 'Who', 'When'], function (r) {
172
+ return [r.severity === 'high' ? pill('high', 'lose') : 'medium', r.area, r.object, el('span', { className: 'small', style: 'word-break:break-word', text: r.change }), el('span', { className: 'muted small', text: r.why }), r.who, when16(r.when)];
173
+ }, 'Sensitive changes')));
174
+ else w.appendChild(el('p', { className: 'muted', text: 'Nothing that touches a control changed since ' + d.from + '.' }));
175
+ }
176
+ // Warnings > Threat signals > Risk by person
177
+ function wnRisk(w, _H, desc) {
178
+ var H = tw().risk;
179
+ var extras = el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Signals of the last' }), numSelect(H, 'days', [[1, '24 hours'], [7, '7 days'], [14, '14 days'], [30, '30 days']], 'Period'));
180
+ threatNote(w);
181
+ if (!mdRun(w, H, 'risk', 'Add up the signals', desc, extras, function () { return { days: H.days }; }, renderWarnings)) return;
182
+ var d = H.data, T = d.totals;
183
+ w.appendChild(el('div', { className: 'bigstats' }, stat(T.people, 'people with a signal'), stat(T.several, 'on more than one screen', 'lose'), stat(T.signals, 'signals in all')));
184
+ if (d.rows.length) w.appendChild(section('People, highest first', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Person', 'Score', 'Screens', 'Signals'], function (r) {
185
+ return [r.person, r.screens > 1 ? pill(String(r.score), 'lose') : String(r.score), String(r.screens), el('div', {}, r.signals.map(function (s) { return el('div', { className: 'small', text: s }); }))];
186
+ }, 'Risk by person')));
187
+ else w.appendChild(el('p', { className: 'muted', text: 'No person has a signal in the period.' }));
188
+ }
189
+ // Warnings > Joiners, movers, leavers > Coming up
190
+ function wnUpcoming(w, _H, desc) {
191
+ var H = tw().upcoming;
192
+ var q = el('input', { className: 'input', value: H.query || '', placeholder: 'e.g. attributes.country:US', style: 'max-width:220px', 'aria-label': 'Only people matching (search query, optional)' });
193
+ q.addEventListener('input', function () { H.query = q.value; });
194
+ var extras = el('div', { className: 'bar' },
195
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Next' }), numSelect(H, 'days', [[3, '3 days'], [7, '7 days'], [14, '14 days'], [30, '30 days'], [90, '90 days']], 'Period')),
196
+ attrInput(H, 'startDateAttribute', 'Start-date attribute', 'startDate'), attrInput(H, 'endDateAttribute', 'End-date attribute', 'endDate'),
197
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Only people matching (optional)' }), q));
198
+ if (!mdRun(w, H, 'jml-preview', 'Show who is coming up', desc, extras, function () { return { days: H.days, startDateAttribute: H.startDateAttribute || undefined, endDateAttribute: H.endDateAttribute || undefined, query: H.query || undefined }; }, renderWarnings)) return;
199
+ var d = H.data, T = d.totals;
200
+ w.appendChild(el('div', { className: 'bigstats' }, stat(T.starts, 'start in the period'), stat(T.ends, 'end in the period'), stat(T.findings, 'with something to check', 'lose'), stat(T.checked, 'identities read')));
201
+ var busy = d.perDay.filter(function (p) { return p.starts || p.ends; });
202
+ if (busy.length) w.appendChild(section('Per day', busy.length, simpleTable(['Day', 'Start', 'End'], busy.map(function (p) { return [p.day, p.starts ? fmtNum(p.starts) : '', p.ends ? fmtNum(p.ends) : '']; }), 'Per day')));
203
+ if (d.rows.length) w.appendChild(section('People', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Date', 'Kind', 'Person', 'Manager', 'Identity profile', 'Lifecycle state now', 'Accounts', 'Access', 'To check'], function (r) {
204
+ return [el('span', {}, r.date, el('div', { className: 'muted small', text: daysText(r.inDays) })), pill(r.kind, r.kind === 'Ends' ? 'lose' : 'gain'), el('span', {}, r.person, r.email ? el('div', { className: 'muted small', text: r.email }) : null), r.manager || '', r.profile, el('span', {}, r.lifecycle, r.stateNow ? el('div', { className: 'muted small', text: r.stateNow }) : null), r.accounts === null ? '' : fmtNum(r.accounts), r.access === null ? '' : fmtNum(r.access), r.findings.length ? sigList(r.findings) : ''];
205
+ }, 'Joiners and leavers coming up')));
206
+ else w.appendChild(el('p', { className: 'muted', text: 'Nobody has a start or end date in the period.' }));
207
+ if (d.states.length) w.appendChild(section('What the lifecycle states of these identity profiles do', d.states.length, simpleTable(['Identity profile', 'Lifecycle state', 'Kind', 'Accounts', 'Removes all access', 'Findings'], d.states.map(function (s) {
208
+ return [s.profile, el('span', {}, s.state, s.enabled ? null : el('span', { className: 'muted small', text: ' (off)' })), s.kind === 'leaver' ? 'leaver state' : 'active state', el('span', { className: 'small', text: s.accounts }), s.removesAccess ? 'yes' : 'no', s.findings.length ? sigList(s.findings) : ''];
209
+ }), 'Lifecycle states')));
210
+ }
211
+ // Warnings > Requests and reviews > Stuck requests
212
+ function wnStuckReq(w, _H, desc) {
213
+ var H = tw().stuckreq;
214
+ var extras = el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Running for more than' }), numSelect(H, 'hours', [[4, '4 hours'], [24, '1 day'], [72, '3 days'], [168, '7 days'], [720, '30 days']], 'Running for more than'));
215
+ if (!mdRun(w, H, 'stuck-requests', 'Find stuck requests', desc, extras, function () { return { hours: H.hours }; }, renderWarnings)) return;
216
+ var d = H.data, T = d.totals;
217
+ w.appendChild(el('div', { className: 'bigstats' }, stat(T.running, 'requests still running'), stat(T.stuck, 'longer than the limit', 'lose'), stat(T.approval, 'waiting in approval'), stat(T.provisioning, 'waiting in provisioning'), stat(T.churningSources, 'sources ISC keeps re-sending to', 'lose')));
218
+ if (d.byPhase.length) w.appendChild(section('Where they wait', d.byPhase.length, simpleTable(['Phase', 'Requests', 'Oldest'], d.byPhase.map(function (p) { return [p.phase, fmtNum(p.requests), hrs(p.oldestHours)]; }), 'Where they wait')));
219
+ if (d.churn.length) w.appendChild(section('Sources ISC keeps sending the same change to (last 2 days)', d.churn.length, simpleTable(['Source', 'Repeated changes', 'People', 'Example'], d.churn.map(function (c) { return [c.source, pill(fmtNum(c.changes), 'lose'), fmtNum(c.people), el('span', { className: 'small', text: c.example })]; }), 'Churning sources')));
220
+ if (d.rows.length) w.appendChild(section('Stuck requests', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Submitted', 'Running', 'Access', 'Requested for', 'Phase', 'Waiting on', 'Why'], function (r) {
221
+ return [when16(r.submitted), hrs(r.hours), el('span', {}, r.access, el('div', { className: 'muted small', text: r.type })), el('span', {}, r.requestedFor, r.requestedBy && r.requestedBy !== r.requestedFor ? el('div', { className: 'muted small', text: 'by ' + r.requestedBy }) : null), el('span', {}, r.phase, r.phaseHours === null ? null : el('div', { className: 'muted small', text: 'for ' + hrs(r.phaseHours) })), r.waitingOn, el('span', {}, r.reason, r.errors ? el('div', { className: 'small', style: 'color:var(--danger)', text: r.errors }) : null)];
222
+ }, 'Stuck requests')));
223
+ else w.appendChild(el('p', { className: 'muted', text: 'No request has been running that long.' }));
224
+ }