identityscope 0.0.0-stage → 0.28.3

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 (333) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +917 -3
  3. package/SECURITY.md +56 -0
  4. package/dist/core/audit-readiness.d.ts +158 -0
  5. package/dist/core/audit-readiness.js +357 -0
  6. package/dist/core/audit-readiness.js.map +1 -0
  7. package/dist/core/certs.d.ts +68 -0
  8. package/dist/core/certs.js +132 -0
  9. package/dist/core/certs.js.map +1 -0
  10. package/dist/core/checks.d.ts +133 -0
  11. package/dist/core/checks.js +512 -0
  12. package/dist/core/checks.js.map +1 -0
  13. package/dist/core/cloud-rules.d.ts +20 -0
  14. package/dist/core/cloud-rules.js +44 -0
  15. package/dist/core/cloud-rules.js.map +1 -0
  16. package/dist/core/compare.d.ts +45 -0
  17. package/dist/core/compare.js +372 -0
  18. package/dist/core/compare.js.map +1 -0
  19. package/dist/core/conditions.d.ts +10 -0
  20. package/dist/core/conditions.js +201 -0
  21. package/dist/core/conditions.js.map +1 -0
  22. package/dist/core/credentials.d.ts +71 -0
  23. package/dist/core/credentials.js +211 -0
  24. package/dist/core/credentials.js.map +1 -0
  25. package/dist/core/datasets.d.ts +53 -0
  26. package/dist/core/datasets.js +596 -0
  27. package/dist/core/datasets.js.map +1 -0
  28. package/dist/core/definition.d.ts +32 -0
  29. package/dist/core/definition.js +301 -0
  30. package/dist/core/definition.js.map +1 -0
  31. package/dist/core/discover.d.ts +32 -0
  32. package/dist/core/discover.js +105 -0
  33. package/dist/core/discover.js.map +1 -0
  34. package/dist/core/engine.d.ts +18 -0
  35. package/dist/core/engine.js +290 -0
  36. package/dist/core/engine.js.map +1 -0
  37. package/dist/core/fields.d.ts +16 -0
  38. package/dist/core/fields.js +132 -0
  39. package/dist/core/fields.js.map +1 -0
  40. package/dist/core/governance-trail.d.ts +211 -0
  41. package/dist/core/governance-trail.js +557 -0
  42. package/dist/core/governance-trail.js.map +1 -0
  43. package/dist/core/http-transport.d.ts +66 -0
  44. package/dist/core/http-transport.js +247 -0
  45. package/dist/core/http-transport.js.map +1 -0
  46. package/dist/core/index.d.ts +13 -0
  47. package/dist/core/index.js +16 -0
  48. package/dist/core/index.js.map +1 -0
  49. package/dist/core/insights.d.ts +176 -0
  50. package/dist/core/insights.js +417 -0
  51. package/dist/core/insights.js.map +1 -0
  52. package/dist/core/joiner-evidence.d.ts +98 -0
  53. package/dist/core/joiner-evidence.js +254 -0
  54. package/dist/core/joiner-evidence.js.map +1 -0
  55. package/dist/core/lab/credential-map.d.ts +50 -0
  56. package/dist/core/lab/credential-map.js +163 -0
  57. package/dist/core/lab/credential-map.js.map +1 -0
  58. package/dist/core/lab/javadate.d.ts +7 -0
  59. package/dist/core/lab/javadate.js +307 -0
  60. package/dist/core/lab/javadate.js.map +1 -0
  61. package/dist/core/lab/jsonpath.d.ts +11 -0
  62. package/dist/core/lab/jsonpath.js +273 -0
  63. package/dist/core/lab/jsonpath.js.map +1 -0
  64. package/dist/core/lab/policy-preview.d.ts +43 -0
  65. package/dist/core/lab/policy-preview.js +78 -0
  66. package/dist/core/lab/policy-preview.js.map +1 -0
  67. package/dist/core/lab/rfc5646.d.ts +2 -0
  68. package/dist/core/lab/rfc5646.js +421 -0
  69. package/dist/core/lab/rfc5646.js.map +1 -0
  70. package/dist/core/lab/transform-impact.d.ts +63 -0
  71. package/dist/core/lab/transform-impact.js +138 -0
  72. package/dist/core/lab/transform-impact.js.map +1 -0
  73. package/dist/core/lab/transform-people.d.ts +61 -0
  74. package/dist/core/lab/transform-people.js +132 -0
  75. package/dist/core/lab/transform-people.js.map +1 -0
  76. package/dist/core/lab/transforms.d.ts +79 -0
  77. package/dist/core/lab/transforms.js +738 -0
  78. package/dist/core/lab/transforms.js.map +1 -0
  79. package/dist/core/lab/velocity.d.ts +33 -0
  80. package/dist/core/lab/velocity.js +874 -0
  81. package/dist/core/lab/velocity.js.map +1 -0
  82. package/dist/core/lab/workflow-health.d.ts +80 -0
  83. package/dist/core/lab/workflow-health.js +234 -0
  84. package/dist/core/lab/workflow-health.js.map +1 -0
  85. package/dist/core/lab/workflows.d.ts +87 -0
  86. package/dist/core/lab/workflows.js +568 -0
  87. package/dist/core/lab/workflows.js.map +1 -0
  88. package/dist/core/lifecycle-gaps.d.ts +192 -0
  89. package/dist/core/lifecycle-gaps.js +389 -0
  90. package/dist/core/lifecycle-gaps.js.map +1 -0
  91. package/dist/core/logs.d.ts +145 -0
  92. package/dist/core/logs.js +342 -0
  93. package/dist/core/logs.js.map +1 -0
  94. package/dist/core/lookup.d.ts +129 -0
  95. package/dist/core/lookup.js +289 -0
  96. package/dist/core/lookup.js.map +1 -0
  97. package/dist/core/model-insights.d.ts +247 -0
  98. package/dist/core/model-insights.js +474 -0
  99. package/dist/core/model-insights.js.map +1 -0
  100. package/dist/core/narrow.d.ts +23 -0
  101. package/dist/core/narrow.js +137 -0
  102. package/dist/core/narrow.js.map +1 -0
  103. package/dist/core/nerm.d.ts +154 -0
  104. package/dist/core/nerm.js +397 -0
  105. package/dist/core/nerm.js.map +1 -0
  106. package/dist/core/operations-watch.d.ts +232 -0
  107. package/dist/core/operations-watch.js +491 -0
  108. package/dist/core/operations-watch.js.map +1 -0
  109. package/dist/core/output/csv.d.ts +6 -0
  110. package/dist/core/output/csv.js +22 -0
  111. package/dist/core/output/csv.js.map +1 -0
  112. package/dist/core/output/html.d.ts +11 -0
  113. package/dist/core/output/html.js +66 -0
  114. package/dist/core/output/html.js.map +1 -0
  115. package/dist/core/output/xlsx.d.ts +3 -0
  116. package/dist/core/output/xlsx.js +130 -0
  117. package/dist/core/output/xlsx.js.map +1 -0
  118. package/dist/core/output/zip.d.ts +16 -0
  119. package/dist/core/output/zip.js +106 -0
  120. package/dist/core/output/zip.js.map +1 -0
  121. package/dist/core/ownership.d.ts +39 -0
  122. package/dist/core/ownership.js +100 -0
  123. package/dist/core/ownership.js.map +1 -0
  124. package/dist/core/patterns.d.ts +11 -0
  125. package/dist/core/patterns.js +31 -0
  126. package/dist/core/patterns.js.map +1 -0
  127. package/dist/core/preview.d.ts +96 -0
  128. package/dist/core/preview.js +173 -0
  129. package/dist/core/preview.js.map +1 -0
  130. package/dist/core/roles.d.ts +125 -0
  131. package/dist/core/roles.js +420 -0
  132. package/dist/core/roles.js.map +1 -0
  133. package/dist/core/tenant.d.ts +67 -0
  134. package/dist/core/tenant.js +194 -0
  135. package/dist/core/tenant.js.map +1 -0
  136. package/dist/core/threat-signals.d.ts +112 -0
  137. package/dist/core/threat-signals.js +250 -0
  138. package/dist/core/threat-signals.js.map +1 -0
  139. package/dist/core/threat-watch.d.ts +144 -0
  140. package/dist/core/threat-watch.js +282 -0
  141. package/dist/core/threat-watch.js.map +1 -0
  142. package/dist/core/transport.d.ts +82 -0
  143. package/dist/core/transport.js +312 -0
  144. package/dist/core/transport.js.map +1 -0
  145. package/dist/core/types.d.ts +137 -0
  146. package/dist/core/types.js +10 -0
  147. package/dist/core/types.js.map +1 -0
  148. package/dist/core/warnings.d.ts +236 -0
  149. package/dist/core/warnings.js +504 -0
  150. package/dist/core/warnings.js.map +1 -0
  151. package/dist/demo/tenant.d.ts +1572 -0
  152. package/dist/demo/tenant.js +1023 -0
  153. package/dist/demo/tenant.js.map +1 -0
  154. package/dist/node/attribute-history.d.ts +22 -0
  155. package/dist/node/attribute-history.js +86 -0
  156. package/dist/node/attribute-history.js.map +1 -0
  157. package/dist/node/changes.d.ts +20 -0
  158. package/dist/node/changes.js +78 -0
  159. package/dist/node/changes.js.map +1 -0
  160. package/dist/node/cli.d.ts +2 -0
  161. package/dist/node/cli.js +291 -0
  162. package/dist/node/cli.js.map +1 -0
  163. package/dist/node/config.d.ts +72 -0
  164. package/dist/node/config.js +203 -0
  165. package/dist/node/config.js.map +1 -0
  166. package/dist/node/credentials.d.ts +13 -0
  167. package/dist/node/credentials.js +24 -0
  168. package/dist/node/credentials.js.map +1 -0
  169. package/dist/node/delivery.d.ts +10 -0
  170. package/dist/node/delivery.js +105 -0
  171. package/dist/node/delivery.js.map +1 -0
  172. package/dist/node/doctor.d.ts +2 -0
  173. package/dist/node/doctor.js +151 -0
  174. package/dist/node/doctor.js.map +1 -0
  175. package/dist/node/drift.d.ts +31 -0
  176. package/dist/node/drift.js +56 -0
  177. package/dist/node/drift.js.map +1 -0
  178. package/dist/node/evidence.d.ts +42 -0
  179. package/dist/node/evidence.js +129 -0
  180. package/dist/node/evidence.js.map +1 -0
  181. package/dist/node/exceptions.d.ts +30 -0
  182. package/dist/node/exceptions.js +83 -0
  183. package/dist/node/exceptions.js.map +1 -0
  184. package/dist/node/history.d.ts +35 -0
  185. package/dist/node/history.js +74 -0
  186. package/dist/node/history.js.map +1 -0
  187. package/dist/node/index.d.ts +7 -0
  188. package/dist/node/index.js +8 -0
  189. package/dist/node/index.js.map +1 -0
  190. package/dist/node/keep.d.ts +9 -0
  191. package/dist/node/keep.js +39 -0
  192. package/dist/node/keep.js.map +1 -0
  193. package/dist/node/loader.d.ts +7 -0
  194. package/dist/node/loader.js +35 -0
  195. package/dist/node/loader.js.map +1 -0
  196. package/dist/node/log-files.d.ts +16 -0
  197. package/dist/node/log-files.js +93 -0
  198. package/dist/node/log-files.js.map +1 -0
  199. package/dist/node/monthly.d.ts +41 -0
  200. package/dist/node/monthly.js +108 -0
  201. package/dist/node/monthly.js.map +1 -0
  202. package/dist/node/oauth-login.d.ts +45 -0
  203. package/dist/node/oauth-login.js +121 -0
  204. package/dist/node/oauth-login.js.map +1 -0
  205. package/dist/node/packs.d.ts +32 -0
  206. package/dist/node/packs.js +43 -0
  207. package/dist/node/packs.js.map +1 -0
  208. package/dist/node/privileged-seen.d.ts +11 -0
  209. package/dist/node/privileged-seen.js +41 -0
  210. package/dist/node/privileged-seen.js.map +1 -0
  211. package/dist/node/recipients.d.ts +17 -0
  212. package/dist/node/recipients.js +51 -0
  213. package/dist/node/recipients.js.map +1 -0
  214. package/dist/node/runner.d.ts +51 -0
  215. package/dist/node/runner.js +298 -0
  216. package/dist/node/runner.js.map +1 -0
  217. package/dist/node/runtime.d.ts +12 -0
  218. package/dist/node/runtime.js +13 -0
  219. package/dist/node/runtime.js.map +1 -0
  220. package/dist/node/schedules.d.ts +87 -0
  221. package/dist/node/schedules.js +141 -0
  222. package/dist/node/schedules.js.map +1 -0
  223. package/dist/node/secrets.d.ts +37 -0
  224. package/dist/node/secrets.js +219 -0
  225. package/dist/node/secrets.js.map +1 -0
  226. package/dist/node/support.d.ts +14 -0
  227. package/dist/node/support.js +133 -0
  228. package/dist/node/support.js.map +1 -0
  229. package/dist/node/tenants.d.ts +93 -0
  230. package/dist/node/tenants.js +255 -0
  231. package/dist/node/tenants.js.map +1 -0
  232. package/dist/node/ui-page.d.ts +1 -0
  233. package/dist/node/ui-page.js +3 -0
  234. package/dist/node/ui-page.js.map +1 -0
  235. package/dist/node/ui-server.d.ts +48 -0
  236. package/dist/node/ui-server.js +2665 -0
  237. package/dist/node/ui-server.js.map +1 -0
  238. package/dist/node/write.d.ts +9 -0
  239. package/dist/node/write.js +53 -0
  240. package/dist/node/write.js.map +1 -0
  241. package/dist/reports/builtin.generated.d.ts +1 -0
  242. package/dist/reports/builtin.generated.js +49 -0
  243. package/dist/reports/builtin.generated.js.map +1 -0
  244. package/dist/reports/library.d.ts +6 -0
  245. package/dist/reports/library.js +18 -0
  246. package/dist/reports/library.js.map +1 -0
  247. package/launcher/IdentityScope.cmd +11 -0
  248. package/package.json +69 -4
  249. package/reports/access-profile-members.yaml +29 -0
  250. package/reports/access-profile-membership-counts.yaml +17 -0
  251. package/reports/access-profiles-without-owner.yaml +16 -0
  252. package/reports/access-request-audit-trail.yaml +36 -0
  253. package/reports/accounts-by-source.yaml +19 -0
  254. package/reports/active-identities-without-manager.yaml +22 -0
  255. package/reports/aggregation-failures.yaml +29 -0
  256. package/reports/aggregation-history.yaml +27 -0
  257. package/reports/all-sources.yaml +16 -0
  258. package/reports/application-accounts.yaml +32 -0
  259. package/reports/application-entitlements.yaml +31 -0
  260. package/reports/campaign-progress.yaml +23 -0
  261. package/reports/certification-decisions.yaml +31 -0
  262. package/reports/direct-reports-per-manager.yaml +20 -0
  263. package/reports/disabled-accounts-of-active-people.yaml +33 -0
  264. package/reports/duplicate-emails.yaml +16 -0
  265. package/reports/entitlement-holders.yaml +35 -0
  266. package/reports/entitlements-held-by-inactive-identities.yaml +31 -0
  267. package/reports/entitlements-without-owner.yaml +28 -0
  268. package/reports/identities-by-lifecycle-state.yaml +15 -0
  269. package/reports/identities-missing-key-attributes.yaml +27 -0
  270. package/reports/identities-with-processing-errors.yaml +19 -0
  271. package/reports/identity-attribute-mappings.yaml +27 -0
  272. package/reports/machine-accounts.yaml +28 -0
  273. package/reports/managers-and-direct-reports.yaml +23 -0
  274. package/reports/most-access.yaml +18 -0
  275. package/reports/new-identities.yaml +24 -0
  276. package/reports/old-passwords.yaml +35 -0
  277. package/reports/pending-reviews-by-reviewer.yaml +20 -0
  278. package/reports/person-access.yaml +31 -0
  279. package/reports/privileged-access.yaml +29 -0
  280. package/reports/provisioning-error-causes.yaml +27 -0
  281. package/reports/provisioning-errors.yaml +32 -0
  282. package/reports/provisioning-failures.yaml +28 -0
  283. package/reports/recent-access-requests.yaml +22 -0
  284. package/reports/recent-activity.yaml +32 -0
  285. package/reports/recent-leavers.yaml +34 -0
  286. package/reports/role-members.yaml +29 -0
  287. package/reports/role-membership-counts.yaml +18 -0
  288. package/reports/roles-without-owner.yaml +17 -0
  289. package/reports/sources-needing-attention.yaml +23 -0
  290. package/reports/stuck-access-requests.yaml +29 -0
  291. package/reports/team-access.yaml +30 -0
  292. package/reports/terminated-users-with-active-accounts.yaml +46 -0
  293. package/reports/uncorrelated-accounts.yaml +38 -0
  294. package/ui/js/00-setup.js +6 -0
  295. package/ui/js/01-small-helpers.js +143 -0
  296. package/ui/js/02-connection.js +150 -0
  297. package/ui/js/03-health-check.js +17 -0
  298. package/ui/js/04-library.js +135 -0
  299. package/ui/js/05-pickers.js +163 -0
  300. package/ui/js/06-report-view.js +157 -0
  301. package/ui/js/07-fields.js +85 -0
  302. package/ui/js/08-designer.js +360 -0
  303. package/ui/js/09-yaml.js +22 -0
  304. package/ui/js/10-instant-check.js +171 -0
  305. package/ui/js/11-lookup.js +161 -0
  306. package/ui/js/12-tenant.js +115 -0
  307. package/ui/js/13-source-configuration-and-diagnostics.js +64 -0
  308. package/ui/js/14-certifications.js +68 -0
  309. package/ui/js/15-monthly-report.js +24 -0
  310. package/ui/js/16-ownership.js +39 -0
  311. package/ui/js/17-compare-tenants.js +102 -0
  312. package/ui/js/18-audit.js +181 -0
  313. package/ui/js/19-insights.js +108 -0
  314. package/ui/js/20-role-mining.js +35 -0
  315. package/ui/js/21-share-reports.js +45 -0
  316. package/ui/js/22-partner-overview-all-customer-tenants.js +228 -0
  317. package/ui/js/23-in-app-guidance.js +217 -0
  318. package/ui/js/24-role-tools.js +220 -0
  319. package/ui/js/25-schedules.js +264 -0
  320. package/ui/js/26-start.js +7 -0
  321. package/ui/js/27-warnings.js +224 -0
  322. package/ui/js/28-audit-readiness.js +99 -0
  323. package/ui/js/29-lifecycle.js +182 -0
  324. package/ui/js/30-labs.js +265 -0
  325. package/ui/js/31-build.js +203 -0
  326. package/ui/js/32-lab-examples.js +148 -0
  327. package/ui/js/33-finder.js +89 -0
  328. package/ui/js/34-governance.js +129 -0
  329. package/ui/js/35-watch.js +266 -0
  330. package/ui/js/36-model.js +247 -0
  331. package/ui/js/37-logs-and-watch.js +224 -0
  332. package/ui/shell.html +112 -0
  333. package/ui/style.css +350 -0
@@ -0,0 +1,224 @@
1
+ // ---------- Warnings: what breaks on a date or stalls without anyone noticing ----------
2
+ function wnState() {
3
+ if (!state.wn) state.wn = { tab: 'ending', ending: { days: 30 }, stuck: {}, reminders: { days: 7 }, people: { days: 30 }, admins: {}, catalog: { q: '' }, growth: {}, settings: null };
4
+ return state.wn;
5
+ }
6
+ var WN_TABS = [
7
+ ['joiners', 'Missed joiners', 'up', 'Active people missing an account that nearly everyone in their identity profile has, and people past their start date still in a pre-hire state.'],
8
+ ['movers', 'Mover leftovers', 'people', 'Access that almost no one else in the person\u2019s group has: often left over from a previous job (movers) or given as a one-off.'],
9
+ ['leavers', 'Missed leavers', 'people', 'People whose HR account is disabled but who are active in ISC, and leavers who still have enabled accounts, roles or access profiles.'],
10
+ ['expiry', 'Accounts expiring', 'clock', 'Accounts whose expiry date (Active Directory accountExpires, or any date attribute you name) is close, and expired accounts that are still enabled.'],
11
+ ['revokes', 'Revokes not done', 'cert', 'Access a reviewer revoked in a certification that the person still has after sign-off.'],
12
+ ['massch', 'Mass changes', 'pulse', 'Days with far more disables, deletes, new accounts or removed access than usual: a bad HR file or transform can change thousands of accounts overnight.'],
13
+ ['loops', 'Provisioning loops', 'lifecycle', 'The same change sent to the same account again and again: an attribute sync that never sticks or a request ISC keeps re-sending.'],
14
+ ['outside', 'Changed outside ISC', 'eye', 'Accounts disabled on the application although ISC never disabled them, and accounts enabled again after ISC disabled them.'],
15
+ ['syncdrift', 'Attribute sync drift', 'cols', 'Synced attributes whose value on the account differs from ISC, and attribute syncs that failed.'],
16
+ ['groupappr', 'Group approvals', 'people', 'Access approvals waiting on a governance group, with how many members can still approve.'],
17
+ ['mgrleft', 'Manager left', 'people', 'Active people (contractors included) whose manager or sponsor has left: their approvals and reviews reach nobody.'],
18
+ ['aggsafe', 'Aggregation safety', 'pulse', 'Per source: the delete threshold, failed aggregations, and sources that did not aggregate at all.'],
19
+ ['svc', 'Service accounts', 'code', 'Service and machine accounts without an owner, with an owner who left, or not used for a long time, and who owns which.'],
20
+ ['multi', 'Several accounts', 'people', 'People with more than one account on the same source; on the authoritative source this usually means a duplicate HR record or a rehire.'],
21
+ ['pwfail', 'Password failures', 'shield', 'Password changes, resets and syncs that failed, per person and source.'],
22
+ ['lcset', 'Lifecycle settings', 'lifecycle', 'What each lifecycle state does to accounts and access, and leaver states that leave accounts switched on.'],
23
+ ['govgroups', 'Governance groups', 'people', 'Governance groups with no members, only members who left, an owner who left, or no use anywhere.'],
24
+ ['signins', 'Sign-in signals', 'shield', 'Many failed sign-ins for one person, a sign-in right after a run of failures, sign-ins by people who have left, and one network address trying many people.'],
25
+ ['selfappr', 'Self-approvals', 'eye', 'Access requests approved by the person who gets the access, or by the person who asked for it on someone’s behalf.'],
26
+ ['adminact', 'Admin activity', 'code', 'Who changed tenant settings, sources, admins and access items, with changes made by people who have left or by something that is not a person.'],
27
+ ['spikes', 'Access spikes', 'pulse', 'People who were given an unusual number of access items in one day.'],
28
+ ['privgain', 'Privileged access gained', 'shield', 'Privileged entitlements people hold now and did not hold at the previous look, and whether ISC provisioned them or they appeared on the application.'],
29
+ ['outacct', 'Accounts created outside ISC', 'eye', 'New accounts ISC found on a source and did not create itself, with the ones nobody owns or that already have access first.'],
30
+ ['sensitive', 'Sensitive changes', 'code', 'Configuration changes that touch a control (rules, lifecycle states, sources, password and SOD policies, event subscriptions) and new API credentials, with who made them where ISC says.'],
31
+ ['risk', 'Risk by person', 'people', 'The signals of all threat screens added up per person: someone who shows on several screens comes first.'],
32
+ ['upcoming', 'Coming up', 'clock', 'Who starts or ends in the next days, the lifecycle state they are in now and what the states of their identity profile are set to do. Before the day, not after.'],
33
+ ['stuckreq', 'Stuck requests', 'pulse', 'Access requests still running after a day or more: the phase each waits in and on whom, next to the sources ISC keeps re-sending the same change to.'],
34
+ ['ending', 'Access ending', 'clock', 'Access granted with an end date. ISC removes it on that date; renew it before then if it is still needed.'],
35
+ ['stuck', 'Waiting on leavers', 'people', 'Certification reviews and access approvals assigned to someone who left. They do not move until someone reassigns them.'],
36
+ ['reminders', 'Review deadlines', 'cert', 'Certifications still open close to their deadline, per reviewer, so you can send reminders in time.'],
37
+ ['people', 'End dates', 'lifecycle', 'Active people whose end date is coming up, and people still active after their end date.'],
38
+ ['admins', 'ISC admins', 'shield', 'Who holds a user level in ISC itself, such as Org admin, and who of them has left.'],
39
+ ['catalog', 'Access catalog', 'apps', 'Requestable access without a description or owner: people request the wrong thing and approvals stall.'],
40
+ ['growth', 'Identity count', 'up', 'How many identities you have, how fast the number grows, and when you reach your licensed number.'],
41
+ ['quality', 'Identity data', 'people', 'Active people without a manager, email or a key attribute, and emails used by more than one person.']
42
+ ];
43
+ function renderWarnings() {
44
+ var W = wnState();
45
+ var outer = $('warnings');
46
+ outer.textContent = '';
47
+ var w = el('div', { className: 'wrap', style: 'max-width:1240px' });
48
+ outer.appendChild(w);
49
+ w.appendChild(el('div', { className: 'rhead', style: 'margin-bottom:4px' }, el('span', { className: 'cat-ico', style: 'color:#b45309;background:#fef3c7' }, icon('clock')),
50
+ el('div', {}, el('h2', { text: 'Warnings' }), el('p', { className: 'desc', text: 'Things that break on a date or stall quietly, found before someone notices the hard way. Read-only.' }))));
51
+ groupedTabs(w, 'wn', WN_GROUPS, WN_TABS, W.tab, function (id) { W.tab = id; renderWarnings(); });
52
+ var spec = WN_TABS.filter(function (t) { return t[0] === W.tab; })[0];
53
+ if (!W.settings && (W.tab === 'people' || W.tab === 'growth')) {
54
+ W.settings = 'loading';
55
+ api('/api/warnings/settings').then(function (s) { W.settings = s; }, function () { W.settings = {}; }).then(function () { if (state.page === 'warnings') renderWarnings(); });
56
+ }
57
+ ({ ending: wnEnding, stuck: wnStuck, reminders: wnReminders, people: wnPeople, admins: wnAdmins, catalog: wnCatalog, growth: wnGrowth, quality: wnQuality, joiners: wnJoiners, leavers: wnLeavers, expiry: wnExpiry, revokes: wnRevokes, massch: wnMassChange, signins: wnSignIns, selfappr: wnSelfApprovals, adminact: wnAdminActivity, spikes: wnAccessSpikes, lcset: wnLifecycleSettings, govgroups: wnGovGroups, aggsafe: wnAggSafety, svc: wnServiceAccounts, multi: wnMultiAccounts, pwfail: wnPasswordFailures, loops: wnLoops, outside: wnOutside, syncdrift: wnSyncDrift, groupappr: wnGroupApprovals, mgrleft: wnManagerLeft, privgain: wnPrivGained, outacct: wnOutsideAccounts, sensitive: wnSensitive, risk: wnRisk, upcoming: wnUpcoming, stuckreq: wnStuckReq, movers: function (w) { renderMovers(w); } })[W.tab](w, W[W.tab] || {}, spec[3]);
58
+ }
59
+ function wnRunBar(w, H, path, label, desc, extras, body) {
60
+ w.appendChild(el('div', { className: 'bar', style: 'margin-bottom:14px' }, el('span', { className: 'muted', style: 'flex:1;min-width:260px', text: desc }), extras || null,
61
+ el('button', { className: 'btn primary', disabled: !!H.busy, onclick: function () { runJobInto(H, '/api/warnings/' + path + '/run', body ? body() : {}, renderWarnings); } }, icon('play'), H.data ? 'Read again' : label)));
62
+ if (H.busy) { w.appendChild(busyBox(H.busy)); return false; }
63
+ if (H.error) { w.appendChild(el('div', { className: 'error', text: H.error })); return false; }
64
+ if (!H.data) return false;
65
+ (H.data.notes || []).forEach(function (n) { w.appendChild(el('div', { className: 'note', text: n })); });
66
+ return true;
67
+ }
68
+ function daysSelect(H, options, label) {
69
+ var s = el('select', { className: 'input', style: 'width:auto', 'aria-label': label }, options.map(function (o) { return el('option', { value: String(o[0]), text: o[1] }); }));
70
+ s.value = String(H.days);
71
+ s.addEventListener('change', function () { H.days = Number(s.value); });
72
+ return s;
73
+ }
74
+ function stat(n, label, tone) { return el('div', { className: 'bigstat' + (tone && n ? ' ' + tone : '') }, el('b', { text: n === null || n === undefined ? '—' : fmtNum(n) }), el('span', { text: label })); }
75
+ function pill(text, tone) { return el('span', { className: 'chg ' + tone, text: text }); }
76
+ function statusPill(s) { return !s || s === 'active' ? null : pill(s === 'left' ? 'has left' : s, 'lose'); }
77
+ function daysText(n) { return n === 0 ? 'today' : n === 1 ? 'tomorrow' : n < 0 ? (-n) + ' days ago' : 'in ' + n + ' days'; }
78
+
79
+ function wnEnding(w, H, desc) {
80
+ var sel = daysSelect(H, [[7, 'Next 7 days'], [14, 'Next 14 days'], [30, 'Next 30 days'], [90, 'Next 90 days']], 'Period');
81
+ if (!wnRunBar(w, H, 'access-ending', 'Find access ending', desc, sel, function () { return { days: H.days }; })) return;
82
+ var d = H.data;
83
+ w.appendChild(el('div', { className: 'bigstats' }, stat(d.rows.length, 'items end in the next ' + d.days + ' days'), stat(d.rows.filter(function (r) { return r.daysLeft <= 7; }).length, 'within 7 days', 'lose'), stat(d.byManager.length, 'managers to tell')));
84
+ if (!d.rows.length) { w.appendChild(el('p', { className: 'muted', text: 'No access with an end date in this period.' })); return; }
85
+ w.appendChild(section('By manager', d.byManager.length, simpleTable(['Manager', 'Items ending', 'Soonest'], d.byManager.map(function (m) { return [m.manager, m.count, daysText(m.soonest)]; }))));
86
+ w.appendChild(section('Access ending', d.rows.length, el('div', {}, el('div', { className: 'bar', style: 'justify-content:flex-end;margin-bottom:8px' }, downloads(H.job)),
87
+ simpleTable(['Person', 'Access', 'Type', 'Ends', 'Manager', 'Requested by'], d.rows.slice(0, 2000).map(function (r) {
88
+ return [el('span', {}, r.person, ' ', statusPill(r.personStatus)), r.access, r.type, el('span', { style: 'white-space:nowrap' }, r.removeDate.slice(0, 10) + ' ', pill(daysText(r.daysLeft), r.daysLeft <= 7 ? 'lose' : 'off')), r.manager, r.requester];
89
+ })))));
90
+ w.appendChild(el('p', { className: 'muted small', text: 'From completed access requests that had an end date. Access removed earlier by another route may still show here.' }));
91
+ }
92
+
93
+ function wnStuck(w, H, desc) {
94
+ if (!wnRunBar(w, H, 'stuck', 'Find stuck items', desc)) return;
95
+ var d = H.data;
96
+ w.appendChild(el('div', { className: 'bigstats' }, stat(d.totals.reviews, 'certification reviews', 'lose'), stat(d.totals.approvals, 'access approvals', 'lose')));
97
+ if (!d.rows.length) w.appendChild(el('div', { className: 'banner ok' }, el('b', { text: 'Nothing is waiting on people who left' })));
98
+ else w.appendChild(section('Waiting on people who left', d.rows.length, el('div', {}, el('div', { className: 'bar', style: 'justify-content:flex-end;margin-bottom:8px' }, downloads(H.job)),
99
+ simpleTable(['What', 'Item', 'Waiting on', 'When'], d.rows.map(function (r) { return [r.kind, r.item, el('span', {}, r.waitingOn, ' ', statusPill(r.status)), r.detail]; })))));
100
+ w.appendChild(el('p', { className: 'muted small' }, 'Reassign them in ISC: certification reviews from the campaign, approvals from the request. Objects owned by people who left (sources, roles, access profiles) are on ',
101
+ el('button', { className: 'btn link', style: 'padding:0', text: 'Lookup → Ownership', onclick: function () { state.lk.tab = 'ownership'; showPage('lookup'); } }), '.'));
102
+ }
103
+
104
+ function wnReminders(w, H, desc) {
105
+ var sel = daysSelect(H, [[3, 'Due within 3 days'], [7, 'Due within 7 days'], [14, 'Due within 14 days'], [30, 'Due within 30 days']], 'Due within');
106
+ if (!wnRunBar(w, H, 'reminders', 'Find reviews due', desc, sel, function () { return { days: H.days }; })) return;
107
+ var d = H.data;
108
+ var left = d.reviewers.reduce(function (a, r) { return a + r.decisionsLeft; }, 0);
109
+ w.appendChild(el('div', { className: 'bigstats' }, stat(d.reviewers.length, 'reviewers to remind'), stat(d.rows.length, 'open certifications'), stat(left, 'decisions still to make'), stat(d.rows.filter(function (r) { return r.daysLeft < 0; }).length, 'already overdue', 'lose')));
110
+ if (!d.rows.length) { w.appendChild(el('p', { className: 'muted', text: 'No open certification is due in this period.' })); return; }
111
+ var copy = el('button', { className: 'btn sm', disabled: !d.emails.length, onclick: function () {
112
+ try { navigator.clipboard.writeText(d.emails.join('; ')).then(function () { toast(d.emails.length + ' email addresses copied'); }, function () { toast('Could not copy; select them from the download instead'); }); } catch (e) { toast('Could not copy; select them from the download instead'); }
113
+ } }, icon('copy'), 'Copy reviewer emails');
114
+ var mail = d.emails.length ? el('a', { className: 'btn sm', href: 'mailto:?bcc=' + encodeURIComponent(d.emails.join(',')) + '&subject=' + encodeURIComponent('Reminder: your access review is due soon') + '&body=' + encodeURIComponent('Hello,\n\nYou have an access review in SailPoint that is due soon. Please open SailPoint, go to Certifications, and complete your decisions before the deadline.\n\nThank you.') }, icon('inbox'), 'Email draft (BCC)') : null;
115
+ w.appendChild(section('Reviewers', d.reviewers.length, el('div', {}, el('div', { className: 'bar', style: 'justify-content:flex-end;margin-bottom:8px' }, copy, mail, downloads(H.job)),
116
+ simpleTable(['Reviewer', 'Email', 'Certifications', 'Decisions left', 'Soonest deadline', 'Campaigns'], d.reviewers.map(function (r) {
117
+ return [el('span', {}, r.reviewer, ' ', statusPill(r.status)), r.email, r.certifications, r.decisionsLeft, r.soonest === null ? null : pill(daysText(r.soonest), r.soonest <= 2 ? 'lose' : 'off'), r.campaigns.join(', ')];
118
+ })))));
119
+ w.appendChild(el('p', { className: 'muted small' }, 'Reviewers who left are not in the copied emails; reassign their reviews instead (see "Waiting on leavers"). For progress, approve rates and rubber-stamped reviews, see ',
120
+ el('button', { className: 'btn link', style: 'padding:0', text: 'Audit > Certifications', onclick: function () { state.au.tab = 'certs'; showPage('certs'); } }), '.'));
121
+ }
122
+
123
+ function wnPeople(w, H, desc) {
124
+ var W = wnState();
125
+ var st = W.settings && W.settings !== 'loading' ? W.settings : null;
126
+ var p = (st && st.people) || {};
127
+ var attr = el('input', { className: 'input', value: p.endDateAttribute || '', placeholder: 'endDate', style: 'max-width:220px', 'aria-label': 'End-date attribute' });
128
+ var q = el('input', { className: 'input', value: p.query || '', placeholder: 'All active identities, or e.g. attributes.employeeType:contractor', style: 'max-width:420px', 'aria-label': 'Which identities' });
129
+ var msg = el('span');
130
+ w.appendChild(el('section', { className: 'card' }, el('div', { className: 'card-h' }, el('h3', { text: 'Settings' })),
131
+ el('div', { className: 'bar' },
132
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Identity attribute with the end date' }), attr),
133
+ el('label', { className: 'field', style: 'margin:0;flex:1' }, el('span', { className: 'lbl', text: 'Which identities (search query, optional)' }), q),
134
+ el('button', { className: 'btn', style: 'align-self:flex-end', onclick: function () {
135
+ msg.textContent = '';
136
+ api('/api/warnings/settings', 'PUT', { people: { endDateAttribute: attr.value.trim(), query: q.value.trim() } }).then(function () { W.settings = null; toast('Saved. The instant check now includes "Active after end date".'); renderWarnings(); }).catch(function (e) { msg.appendChild(el('div', { className: 'error', text: errorText(e) })); });
137
+ } }, icon('save'), 'Save')), msg,
138
+ el('p', { className: 'muted small', style: 'margin:8px 0 0', text: 'Use the name of the identity attribute as in the identity profile (not the display name). Dates like 2026-12-31, 12/31/2026 or epoch numbers are understood.' })));
139
+ var sel = daysSelect(H, [[7, 'Ending within 7 days'], [30, 'Ending within 30 days'], [90, 'Ending within 90 days']], 'Ending within');
140
+ if (!wnRunBar(w, H, 'people', 'Check end dates', desc, sel, function () { return { days: H.days }; })) return;
141
+ var d = H.data;
142
+ w.appendChild(el('div', { className: 'bigstats' }, stat(d.pastEnd.length, 'still active after end date', 'lose'), stat(d.endingSoon.length, 'ending within ' + d.days + ' days'), stat(d.withDate, 'of ' + fmtNum(d.checked) + ' have an end date')));
143
+ var tbl = function (list, label) { return simpleTable(['Person', 'End date', 'Manager', 'Lifecycle state'], list.slice(0, 2000).map(function (r) { return [r.person, el('span', { style: 'white-space:nowrap' }, r.endDate.slice(0, 10) + ' ', pill(daysText(r.daysLeft), r.daysLeft < 0 ? 'lose' : 'off')), r.manager, r.lifecycle]; }), label); };
144
+ if (d.pastEnd.length) w.appendChild(section('Still active after their end date', d.pastEnd.length, el('div', {}, el('div', { className: 'bar', style: 'justify-content:flex-end;margin-bottom:8px' }, downloads(H.job)), tbl(d.pastEnd, 'People still active after their end date'))));
145
+ if (d.endingSoon.length) w.appendChild(section('Ending soon', d.endingSoon.length, tbl(d.endingSoon, 'People ending soon')));
146
+ if (!d.pastEnd.length && !d.endingSoon.length && d.withDate) w.appendChild(el('div', { className: 'banner ok' }, el('b', { text: 'No one is past or near their end date' })));
147
+ w.appendChild(el('p', { className: 'muted small', text: 'People past their end date usually mean the HR source still sends them as active, or the lifecycle state does not react to the end date. Check with HR before disabling anyone.' }));
148
+ }
149
+
150
+ function wnAdmins(w, H, desc) {
151
+ if (!wnRunBar(w, H, 'admins', 'List ISC admins', desc)) return;
152
+ var d = H.data;
153
+ var fresh = d.rows.filter(function (r) { return r.isNew; }).length;
154
+ w.appendChild(el('div', { className: 'bigstats' }, stat(d.totals.people, 'people with a user level'), stat(d.totals.orgAdmins, 'Org admins'), stat(d.totals.left, 'who have left', 'lose'), stat(d.since ? fresh : null, d.since ? 'new since ' + d.since.slice(0, 10) : 'new: from the next look on', 'lose')));
155
+ w.appendChild(el('div', { style: 'display:grid;grid-template-columns:minmax(220px,1fr) 3fr;gap:16px;align-items:start' },
156
+ section('By user level', d.byLevel.length, simpleTable(['User level', 'People'], d.byLevel.map(function (l) { return [levelName(l.level), l.people]; }))),
157
+ section('People', d.rows.length, el('div', {}, el('div', { className: 'bar', style: 'justify-content:flex-end;margin-bottom:8px' }, downloads(H.job)),
158
+ simpleTable(['Person', 'User levels', 'Lifecycle state', 'Status'], d.rows.map(function (r) {
159
+ return [el('span', {}, r.person, r.email ? el('div', { className: 'muted small', text: r.email }) : null), r.levels.map(levelName).join(', '), r.lifecycle, el('span', {}, statusPill(r.status), r.isNew ? pill('new', 'off') : null)];
160
+ }))))));
161
+ w.appendChild(el('p', { className: 'muted small', text: 'User levels are the "IdentityNow" source entitlements found by search. Last sign-in is not shown: ISC gives it per person through another API. Remove user levels in ISC under Admin > Identities > the person > User level.' }));
162
+ }
163
+ function levelName(l) {
164
+ var M = { ORG_ADMIN: 'Org admin', CERT_ADMIN: 'Certification admin', HELPDESK: 'Help desk', DASHBOARD: 'Dashboard', REPORT_ADMIN: 'Report admin', ROLE_ADMIN: 'Role admin', ROLE_SUBADMIN: 'Role sub-admin', SOURCE_ADMIN: 'Source admin', SOURCE_SUBADMIN: 'Source sub-admin', SAAS_MANAGEMENT_ADMIN: 'SaaS management admin', SAAS_MANAGEMENT_READER: 'SaaS management reader' };
165
+ return M[l] || l;
166
+ }
167
+
168
+ function wnCatalog(w, H, desc) {
169
+ if (!wnRunBar(w, H, 'catalog', 'Check the catalog', desc)) return;
170
+ var d = H.data, T = d.totals;
171
+ w.appendChild(el('div', { className: 'bigstats' }, stat(T.score === null ? null : T.score, 'quality score (% complete)'), stat(T.items, 'requestable items'), stat(T.noDescription, 'without a description', 'lose'), stat(T.noOwner, 'without an owner', 'lose'), stat(T.ownerLeft, 'owner has left', 'lose')));
172
+ w.appendChild(section('By source', d.bySource.length, simpleTable(['Source', 'Requestable items', 'Complete', 'Score'], d.bySource.map(function (s) { return [s.source, s.items, s.complete, progressBar(s.score, s.score < 60)]; }))));
173
+ if (d.unused) {
174
+ w.appendChild(section('Nobody has it', d.unused.length, d.unused.length ? el('div', {},
175
+ el('p', { className: 'muted', text: 'Roles and access profiles that no identity holds, out of ' + fmtNum(T.unusedChecked || 0) + ' checked. Candidates to retire, or roles whose membership criteria match nobody (check those with Role tools > Preview a role change).' }),
176
+ simpleTable(['Type', 'Name', 'Source', 'Owner', 'Requestable', 'Enabled'], d.unused.slice(0, 2000).map(function (r) { return [r.type, r.name, r.source || null, r.owner || null, r.requestable ? 'yes' : 'no', r.enabled ? 'yes' : pill('disabled', 'off')]; }), 'Roles and access profiles nobody has'))
177
+ : el('p', { className: 'muted', text: 'Every role and access profile checked (' + fmtNum(T.unusedChecked || 0) + ') is held by at least one identity.' })));
178
+ }
179
+ if (!d.rows.length) return;
180
+ var f = el('input', { className: 'input', placeholder: 'Filter by name, source or owner...', value: H.q || '', style: 'max-width:300px', 'aria-label': 'Filter' });
181
+ var box = el('div');
182
+ var draw = function () {
183
+ var q = (H.q || '').toLowerCase();
184
+ var list = d.rows.filter(function (r) { return !q || (r.name + ' ' + (r.source || '') + ' ' + (r.owner || '')).toLowerCase().indexOf(q) >= 0; });
185
+ box.textContent = '';
186
+ box.appendChild(simpleTable(['Type', 'Name', 'Source', 'Owner', 'Missing'], list.slice(0, 2000).map(function (r) { return [r.type, r.name, r.source, r.owner, el('span', {}, r.issues.map(function (x) { return el('span', { className: 'chg ' + (/left|longer/.test(x) ? 'lose' : 'off'), style: 'margin:0 4px 2px 0;display:inline-block', text: x }); }))]; })));
187
+ if (list.length > 2000 || d.more) box.appendChild(el('p', { className: 'muted small', text: 'Showing the first 2,000. The download has all of them.' }));
188
+ };
189
+ f.addEventListener('input', function () { H.q = f.value; draw(); });
190
+ w.appendChild(section('Items to fix', d.rows.length + (d.more || 0), el('div', {}, el('div', { className: 'bar', style: 'margin-bottom:10px' }, f, el('span', { style: 'flex:1' }), downloads(H.job)), box)));
191
+ draw();
192
+ }
193
+
194
+ function wnGrowth(w, H, desc) {
195
+ var W = wnState();
196
+ var st = W.settings && W.settings !== 'loading' ? W.settings : {};
197
+ var lic = el('input', { className: 'input', type: 'number', min: '1', value: st.licensed || '', placeholder: 'e.g. 10000', style: 'max-width:160px', 'aria-label': 'Licensed identities' });
198
+ var basis = el('select', { className: 'input', style: 'width:auto', 'aria-label': 'Count' }, [['all', 'All identities'], ['active', 'Active identities only']].map(function (o) { return el('option', { value: o[0], text: o[1] }); }));
199
+ basis.value = st.basis || 'all';
200
+ var msg = el('span');
201
+ w.appendChild(el('section', { className: 'card' }, el('div', { className: 'card-h' }, el('h3', { text: 'Your license' })),
202
+ el('div', { className: 'bar' },
203
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Licensed identities' }), lic),
204
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Count' }), basis),
205
+ el('button', { className: 'btn', style: 'align-self:flex-end', onclick: function () {
206
+ msg.textContent = '';
207
+ api('/api/warnings/settings', 'PUT', { licensed: lic.value === '' ? '' : Number(lic.value), basis: basis.value }).then(function () { W.settings = null; toast('Saved'); renderWarnings(); }).catch(function (e) { msg.appendChild(el('div', { className: 'error', text: errorText(e) })); });
208
+ } }, icon('save'), 'Save')), msg));
209
+ if (!wnRunBar(w, H, 'growth', 'Count identities', desc)) return;
210
+ var d = H.data;
211
+ var cur = d.basis === 'active' ? d.active : d.total;
212
+ var pace = d.netPerMonth !== null ? d.netPerMonth : d.addedPerMonth;
213
+ w.appendChild(el('div', { className: 'bigstats' }, stat(d.total, 'identities'), stat(d.active, 'active'), stat(pace, d.forecastFrom === 'kept counts' ? 'net change per month' : 'new per month (3-month average)'),
214
+ d.licensed ? stat(d.licensed - cur, 'left of your ' + fmtNum(d.licensed), d.licensed - cur < 0 ? 'lose' : '') : null));
215
+ if (d.licensed) {
216
+ var used = cur === null ? 0 : Math.round((cur * 100) / d.licensed);
217
+ var when = d.monthsToLicensed === null ? (pace && pace > 0 ? null : 'not growing at the current pace') : d.monthsToLicensed === 0 ? 'already reached' : 'in about ' + d.monthsToLicensed + ' months (' + new Date(Date.now() + d.monthsToLicensed * 30.4 * 86400000).toISOString().slice(0, 7) + ')';
218
+ w.appendChild(el('div', { className: 'banner ' + (used >= 100 ? 'bad' : d.monthsToLicensed !== null && d.monthsToLicensed <= 6 ? 'warn' : 'ok') }, el('b', { text: used + '% of your license used' }), when ? el('span', { text: 'Licensed number reached ' + when }) : null));
219
+ } else w.appendChild(el('div', { className: 'note', text: 'Enter your licensed number above to see when you reach it.' }));
220
+ var max = Math.max.apply(null, d.monthly.map(function (m) { return m.added || 0; }).concat([1]));
221
+ w.appendChild(section('New identities per month', d.monthly.length, el('div', {}, el('div', { className: 'bar', style: 'justify-content:flex-end;margin-bottom:8px' }, downloads(H.job)),
222
+ simpleTable(['Month', 'New identities', 'Compared'], d.monthly.map(function (m) { return [m.month, m.added, m.added === null ? null : el('div', { className: 'meter', style: 'width:240px;margin:4px 0' }, el('span', { style: 'width:' + Math.round(((m.added || 0) * 100) / max) + '%' }))]; })))));
223
+ if (d.history && d.history.length > 1) w.appendChild(section('Counts kept on this computer', d.history.length, simpleTable(['Date', 'Identities', 'Active'], d.history.slice(-12).reverse().map(function (p) { return [p.date, p.total, p.active]; }))));
224
+ }
@@ -0,0 +1,99 @@
1
+ // ---------- Audit readiness: access outliers, review coverage, provisioning speed (Audit); identity data (Warnings) ----------
2
+ function arState() {
3
+ if (!state.ar) state.ar = { outliers: { groupBy: 'department', factor: 3 }, coverage: { months: 12 }, speed: { days: 30, limit: 24 }, quality: { attribute: 'department' } };
4
+ return state.ar;
5
+ }
6
+ function arRunBar(w, H, path, label, desc, extras, body, rerender) {
7
+ w.appendChild(el('div', { className: 'bar', style: 'margin-bottom:14px' }, el('span', { className: 'muted', style: 'flex:1;min-width:260px', text: desc }), extras || null,
8
+ el('button', { className: 'btn primary', disabled: !!H.busy, onclick: function () { runJobInto(H, '/api/audit/' + path + '/run', body ? body() : {}, rerender); } }, icon('play'), H.data ? 'Read again' : label)));
9
+ if (H.busy) { w.appendChild(busyBox(H.busy)); return false; }
10
+ if (H.error) { w.appendChild(el('div', { className: 'error', text: H.error })); return false; }
11
+ if (!H.data) return false;
12
+ (H.data.notes || []).forEach(function (n) { w.appendChild(el('div', { className: 'note', text: n })); });
13
+ return true;
14
+ }
15
+ function attrInput(H, key, label, placeholder) {
16
+ var i = el('input', { className: 'input', value: H[key] || '', placeholder: placeholder, style: 'max-width:180px', 'aria-label': label });
17
+ i.addEventListener('input', function () { H[key] = i.value.trim(); });
18
+ return el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: label }), i);
19
+ }
20
+ function numSelect(H, key, options, label) {
21
+ var s = el('select', { className: 'input', style: 'width:auto', 'aria-label': label }, options.map(function (o) { return el('option', { value: String(o[0]), text: o[1] }); }));
22
+ s.value = String(H[key]);
23
+ s.addEventListener('change', function () { H[key] = Number(s.value); });
24
+ return s;
25
+ }
26
+ function hoursText(h) { return h < 1 ? Math.round(h * 60) + ' min' : h < 48 ? (Math.round(h * 10) / 10) + ' h' : (Math.round(h / 2.4) / 10) + ' days'; }
27
+
28
+ // access outliers
29
+ function renderOutliers(w) {
30
+ var H = arState().outliers;
31
+ var extras = el('div', { className: 'bar' }, attrInput(H, 'groupBy', 'Compare people by attribute', 'department'),
32
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Outlier when at least' }), numSelect(H, 'factor', [[2, '2× the group median'], [3, '3× the group median'], [5, '5× the group median']], 'Outlier factor')));
33
+ if (!arRunBar(w, H, 'outliers', 'Find outliers', 'People with far more access than others in the same group. Groups need at least 5 people; a difference of 10 items or more counts.', extras, function () { return { groupBy: H.groupBy || 'department', factor: H.factor }; }, renderAudit)) return;
34
+ var d = H.data;
35
+ w.appendChild(el('div', { className: 'bigstats' }, stat(d.rows.length, 'outliers', 'lose'), stat(d.groups.length, 'groups compared'), stat(d.checked, 'active people checked'), stat(d.skippedSmallGroups, 'in groups too small to compare')));
36
+ if (d.rows.length) w.appendChild(section('Outliers', d.rows.length, el('div', {}, el('div', { className: 'bar', style: 'justify-content:flex-end;margin-bottom:8px' }, downloads(H.job)),
37
+ simpleTable(['Person', 'Group (' + d.groupBy + ')', 'Access items', 'Group median', 'Times', 'Entitlements', 'Roles'], d.rows.slice(0, 2000).map(function (r) {
38
+ return [el('span', {}, r.person, r.email ? el('div', { className: 'muted small', text: r.email }) : null), r.group, r.access, r.groupMedian, pill(r.times + '×', r.times >= 5 ? 'lose' : 'off'), r.entitlements, r.roles];
39
+ }), 'Access outliers'))));
40
+ else if (d.groups.length) w.appendChild(el('div', { className: 'banner ok' }, el('b', { text: 'No outliers at this level' })));
41
+ if (d.groups.length) w.appendChild(section('Groups', d.groups.length, simpleTable(['Group', 'People', 'Median access items', 'Outliers'], d.groups.slice(0, 500).map(function (g) { return [g.group, g.people, g.median, g.outliers]; }), 'Groups compared')));
42
+ w.appendChild(el('p', { className: 'muted small', text: 'Access items are what ISC counts for each person (entitlements, roles and access profiles). An outlier is not wrong by itself: admins and long-serving staff often have more. Use it to pick whom to review first.' }));
43
+ }
44
+
45
+ // certification coverage
46
+ function renderCoverage(w) {
47
+ var H = arState().coverage;
48
+ var extras = numSelect(H, 'months', [[6, 'Last 6 months'], [12, 'Last 12 months'], [24, 'Last 24 months']], 'Period');
49
+ if (!arRunBar(w, H, 'coverage', 'Check coverage', 'Which sources and privileged entitlements a certification reviewed in the period, and which none did.', extras, function () { return { months: H.months }; }, renderAudit)) return;
50
+ var d = H.data, P = d.privileged;
51
+ var srcTotal = d.sources.length + d.notReviewedSources.length;
52
+ w.appendChild(el('div', { className: 'bigstats' }, stat(d.campaigns, 'campaigns in ' + d.months + ' months'), stat(d.reviewItems, 'review items'),
53
+ stat(d.notReviewedSources.length, 'of ' + fmtNum(srcTotal) + ' sources not reviewed', 'lose'), stat(P.notReviewed.length, 'of ' + fmtNum(P.total) + ' privileged entitlements not reviewed', 'lose')));
54
+ w.appendChild(el('div', { className: 'bar', style: 'justify-content:flex-end;margin-bottom:8px' }, downloads(H.job)));
55
+ if (d.notReviewedSources.length) w.appendChild(section('Sources no certification reviewed', d.notReviewedSources.length, el('div', { style: 'display:flex;flex-wrap:wrap;gap:6px' }, d.notReviewedSources.map(function (s) { return pill(s, 'lose'); }))));
56
+ if (P.notReviewed.length) w.appendChild(section('Privileged entitlements not reviewed', P.notReviewed.length, simpleTable(['Entitlement', 'Source'], P.notReviewed.slice(0, 2000).map(function (x) { return [x.name, x.source]; }), 'Privileged entitlements not reviewed')));
57
+ if (d.sources.length) w.appendChild(section('Reviewed sources', d.sources.length, simpleTable(['Source', 'Items reviewed', 'Latest review', 'Campaigns'], d.sources.map(function (s) { return [s.source, s.reviewedItems, s.lastReviewed ? s.lastReviewed.slice(0, 10) : null, s.campaigns.slice(0, 3).join(', ') + (s.campaigns.length > 3 ? ' +' + (s.campaigns.length - 3) : '')]; }), 'Reviewed sources')));
58
+ if (d.byAccessType.length) w.appendChild(el('p', { className: 'muted small', text: 'Review items by type: ' + d.byAccessType.map(function (x) { return x.type.toLowerCase().replace(/_/g, ' ') + ' ' + fmtNum(x.items); }).join(', ') + '. Roles and access profiles count for the source of their entitlements only when ISC names it in the review item. A campaign still running counts as reviewing what it contains.' }));
59
+ }
60
+
61
+ // provisioning speed
62
+ function renderSpeed(w) {
63
+ var H = arState().speed;
64
+ var extras = el('div', { className: 'bar' }, numSelect(H, 'days', [[7, 'Last 7 days'], [30, 'Last 30 days'], [90, 'Last 90 days']], 'Period'),
65
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Removals should take at most' }), numSelect(H, 'limit', [[4, '4 hours'], [24, '24 hours'], [48, '48 hours'], [72, '3 days']], 'Removal limit')));
66
+ if (!arRunBar(w, H, 'speed', 'Measure', 'How long account changes take per source, and access removals (disable, delete) that were slow or are still not done.', extras, function () { return { days: H.days, removalLimitHours: H.limit }; }, renderAudit)) return;
67
+ var d = H.data, T = d.totals;
68
+ w.appendChild(el('div', { className: 'bigstats' }, stat(T.changes, 'account changes'), stat(T.removals, 'removals'), stat(T.openRemovals, 'removals still not done after ' + d.removalLimitHours + ' h', 'lose'), stat(T.slowRemovals, 'removals that took longer', 'lose')));
69
+ if (d.slow.length) w.appendChild(section('Slow or open removals', d.slow.length, el('div', {}, el('div', { className: 'bar', style: 'justify-content:flex-end;margin-bottom:8px' }, downloads(H.job)),
70
+ simpleTable(['Person', 'Source', 'Change', 'Started (UTC)', 'Took', 'State'], d.slow.slice(0, 2000).map(function (x) { return [x.person, x.source, x.op, x.started.slice(0, 16).replace('T', ' '), hoursText(x.hours), pill(x.state, x.state === 'not done' ? 'lose' : 'off')]; }), 'Slow or open removals'))));
71
+ else if (T.removals) w.appendChild(el('div', { className: 'banner ok' }, el('b', { text: 'Every removal finished within ' + d.removalLimitHours + ' hours' })));
72
+ if (d.rows.length) w.appendChild(section('By source', d.rows.length, simpleTable(['Source', 'Change', 'Count', 'Median', '90% within', 'Longest', 'Over the limit'], d.rows.map(function (r) {
73
+ return [r.source, r.op, r.count, hoursText(r.medianHours), hoursText(r.p90Hours), hoursText(r.maxHours), r.slower ? pill(String(r.slower), 'lose') : 0];
74
+ }), 'Provisioning speed by source')));
75
+ }
76
+
77
+ // identity data quality (Warnings tab)
78
+ function wnQuality(w, H, desc) {
79
+ var A = arState().quality;
80
+ var extras = attrInput(A, 'attribute', 'Attribute everyone should have', 'department');
81
+ if (!arRunBar(w, A, 'quality', 'Check identity data', desc, extras, function () { return { attribute: A.attribute || 'department' }; }, renderWarnings)) return;
82
+ var d = A.data, T = d.totals;
83
+ w.appendChild(el('div', { className: 'bigstats' }, stat(T.noManager, 'without a manager', 'lose'), stat(T.noEmail, 'without an email', 'lose'), stat(T.noAttribute, 'without ' + d.attribute, 'lose'), stat(T.sharedEmail, 'sharing an email', 'lose'), stat(d.checked, 'active people checked')));
84
+ if (d.sharedEmails.length) w.appendChild(section('Emails used by more than one person', d.sharedEmails.length, simpleTable(['Email', 'People'], d.sharedEmails.map(function (s) { return [s.email, s.people.join(', ')]; }), 'Shared emails')));
85
+ if (!d.rows.length) { w.appendChild(el('div', { className: 'banner ok' }, el('b', { text: 'No gaps found' }))); return; }
86
+ var f = el('input', { className: 'input', placeholder: 'Filter by person or issue...', value: A.q || '', style: 'max-width:280px', 'aria-label': 'Filter' });
87
+ var box = el('div');
88
+ var draw = function () {
89
+ var q = (A.q || '').toLowerCase();
90
+ var list = d.rows.filter(function (r) { return !q || (r.person + ' ' + r.issue).toLowerCase().indexOf(q) >= 0; });
91
+ box.textContent = '';
92
+ box.appendChild(simpleTable(['Person', 'Email', 'Lifecycle state', 'Issue'], list.slice(0, 2000).map(function (r) { return [r.person, r.email, r.lifecycle, r.issue]; }), 'Identity data issues'));
93
+ if (list.length > 2000 || d.more) box.appendChild(el('p', { className: 'muted small', text: 'Showing the first 2,000. The download has all of them.' }));
94
+ };
95
+ f.addEventListener('input', function () { A.q = f.value; draw(); });
96
+ w.appendChild(section('Issues', d.rows.length + (d.more || 0), el('div', {}, el('div', { className: 'bar', style: 'margin-bottom:10px' }, f, el('span', { style: 'flex:1' }), downloads(A.job)), box)));
97
+ draw();
98
+ w.appendChild(el('p', { className: 'muted small', text: 'Missing managers break approvals and manager certifications; missing emails break notifications; shared emails often mean duplicate people or test accounts. Fix them in the HR source, not in ISC.' }));
99
+ }
@@ -0,0 +1,182 @@
1
+ // ---------- Joiner, mover and leaver gaps; admin accounts; accepted exceptions ----------
2
+ function lcState() {
3
+ if (!state.lc) state.lc = { joiners: { graceDays: 3, share: 90, startDateAttribute: '' }, leavers: { kind: 'all' }, movers: { groupBy: 'department', maxShare: 5 }, accounts: { words: 'admin, adm, svc, service, test, tst, sa, root, sys, shared, generic' }, exceptions: {} };
4
+ return state.lc;
5
+ }
6
+ function lcRunBar(w, H, path, label, desc, extras, body, rerender) {
7
+ w.appendChild(el('div', { className: 'bar', style: 'margin-bottom:14px' }, el('span', { className: 'muted', style: 'flex:1;min-width:260px', text: desc }), extras || null,
8
+ el('button', { className: 'btn primary', disabled: !!H.busy, onclick: function () { runJobInto(H, '/api/lifecycle/' + path + '/run', body ? body() : {}, rerender); } }, icon('play'), H.data ? 'Read again' : label)));
9
+ if (H.busy) { w.appendChild(busyBox(H.busy)); return false; }
10
+ if (H.error) { w.appendChild(el('div', { className: 'error', text: H.error })); return false; }
11
+ if (!H.data) return false;
12
+ (H.data.notes || []).forEach(function (n) { w.appendChild(el('div', { className: 'note', text: n })); });
13
+ return true;
14
+ }
15
+ function filteredTable(H, rows, headers, toCells, label, extraBar) {
16
+ var f = el('input', { className: 'input', placeholder: 'Filter...', value: H.q || '', style: 'max-width:280px', 'aria-label': 'Filter ' + label });
17
+ var box = el('div');
18
+ var draw = function () {
19
+ var q = (H.q || '').toLowerCase();
20
+ var list = rows.filter(function (r) { return !q || JSON.stringify(r).toLowerCase().indexOf(q) >= 0; });
21
+ box.textContent = '';
22
+ box.appendChild(list.length ? simpleTable(headers, list.slice(0, 2000).map(toCells), label) : el('p', { className: 'muted', text: 'Nothing matches.' }));
23
+ if (list.length > 2000 || H.data.more) box.appendChild(el('p', { className: 'muted small', text: 'Showing the first 2,000. The download has all of them.' }));
24
+ };
25
+ f.addEventListener('input', function () { H.q = f.value; draw(); });
26
+ draw();
27
+ return el('div', {}, el('div', { className: 'bar', style: 'margin-bottom:10px' }, f, extraBar || null, el('span', { style: 'flex:1' }), downloads(H.job)), box);
28
+ }
29
+
30
+ // Warnings > Missed joiners
31
+ function wnJoiners(w, _H, desc) {
32
+ var H = lcState().joiners;
33
+ var extras = el('div', { className: 'bar' },
34
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Birthright when held by' }), numSelect(H, 'share', [[80, '80% of the profile'], [90, '90% of the profile'], [95, '95% of the profile']], 'Birthright share')),
35
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Grace period' }), numSelect(H, 'graceDays', [[1, '1 day'], [3, '3 days'], [7, '7 days'], [14, '14 days']], 'Grace period')),
36
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Also check joiners of the last' }), numSelect(H, 'recentDays', [[7, '7 days'], [30, '30 days'], [90, '90 days']], 'Recent joiners')),
37
+ attrInput(H, 'startDateAttribute', 'Start-date attribute (optional)', 'startDate'));
38
+ if (!H.recentDays) H.recentDays = 30;
39
+ if (!lcRunBar(w, H, 'joiners', 'Find missed joiners', desc, extras, function () { return { share: H.share, graceDays: H.graceDays, recentDays: H.recentDays, startDateAttribute: H.startDateAttribute || undefined }; }, renderWarnings)) return;
40
+ var d = H.data, E = d.evidence;
41
+ if (!E) {
42
+ var started = d.rows.filter(function (r) { return !r.missing.length; }).length;
43
+ w.appendChild(el('div', { className: 'bigstats' }, stat(d.rows.length - started, 'missing a birthright account', 'lose'), stat(started, 'past start date, still pre-hire', 'lose'), stat(d.checked, 'active people checked')));
44
+ if (d.rows.length) w.appendChild(section('Missed joiners', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Person', 'Identity profile', 'Created', 'Why', 'Missing accounts on'], function (r) {
45
+ return [el('span', {}, r.person, r.email ? el('div', { className: 'muted small', text: r.email }) : null), r.profile, r.created ? r.created.slice(0, 10) : null, r.reason, r.missing.length ? el('span', {}, r.missing.map(function (m) { return pill(m, 'lose'); })) : null];
46
+ }, 'Missed joiners')));
47
+ return;
48
+ }
49
+ var T = E.totals, bad = T['Criteria met, state not applied'] + T['Joiner ran, provisioning failed'] + T['No joiner activity recorded'] + T['Joiner ran, access not in place'];
50
+ w.appendChild(el('div', { className: 'bigstats' },
51
+ stat(T['Criteria met, state not applied'], 'criteria met, state not applied', 'lose'), stat(T['Joiner ran, provisioning failed'], 'joiner ran, provisioning failed', 'lose'),
52
+ stat(T['No joiner activity recorded'] + T['Joiner ran, access not in place'], 'access missing, no create recorded', 'lose'), stat(T['Joiner ran, still in progress'], 'still in progress'),
53
+ stat(T['Joiner complete'], 'joiner complete'), stat(T.checked, 'people checked')));
54
+ w.appendChild(el('p', { className: 'muted', text: 'ISC has no single "joiner triggered" event, so each person is checked three ways: what their lifecycle state is set up to grant, whether the identity profile\'s lifecycle mapping puts them in that state today (worked out with the Transform lab engine), and what ISC recorded (lifecycle changes, account activities, account creates passed or failed).' }));
55
+ if (E.states.length) w.appendChild(section('What each lifecycle state grants', E.states.length, simpleTable(['Identity profile', 'Lifecycle state', 'Access profiles', 'Enables accounts on'], E.states.map(function (x) {
56
+ return [x.profile, x.name + (x.enabled ? '' : ' (disabled)'), x.accessProfiles.map(function (a) { return a.name + (a.source ? ' (' + a.source + ')' : ''); }).join(', ') || '—', x.enableSources.map(function (a) { return a.name; }).join(', ') || '—'];
57
+ }), 'Lifecycle state configuration')));
58
+ if (d.birthright.length) w.appendChild(section('Accounts most of each profile has', d.birthright.length, simpleTable(['Identity profile', 'Active people', 'Sources nearly everyone has'], d.birthright.map(function (b) {
59
+ return [b.profile, b.people, b.sources.length ? b.sources.map(function (s) { return s.source + ' (' + s.share + '%)'; }).join(', ') : '—'];
60
+ }), 'Birthright accounts per identity profile')));
61
+ if (!bad && !T['State does not match the criteria']) w.appendChild(el('div', { className: 'banner ok' }, el('b', { text: 'No missed joiners: every person checked has what their lifecycle state grants, or it is in progress' })));
62
+ var tone = function (v) { return v === 'Joiner complete' ? 'gain' : v === 'Joiner ran, still in progress' || v === 'Could not tell' ? 'keep-other' : 'lose'; };
63
+ w.appendChild(section('People checked', E.rows.length, filteredTable(H, E.rows, ['Person', 'Lifecycle state', 'Verdict', 'Why', 'Recorded by ISC'], function (r) {
64
+ var ev = r.evidence.length ? el('details', {}, el('summary', { text: r.evidence.length + ' record' + (r.evidence.length === 1 ? '' : 's') }),
65
+ el('ul', { className: 'evlist' }, r.evidence.map(function (e) { return el('li', {}, el('span', { className: 'muted small', text: e.when ? e.when.slice(0, 16).replace('T', ' ') + ' ' : '' }), e.what, e.status ? ' ' : null, e.status ? pill(e.status.toLowerCase(), /fail|error/i.test(e.status) ? 'lose' : /pass|complete|commit/i.test(e.status) ? 'gain' : 'keep-other') : null, e.detail ? el('div', { className: 'small', text: e.detail }) : null); })))
66
+ : el('span', { className: 'muted', text: 'nothing' });
67
+ return [el('span', {}, r.person, el('div', { className: 'muted small', text: r.profile + (r.created ? ' · created ' + r.created.slice(0, 10) : '') })),
68
+ el('span', {}, r.lifecycle || '—', r.criteria ? el('div', { className: 'small' + (r.criteria === r.lifecycle ? ' muted' : ''), text: 'criteria: ' + r.criteria }) : r.criteriaNote ? el('div', { className: 'muted small', text: r.criteriaNote }) : null),
69
+ el('span', {}, pill(r.verdict, tone(r.verdict)), el('div', { className: 'muted small', text: r.reason })), r.why, ev];
70
+ }, 'Joiner check')));
71
+ w.appendChild(el('p', { className: 'muted small', text: 'Checked: people missing what their lifecycle state grants, people flagged by the birthright pattern (a source most of their identity profile has), past start dates, and everyone who joined in the period chosen. Birthright access given by roles with membership criteria is covered by the pattern, not the lifecycle state.' }));
72
+ }
73
+
74
+ // Warnings > Missed leavers
75
+ function wnLeavers(w, _H, desc) {
76
+ var H = lcState().leavers;
77
+ if (!lcRunBar(w, H, 'leavers', 'Find missed leavers', desc, null, null, renderWarnings)) return;
78
+ var d = H.data, T = d.totals;
79
+ w.appendChild(el('div', { className: 'bigstats' }, stat(T.hrDisabled, 'HR says gone, ISC says active', 'lose'), stat(T.enabledAccounts, 'enabled accounts of leavers', 'lose'), stat(T.roles, 'roles or access profiles of leavers', 'lose'), stat(T.leavers, 'leavers checked')));
80
+ if (!d.rows.length) { w.appendChild(el('div', { className: 'banner ok' }, el('b', { text: 'No missed leavers found' }))); return; }
81
+ var kinds = [['all', 'All gaps'], ['HR account disabled, identity active', 'HR says gone, ISC says active'], ['Left, account still enabled', 'Accounts still enabled'], ['Left, still holds a role or access profile', 'Roles and access profiles']];
82
+ var sel = el('select', { className: 'input', style: 'width:auto', 'aria-label': 'Which gaps' }, kinds.map(function (k) { return el('option', { value: k[0], text: k[1] }); }));
83
+ sel.value = H.kind;
84
+ sel.addEventListener('change', function () { H.kind = sel.value; renderWarnings(); });
85
+ var rows = H.kind === 'all' ? d.rows : d.rows.filter(function (r) { return r.kind === H.kind; });
86
+ w.appendChild(section('Missed leavers', rows.length, filteredTable(H, rows, ['Person', 'Lifecycle state', 'Gap', 'Detail', 'Source'], function (r) {
87
+ return [el('span', {}, r.person, r.email ? el('div', { className: 'muted small', text: r.email }) : null), r.lifecycle, pill(r.kind, /HR/.test(r.kind) ? 'lose' : 'off'), r.detail, r.source];
88
+ }, 'Missed leavers', sel)));
89
+ w.appendChild(el('p', { className: 'muted small', text: '"HR says gone" means the account on the person’s own authoritative source is disabled while ISC still treats them as active: usually the lifecycle state does not follow the HR status. People active after their end date are on the End dates tab.' }));
90
+ }
91
+
92
+ // Warnings > Mover leftovers
93
+ function renderMovers(w) {
94
+ var H = lcState().movers;
95
+ var extras = el('div', { className: 'bar' }, attrInput(H, 'groupBy', 'Compare people by attribute', 'department'),
96
+ el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Unusual when held by under' }), numSelect(H, 'maxShare', [[2, '2% of the group'], [5, '5% of the group'], [10, '10% of the group']], 'Unusual share')));
97
+ if (!lcRunBar(w, H, 'movers', 'Find unusual access', 'Access that almost no one else in the person’s group has: often left over from a previous job (movers) or given as a one-off.', extras, function () { return { groupBy: H.groupBy || 'department', maxShare: H.maxShare }; }, renderWarnings)) return;
98
+ var d = H.data;
99
+ var people = {}; d.rows.forEach(function (r) { people[r.person] = 1; });
100
+ w.appendChild(el('div', { className: 'bigstats' }, stat(d.rows.length, 'unusual access items', 'lose'), stat(Object.keys(people).length, 'people'), stat(d.rows.filter(function (r) { return r.privileged; }).length, 'of them privileged', 'lose'), stat(d.groups, 'groups compared')));
101
+ if (!d.rows.length) { w.appendChild(el('div', { className: 'banner ok' }, el('b', { text: 'No unusual access found' }))); return; }
102
+ w.appendChild(section('Unusual access', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Person', 'Group (' + d.groupBy + ')', 'Access', 'Source', 'Holders in group'], function (r) {
103
+ return [el('span', {}, r.person, r.email ? el('div', { className: 'muted small', text: r.email }) : null), r.group, el('span', {}, r.access + ' ', r.privileged ? pill('privileged', 'lose') : null, el('div', { className: 'muted small', text: r.type })), r.source, r.holders + ' of ' + fmtNum(r.groupSize)];
104
+ }, 'Unusual access')));
105
+ w.appendChild(el('p', { className: 'muted small', text: 'Groups need at least 10 active people. Access held by at most 3 people of the group, and by fewer than the share you chose, counts as unusual. ISC user levels are left out (see Warnings > ISC admins).' }));
106
+ }
107
+
108
+ // Audit > Admin accounts
109
+ function renderAdminAccounts(w) {
110
+ var H = lcState().accounts;
111
+ var inp = el('input', { className: 'input', value: H.words, style: 'min-width:340px', 'aria-label': 'Words in account names' });
112
+ inp.addEventListener('input', function () { H.words = inp.value; });
113
+ var extras = el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'Words in account names' }), inp);
114
+ if (!lcRunBar(w, H, 'accounts', 'Find accounts', 'Admin, service and test accounts that are linked to a person: often shared or privileged accounts hiding under a normal identity.', extras, function () { return { words: H.words.split(/[\s,;]+/).filter(Boolean) }; }, renderAudit)) return;
115
+ var d = H.data;
116
+ var leftEnabled = d.rows.filter(function (r) { return r.left && !r.disabled; }).length;
117
+ w.appendChild(el('div', { className: 'bigstats' }, stat(d.rows.length, 'accounts found'), stat(leftEnabled, 'enabled, person has left', 'lose'), stat(d.rows.filter(function (r) { return r.privileged; }).length, 'privileged')));
118
+ if (!d.rows.length) { w.appendChild(el('div', { className: 'banner ok' }, el('b', { text: 'No such accounts linked to people' }))); return; }
119
+ w.appendChild(section('Accounts', d.rows.length + (d.more || 0), filteredTable(H, d.rows, ['Account', 'Source', 'Linked to', 'Matched', 'State'], function (r) {
120
+ return [el('span', {}, r.account + ' ', r.privileged ? pill('privileged', 'lose') : null), r.source, el('span', {}, r.person, ' ', r.left ? pill('has left', 'lose') : null), r.word, r.disabled ? 'disabled' : 'enabled'];
121
+ }, 'Admin and service accounts linked to people')));
122
+ w.appendChild(el('p', { className: 'muted small', text: 'A word matches when it is a separate part of the name: adm.alice, svc_backup and alice-test match; "sample" does not match "sa". Decide per account whether it should belong to the person, to a service owner, or be removed.' }));
123
+ }
124
+
125
+ // Audit > Exceptions
126
+ function renderExceptions(w) {
127
+ var H = lcState().exceptions;
128
+ if (!H.data && !H.busy) {
129
+ H.busy = 'Loading...';
130
+ api('/api/exceptions').then(function (d) { H.data = d; }, function (e) { H.error = errorText(e); }).then(function () { H.busy = null; if (state.au && state.au.tab === 'exceptions') renderAudit(); });
131
+ }
132
+ w.appendChild(el('p', { className: 'muted', text: 'Known findings someone accepted, with a reason and an end date. Until then they are left out of the instant check (on this computer and in scheduled checks), and they go into the evidence pack as your risk-acceptance register. Accept an item from the details of an instant check tile.' }));
133
+ if (H.busy) { w.appendChild(busyBox(H.busy)); return; }
134
+ if (H.error) { w.appendChild(el('div', { className: 'error', text: H.error })); return; }
135
+ var mine = H.data.exceptions.filter(function (e) { return e.tenant === H.data.tenant; });
136
+ var inForce = mine.filter(function (e) { return e.state === 'in force'; }).length;
137
+ w.appendChild(el('div', { className: 'bigstats' }, stat(inForce, 'in force'), stat(mine.filter(function (e) { return e.state === 'expired'; }).length, 'expired: decide again', 'lose'), stat(mine.filter(function (e) { return e.state === 'ended'; }).length, 'ended')));
138
+ if (!mine.length) { w.appendChild(el('p', { className: 'muted', text: 'No exceptions for this tenant yet.' })); return; }
139
+ w.appendChild(section('Exceptions for this tenant', mine.length, simpleTable(['Check', 'Item', 'Reason', 'Accepted by', 'Until', 'State', 'Action'], mine.map(function (e) {
140
+ return [e.checkLabel, e.key, e.reason, e.acceptedBy + ' (' + e.created.slice(0, 10) + ')', e.until,
141
+ pill(e.state + (e.ended ? ' ' + e.ended.slice(0, 10) : ''), e.state === 'in force' ? 'keep-other' : e.state === 'expired' ? 'lose' : 'off'),
142
+ e.state === 'in force' ? el('button', { className: 'btn sm', onclick: function () { endExceptionDialog(e); } }, 'End now') : null];
143
+ }), 'Accepted exceptions')));
144
+ }
145
+ function endExceptionDialog(e) {
146
+ var who = el('input', { className: 'input', placeholder: 'Your name', 'aria-label': 'Ended by' });
147
+ var msg = el('div');
148
+ var box = el('div', { className: 'card', role: 'dialog', 'aria-label': 'End exception', style: 'position:fixed;inset:auto 0 0 0;margin:0 auto 24px;max-width:520px;z-index:50;box-shadow:0 10px 40px rgba(0,0,0,.25)' },
149
+ el('h3', { text: 'End this exception now?' }), el('p', { className: 'muted', text: e.checkLabel + ': ' + e.key }), who, msg,
150
+ el('div', { className: 'bar', style: 'margin-top:10px;justify-content:flex-end' },
151
+ el('button', { className: 'btn', onclick: function () { box.remove(); } }, 'Cancel'),
152
+ el('button', { className: 'btn primary', onclick: function () {
153
+ if (who.value.trim().length < 2) { msg.textContent = ''; msg.appendChild(el('div', { className: 'error', text: 'Say who ends it.' })); return; }
154
+ api('/api/exceptions/' + e.id + '/end', 'POST', { by: who.value.trim() }).then(function () { box.remove(); lcState().exceptions.data = null; toast('Exception ended'); renderAudit(); }, function (err) { msg.textContent = ''; msg.appendChild(el('div', { className: 'error', text: errorText(err) })); });
155
+ } }, 'End it')));
156
+ box.addEventListener('keydown', function (ev) { if (ev.key === 'Escape') box.remove(); });
157
+ document.body.appendChild(box);
158
+ who.focus();
159
+ }
160
+ // Instant check: accept one row as an exception
161
+ function acceptDialog(m, key, done) {
162
+ var inYear = new Date(Date.now() + 90 * 86400000).toISOString().slice(0, 10);
163
+ var reason = el('textarea', { className: 'input', rows: '2', placeholder: 'Why this is acceptable (e.g. vendor-managed account, reviewed by the security team)', 'aria-label': 'Reason' });
164
+ var who = el('input', { className: 'input', placeholder: 'Name and role, e.g. Priya Shah, IAM lead', 'aria-label': 'Accepted by' });
165
+ var until = el('input', { className: 'input', type: 'date', value: inYear, 'aria-label': 'Until', style: 'max-width:180px' });
166
+ var msg = el('div');
167
+ var box = el('div', { className: 'card', role: 'dialog', 'aria-label': 'Accept as exception', style: 'position:fixed;inset:auto 0 0 0;margin:0 auto 24px;max-width:560px;z-index:50;box-shadow:0 10px 40px rgba(0,0,0,.25)' },
168
+ el('h3', { text: 'Accept as an exception' }), el('p', { className: 'muted', text: m.label + ': ' + key }),
169
+ el('label', { className: 'field' }, el('span', { className: 'lbl', text: 'Reason' }), reason),
170
+ el('label', { className: 'field' }, el('span', { className: 'lbl', text: 'Accepted by' }), who),
171
+ el('label', { className: 'field' }, el('span', { className: 'lbl', text: 'Until (at most two years)' }), until), msg,
172
+ el('div', { className: 'bar', style: 'justify-content:flex-end' },
173
+ el('button', { className: 'btn', onclick: function () { box.remove(); } }, 'Cancel'),
174
+ el('button', { className: 'btn primary', onclick: function () {
175
+ api('/api/exceptions', 'POST', { check: m.id, key: key, reason: reason.value, acceptedBy: who.value, until: until.value }).then(function () {
176
+ box.remove(); lcState().exceptions.data = null; toast('Accepted until ' + until.value + '. It is left out from the next check.'); if (done) done();
177
+ }, function (err) { msg.textContent = ''; msg.appendChild(el('div', { className: 'error', text: errorText(err) })); });
178
+ } }, 'Accept')));
179
+ box.addEventListener('keydown', function (ev) { if (ev.key === 'Escape') box.remove(); });
180
+ document.body.appendChild(box);
181
+ reason.focus();
182
+ }