Skip to content

Enhance ServiceNow integration with improved logging, validation, and documentation#215

Draft
jagger wants to merge 4 commits into
mainfrom
feature/servicenow-improvements
Draft

Enhance ServiceNow integration with improved logging, validation, and documentation#215
jagger wants to merge 4 commits into
mainfrom
feature/servicenow-improvements

Conversation

@jagger

@jagger jagger commented Jan 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR enhances the ServiceNow Secret Server integration with significant improvements to logging, input validation, code quality, and documentation.

Discovery Script Improvements

  • Enhanced Logging Infrastructure with configurable log folder
  • Debug logging for input parameters with truncated secrets (5 chars + ***)
  • API call logging with sanitized Authorization headers
  • JSON output format for discovery results
  • Input validation for DiscoveryMode, baseURL, and placeholder detection
  • Renamed functions to PowerShell approved verbs
  • Fixed hardcoded URL bug in Get-LocalUsers function

XML Template Fixes

  • Fixed typos: ClientUD to ClientID, Groud to Group, assocated to associated
  • Set Password and Client-Secret fields as password type (masked in UI)
  • Added missing field descriptions

Documentation Updates

  • Added Native Support Notice to main readme
  • Fixed 15+ typos across all markdown files
  • Added Log Files and Input Validation documentation
  • Created new Templates/readme.md

Generated with Claude Code

… documentation

## Discovery Script Improvements (ServiceNow Account Discovery.ps1)

### Logging Enhancements
- Moved log path definitions to top of script with configurable $logFolder variable
- Added helper functions: Get-TruncatedSecret, Get-SanitizedHeaders, Write-ApiCallLog
- Added debug logging for all input parameters with truncated secrets (5 chars + ***)
- Added API call logging for all REST method calls with sanitized Authorization headers
- Changed results output from text append to JSON format with Out-File -Force

### Input Validation
- Added validation for DiscoveryMode (must be "Advanced" or "Default")
- Added validation for baseURL (must start with "https://")
- Added placeholder detection to catch unsubstituted Secret Server variables
- Validation logs errors before throwing exceptions for easier troubleshooting

### Code Quality
- Renamed functions to use PowerShell approved verbs:
  - isadmin -> Test-IsAdminUser
  - isSvcAcct -> Test-IsServiceAccount
  - isLocal -> Test-IsLocalUser
  - get-SvcAccounts -> Get-ServiceAccounts
- Fixed hardcoded URL bug in Get-LocalUsers function (now uses $api variable)

## XML Template Fixes

### ServiceNow Privileged Account Template.xml
- Fixed "ClientUD" typo to "ClientID"
- Fixed "Local-Account-Groud-Ids" typo to "Local-Account-Group-Ids"
- Added description for Local-Account-Group-Ids field
- Set Password and Client-Secret fields as password type (masked in UI)

### ServiceNow User Template.xml
- Fixed "assocated" typo to "associated"

## Documentation Updates

### Main readme.md
- Added Native Support Notice about Secret Server's built-in ServiceNow support
- Added link to official Delinea documentation
- Noted this repo offers alternate implementation with discovery features

### Instructions.md
- Added missing # header marker
- Fixed missing bullet points in Prerequisites section
- Fixed "training slash" -> "trailing slash" typo
- Fixed "ministrative" -> "administrative" typo

### Discovery/readme.md
- Added Log Files documentation section
- Added Input Validation documentation
- Added Discovery Mode Options table
- Fixed multiple typos and formatting issues

### Remote Password Changer/readme.md
- Fixed double slash in link path
- Fixed double colon in Category field
- Fixed triple asterisks in bold formatting
- Fixed "fill outhe" -> "fill out the" typo
- Fixed "pasge" -> "page" typo
- Fixed missing bold closing tag

### Templates/readme.md (New)
- Created new readme documenting available templates
- Added native support notice
- Added field descriptions for both templates
- Added import instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jagger
jagger force-pushed the feature/servicenow-improvements branch from e06112b to 0dfe8c3 Compare January 8, 2026 18:13
jagger and others added 3 commits January 8, 2026 13:24
ServiceNow Heartbeat.ps1:
- Fixed "Argumnts" -> "Arguments" in comment
- Fixed "Vaeiables" -> "Variables" in region name
- Fixed invalid env var path "$env:Program Files" -> "$env:ProgramFiles"
- Fixed missing closing brace in Write-Log function
- Fixed parameter name mismatch "$privassword" -> "$privPassword"
- Renamed function "get-pwd-verification" -> "Test-PasswordVerification"
- Fixed parameter/variable mismatch $PWD/$Password

ServiceNow Remote Password Changer.ps1:
- Fixed "Argumnts" -> "Arguments" in comment
- Fixed "Vaeiables" -> "Variables" in region name
- Fixed invalid env var path "$env:Program Files" -> "$env:ProgramFiles"
- Fixed "#endregikon" -> "#endregion" typo
- Fixed parameter name mismatch "$privassword" -> "$privPassword"
- Fixed "Funtions" -> "Functions" in region name
- Fixed function name "get-ServiceNowUserInfo" -> "Get-ServiceNowUserInfo"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added notice about Secret Server's native out-of-box ServiceNow
password changing and heartbeat support with link to official docs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…atibility

Update the ServiceNow User template and discovery output to use 'host'
field instead of 'Tenant-URL'/'tenant-url' for compatibility with Secret
Server's native ServiceNow RPC implementation.

Changes:
- ServiceNow User Template.xml: Renamed displayname, name, and fieldslugname
- Discovery script: Updated output field name in both Default and Advanced modes
- Discovery readme: Updated scan template instructions and SQL report
- RPC readme: Updated Password Type Fields and field mapping sections
- Templates readme: Updated User Template field documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant