Skip to main content

Customize PIM Monitor

PIM Monitor is designed to be customized. The defaults work out of the box, but nearly every behavior can be changed by editing configuration files or environment variables.

This section covers everything you can customize, from schedules and notification channels to severity rules and diff logic.

Complete Customization Guideโ€‹

๐Ÿ”„ Pipeline & Schedulingโ€‹

TopicFile/VariableWhat you can changePage
Schedulemonitor-pipeline.yml / .github/workflows/scan.ymlHow often scans run (cron pattern)Pipeline Configuration
Manual triggersYAMLAllow on-demand scans via UIPipeline Configuration
Commit messageYAML git stepFormat of git commitsPipeline Configuration
Git authorsrc/git.ps1Commit author name/emailPipeline Configuration
Inventory pathsrc/Scan-PimState.ps1Where scan data is storedPipeline Configuration
Module versionYAML MSGRAPH_VERSIONPowerShell module versionPipeline Configuration

๐Ÿ“จ Notificationsโ€‹

TopicFile/VariableWhat you can changePage
Email setupNOTIFICATION_EMAIL, NOTIFICATION_MAIL_FROMEnable email notificationsEmail Notifications
Email formatsrc/notifications.ps1HTML layout, colors, sectionsEmail Notifications
Webhook URLNOTIFICATION_WEBHOOK_URLAdd Teams, Slack, Discord, or custom webhooksWebhook Channels
Webhook payloadsrc/notifications.ps1Customize Teams/Slack/Discord formatWebhook Channels
Severity thresholdNOTIFICATION_MIN_SEVERITYWhich changes trigger notificationsNotifications Overview
Error notificationsNew featureSend notifications when components failScan Error Notifications

๐Ÿ“Š Reporting & Artifactsโ€‹

TopicFile/VariableWhat you can changePage
HTML reportREPORT_ARTIFACTEnable/disable scan report generationReporting & Artifacts
Report formatsrc/notifications.ps1HTML layout, colors, metadataReporting & Artifacts
Report brandingFormat-ScanReportHtmlCustom title, logo, colorsReporting & Artifacts

๐Ÿšจ Change Classification & Detectionโ€‹

TopicFile/VariableWhat you can changePage
Policy severitysrc/diff.ps1 $PolicyRuleSeverityWhich policy rules are High/Medium/LowSeverity Rules
Property severitysrc/diff.ps1 $PropertySeverityWhich definition properties are High/Medium/LowSeverity Rules
Assignment severitysrc/diff.ps1 Compare-AssignmentsHow permanent/eligible/active assignments are classifiedSeverity Rules
Filtered fieldssrc/diff.ps1 $DiffIgnorePropertiesHide fields from diff previewDiff Engine
Object equalitysrc/diff.ps1 Test-ObjectEqualHow old/new objects are comparedDiff Engine
Assignment matchingsrc/diff.ps1 Get-AssignmentKeyHow assignments are matched across scansDiff Engine

๐Ÿ“‹ Expected Changes & Suppressionโ€‹

TopicFile/VariableWhat you can changePage
Suppress changesexpected-changes.jsonSilence notifications for planned changesExpected Changes
Matching rulesJSONWildcard matching on workload/entity/fileTypeExpected Changes

โฐ Expiring Assignmentsโ€‹

TopicFile/VariableWhat you can changePage
Detection windowEXPIRING_WINDOW_DAYSDays ahead to flag expiring assignmentsExpiring Assignments
Severity levelsrc/diff.ps1Change expiring from Informational to Low/MediumExpiring Assignments

๐Ÿ”ง Environment & Platformsโ€‹

TopicFile/VariableWhat you can changePage
All env variablesReferenceComplete list of all configuration variablesEnvironment Variables
GitHub Actions.github/workflows/scan.ymlFull setup for GitHub Actions workflowGitHub Actions Setup
Azure DevOpsmonitor-pipeline.ymlFull setup for Azure DevOps pipelinePipeline Configuration

Quick Navigation by Taskโ€‹

"I want to..."

Customization Depth Levelsโ€‹

โญ Basic (Variables only)โ€‹

No code editing โ€” just set environment variables in your pipeline:

  • NOTIFICATION_EMAIL / NOTIFICATION_MAIL_FROM โ€” Email setup
  • NOTIFICATION_WEBHOOK_URL โ€” Webhook setup
  • NOTIFICATION_MIN_SEVERITY โ€” Severity threshold
  • EXPIRING_WINDOW_DAYS โ€” Expiring assignment window
  • REPORT_ARTIFACT โ€” Enable HTML reports

Time to customize: 5 minutes
Risk: None โ€” variables are scoped to your pipeline

โญโญ Intermediate (YAML & JSON)โ€‹

Edit pipeline configuration and expected changes:

  • Change scan schedule (cron pattern in YAML)
  • Change commit message format
  • Create expected-changes.json to suppress notifications
  • Change inventory storage path
  • Enable manual triggers

Time to customize: 15โ€“30 minutes
Risk: Low โ€” changes are in separate files, easy to revert

โญโญโญ Advanced (PowerShell code)โ€‹

Edit notification payloads, severity rules, and diff logic:

  • Customize email/webhook format
  • Change severity classification rules
  • Add custom notification channels
  • Modify diff comparison logic
  • Change diff output formatting

Time to customize: 1โ€“2 hours
Risk: Medium โ€” requires PowerShell/JSON knowledge, test thoroughly

Contributingโ€‹

If you've built a useful customization, we'd love to see it! Open a PR and add a page here. Keep it concise:

  • What it does (1 paragraph)
  • What file to edit
  • A code snippet showing the change
  • Example output (if applicable)

See Contributing for full details.