implementing-privileged-session-monitoring
Monitor and audit privileged user sessions including SSH, RDP, and database access. Tracks session metadata, records commands, detects anomalous activity, and enforces session policies for PAM compliance.
- License 许可
- Apache-2.0
- 最近更新
- 2026-03-20
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- implementing-privileged-session-monitoring
- tags
- [ "pam", "session-monitoring", "privileged-access", "audit-logging" ]
- author
- mahipal
- domain
- cybersecurity
- license
- Apache-2.0
- version
- 1.0
- subdomain
- identity-access-management
- description
- Monitor and audit privileged user sessions including SSH, RDP, and database access. Tracks session metadata, records commands, detects anomalous activity, and enforces session policies for PAM compliance.
02 资源文件 3
- 许可证LICENSE11.0 KB
- 参考文档references/api-reference.md2.0 KB
- 脚本scripts/agent.py8.0 KB
03 SKILL.md 正文
Implementing Privileged Session Monitoring
When to Use
- Deploying session recording for all privileged access to critical servers and databases
- Meeting compliance requirements (PCI-DSS 10.2, SOX, HIPAA, ISO 27001) mandating privileged activity monitoring
- Investigating incidents where an administrator may have performed unauthorized actions
- Implementing real-time alerting for high-risk commands during privileged sessions
- Establishing a forensic audit trail of all administrative actions on production infrastructure
Do not use for monitoring standard user sessions; use EDR/UBA for general user behavior monitoring.
Prerequisites
- CyberArk PAM or Privilege Cloud with Digital Vault, or open-source alternative (Teleport)
- PSM (Privileged Session Manager) or PSMP installed on hardened jump server
- Network architecture routing all privileged access through the PSM proxy
- Sufficient storage for recordings (estimate: 50-250 KB/min for RDP, 5-20 KB/min for SSH)
Workflow
Step 1: Route All Privileged Access Through PSM
Architecture:
Admin User --> PVWA (Web Portal) --> PSM (Jump Server) --> Target Server
Network Controls:
- DENY direct RDP (3389) / SSH (22) to targets from user networks
- ALLOW RDP/SSH to targets ONLY from PSM server IPs
- ALLOW PVWA access (443) from admin user networks
Step 2: Configure PSM Connection Components
PVWA > Administration > Connection Components
For Windows RDP:
Connection Component: PSM-RDP
Record Sessions: Yes
Recording Format: AVI (video) + Keystrokes (text)
Record Windows Titles: Yes
For Linux SSH:
Connection Component: PSM-SSH
Record Sessions: Yes
Record Unix Commands: Yes
Step 3: Configure Session Recording Policies
PVWA > Platform Management > Session Management
Enable Session Recording: Yes
Keystroke Logging: Enable Transcript + Window Events
Storage: Vault (encrypted, tamper-proof)
Retention periods (per compliance):
PCI-DSS: 1 year available, 3 months accessible
SOX: 7 years
HIPAA: 6 years
Per-Safe policies:
Production-Servers-Admin: Record all, real-time monitoring
Third-Party-Vendor-Access: Record all, dual authorization required
Step 4: Enable Real-Time Monitoring and Alerting
Configure CyberArk Privileged Threat Analytics (PTA):
PTA > Configuration > Security Events
Rule: High-Risk Command Detected
Trigger patterns:
- rm -rf /
- chmod 777
- useradd / passwd root
- wget http* | sh / curl * | bash
- nc -e /bin/sh
Action: Alert SOC + Flag session as high-risk
Rule: Credential Access Attempt
Trigger:
- mimikatz.exe
- procdump.exe targeting lsass
- ntdsutil.exe
Action: Terminate session + Alert SOC + Lock account
Rule: Unusual Session Duration
Trigger: Session > 4 hours
Action: Alert SOC for review
Step 5: Configure Session Review Workflow
PVWA > Recordings > Search and Review
Review features:
- Video playback with timeline scrubbing
- Keystroke transcript alongside video
- Window title log for application tracking
- Risk events highlighted on timeline
- Text search within keystroke transcript
- Auditor can mark: Reviewed-OK, Suspicious, Requires-Investigation
Step 6: Open-Source Alternative - Teleport
# /etc/teleport.yaml
teleport:
nodename: teleport-proxy.corp.internal
auth_service:
enabled: yes
session_recording: "node-sync"
audit_sessions_uri: "s3://teleport-session-recordings/sessions?region=us-east-1"
enhanced_recording:
enabled: true
command_events: true
network_events: true
# List recorded sessions
tsh recordings ls --from=2026-03-15
# Play back a session
tsh play <session-id>
# Export session events for SIEM
tsh recordings export <session-id> --format=json > session_events.json
Step 7: Forward Session Metadata to SIEM
CyberArk PTA > SIEM Integration
Protocol: TCP + TLS (Syslog CEF)
Destination: siem.corp.internal:6514
Events forwarded:
- Session start/stop with user, target, duration
- High-risk command alerts
- Session termination events
- Dual-authorization approvals/denials
Key Concepts
| Term | Definition |
|---|---|
| PSM | Privileged Session Manager - proxy recording all sessions in video and text |
| PSMP | PSM for SSH Proxy - Linux-based proxy for SSH, SCP, SFTP sessions |
| PTA | Privileged Threat Analytics - behavioral analytics and risk scoring for sessions |
| Dual Authorization | Two authorized users must approve before a privileged session is established |
| Session Isolation | All admin access proxied through PAM; no direct connections to targets |
| Keystroke Transcript | Searchable text log of all keystrokes during a recorded session |
Verification
- [ ] All privileged access routes through PSM (direct RDP/SSH blocked by firewall)
- [ ] Session recordings stored encrypted with tamper protection
- [ ] Keystroke transcripts captured and searchable for SSH and RDP
- [ ] PTA rules trigger alerts for high-risk commands (test with benign trigger)
- [ ] Real-time monitoring dashboard shows active sessions with correct metadata
- [ ] Recordings play back in PVWA HTML5 player with timeline and transcript
- [ ] Retention policies match compliance requirements
- [ ] Dual authorization enforced for vendor and high-risk access
- [ ] Session metadata and alerts forwarding to SIEM
04 同仓库更多 Skills
azure-apim-architecture
Analyzes and explains Azure API Management architecture decisions for enterprise API marketplace implementations using VNet Internal mode, Front Door, hybrid authentication, and multi-environment strategies. Use when discussing APIM component selection, network topology, cost optimization, or comparing alternatives like workspaces vs instances, VNet Internal vs External mode, or Front Door vs Application Gateway.
apiops-deployment
Guides deployment of Azure API Management infrastructure using Infrastructure as Code (Bicep/Terraform), CI/CD pipelines (GitHub Actions/Azure DevOps), and APIOps workflows. Use when deploying APIM, creating pipelines, or implementing dev→test→prod promotion strategies.
apim-policy-authoring
Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request/response processing logic.
api-security-review
Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.
jira-cli
Interact with Jira from the command line to create, list, view, edit, and transition issues, manage sprints and epics, and perform common Jira workflows. Use when the user asks about Jira tasks, tickets, issues, sprints, or needs to manage project work items.
calculator
Performs arbitrary-precision arithmetic calculations including addition, subtraction, multiplication, division, and exponents. Use when the user asks to calculate, compute, or evaluate math expressions, or when precise decimal arithmetic is needed to avoid floating-point errors.