PowerShell module (RobOtters) that simulates Secret Server user activity for lab environments. AD-authenticated users perform randomized actions (0-15 per 30-min cycle) against an on-prem Delinea Secret Server instance to generate realistic audit trail data.
- PowerShell module (
RobOtters.psd1/RobOtters.psm1) with Public/Private function split - SQLite via PSSQLite module for credential store, config, and action logs
- REST API calls to Secret Server
/api/v1/*endpoints with OAuth2 password grant - Runs unattended via Windows Task Scheduler every 30 minutes
RobOtters/
+-- RobOtters.psd1 # Module manifest
+-- RobOtters.psm1 # Dot-source loader
+-- Register-ROTask.ps1 # Task Scheduler registration
+-- assets/ # Images
+-- Data/ # Schema, seed data, SS reports
+-- Docs/ # Guides and command reference
+-- Public/ # Exported cmdlets (13 commands)
+-- Private/ # Internal functions
| +-- Data/ # DB helpers
| +-- Api/ # Secret Server REST client
| +-- Actions/ # 19 Secret Server action functions
| +-- Engine/ # Cycle orchestration
| +-- Logging/ # File + DB logging
+-- Scripts/ # Migration utilities
+-- Tests/ # Pester tests
- SQLite DB lives in
$env:ProgramData\RobOtters\(or$env:RO_DATA_PATHif set) - Log files in a
Logs/subfolder under the data root - DB and logs are outside the repo directory; gitignored
- Verb-Noun naming: all functions use
ROprefix (Verb-RO<Noun>) - All functions use
[CmdletBinding()]and named parameters - Action functions return uniform
[PSCustomObject]@{ Action; TargetType; TargetId; TargetName; Success; ErrorMessage } - Use
Write-ROLogfor all operational logging (not Write-Host) - Errors: use
Write-Error/throwfor unrecoverable;Write-Warning+ continue for transient - SQL: always parameterized queries via
-SqlParameters(no string interpolation) - Secrets: passwords encrypted at rest (DPAPI by default, AES-256 if
RO_ENCRYPT_KEYenv var is set) - No aliases in scripts; use full cmdlet names
- Prefer splatting for calls with 3+ parameters
- PSSQLite -- SQLite access (
Invoke-SqliteQuery) - Secret Server REST API --
/api/v1/*with OAuth2 bearer tokens
SecretServerUrl-- base URL of the SS instanceMinActionsPerCycle-- 0MaxActionsPerCycle-- 15LogRetentionDays-- 30DefaultDomain-- lab domain namePasswordRotationDays-- 14 (days between automatic password rotations)AuthFailureAction-- AlertOnly (or RotateAndAlert)LauncherTemplateId-- template ID for launcher-based actionsAccessSnapshotMaxAgeDays-- max age for user access snapshotsDisabledActions-- comma-separated list of globally disabled action namesDisabledCategories-- comma-separated list of globally disabled categories (Core, Management, Advanced)
- Pester v5+ for unit tests
Tests/Unit/-- pure logic tests (no network/DB)Tests/Integration/-- requires live SS instance