TL;DR: Self-managed bastion host logging can capture utmp, wtmp, btmp, syslog, and auditd data, but StrongDM’s tutorial also shows how quickly the resulting audit trail becomes complex, noisy, and dependent on brittle local configuration. For IAM and NHI teams, the lesson is that visibility without governance, retention, and integrity controls is not a durable control model.
At a glance
What this is: This tutorial explains how to configure bastion host SSH logging and audit collection, and it shows why local logging alone is fragile for long-term accountability.
Why it matters: It matters because bastions sit inside privileged access paths, and IAM teams need evidence that survives compromise, supports investigations, and maps cleanly to NHI and human access governance.
👉 Read StrongDM's tutorial on bastion host SSH logging and audit setup
Context
Bastion host SSH logging is the practice of recording logins, session activity, and file or command changes on a privileged access jump point. The problem is not whether logs exist, but whether they are complete, tamper-resistant, and usable when an incident forces you to reconstruct access history.
For IAM and PAM programmes, bastions are a governance choke point for both human administrators and non-human access paths that depend on shared infrastructure. A logging design that relies on local files, manual review, or ad hoc shell scripts creates audit gaps that are hard to defend in compliance reviews and incident response.
The tutorial’s core lesson is typical of self-managed bastion setups: visibility can be assembled, but operational trust is fragile unless log capture, retention, and off-host storage are treated as first-class controls.
Key questions
Q: How should security teams log privileged SSH access from bastion hosts?
A: Security teams should treat bastion logging as an evidence control, not just a troubleshooting feature. Capture login history, session activity, and privileged file changes, then forward records to off-host storage so the bastion cannot erase its own trail. The goal is a durable audit chain that still exists after compromise or deletion.
Q: What breaks when bastion logs stay only on the jump host?
A: When bastion logs stay only on the jump host, the record is vulnerable to the same compromise that affects the access path. That creates a blind spot for incident response, compliance, and post-incident reconstruction. If the host is altered or deleted, the organisation loses the evidence needed to prove who accessed what and when.
Q: How do you know if bastion auditd coverage is actually working?
A: Auditd coverage is working when it can reliably show who changed a sensitive file, which command made the change, and when it happened, without overwhelming analysts with irrelevant events. A healthy setup balances granularity with reviewability, so the audit trail supports investigations instead of generating unmanageable noise.
Q: Who is accountable when a bastion audit trail is incomplete?
A: Accountability sits with the team that owns privileged access design, logging retention, and review. If bastion logs are incomplete, local only, or writable by ordinary users, the control design is deficient even if the host is technically logging. Governance requires evidence that survives incidents and can be audited independently.
Technical breakdown
utmp, wtmp, and btmp as bastion host audit sources
Linux maintains several native records that are useful for bastion auditing. Utmp tracks current users and session state, wtmp provides historical login and logout records, and btmp records failed authentication attempts. These files help establish who connected and when, but they are not a complete evidence chain. They show session outcomes, not the full operational context behind commands, file changes, or downstream privilege use. In a privileged access workflow, those gaps matter because login success alone does not prove safe activity or controlled administration.
Practical implication: treat native login files as baseline evidence, not as a complete accountability control.
Rsyslog forwarding and off-host log retention
The article’s forwarding pattern uses syslog-style shipping to move logs from the bastion to an external service. That design matters because compromise of the bastion should not erase the only copy of its own evidence. Off-host retention improves survivability, but it also introduces integrity, transport, and retention questions. If the forwarding path is misconfigured, delayed, or incomplete, the audit record becomes partial just when it is most needed. The control is therefore less about logging itself and more about whether the log chain survives the same threat that hits the bastion.
Practical implication: verify that critical access logs are stored outside the bastion and preserved independently of host compromise.
Auditd granularity versus operational noise
Auditd captures file changes, command execution, and system events with much greater granularity than simple login logs. That depth is powerful because it can show what changed, which user context was involved, and which command triggered the event. The trade-off is scale and interpretability. Too many rules create a flood of events that overwhelms analysts and consumes SIEM storage, while too few rules leave blind spots. Bastion auditing therefore becomes an exercise in defining which actions matter enough to justify durable, reviewable records.
Practical implication: scope audit rules narrowly to high-risk files, commands, and directories that support privileged access investigations.
Threat narrative
Attacker objective: The objective is to use the bastion’s privileged position to obscure administrator activity and weaken post-incident reconstruction.
- Entry begins with privileged administration over a bastion host, where SSH access and session handling become the audit surface that attackers or insiders can abuse if the host is weakly managed.
- Credential access or misuse occurs when login evidence is incomplete, locally stored, or easily altered, making it difficult to prove who used the bastion and what they did after connecting.
- Impact follows when the bastion becomes an unreliable point of trust, leaving incident responders without durable records for forensics, compliance, or containment decisions.
Breaches seen in the wild
- ASP.NET machine keys RCE attack — 3,000+ exposed ASP.NET machine keys enabled remote code execution.
- DeepSeek breach — DeepSeek breach exposed 1M+ log lines and sensitive secret keys.
Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Self-managed bastion logging is only as strong as its off-host evidence path. A bastion can collect utmp, wtmp, btmp, syslog, and auditd data, but that does not make the control defensible if the host remains the primary repository. The governance issue is survivability of evidence, not volume of evidence. In identity terms, the control fails when the audit trail depends on the same system that the privileged actor can reach. The practitioner conclusion is that the integrity of access history must outlive the bastion itself.
Audit depth without access governance creates a noisy accountability model. Auditd can capture file changes and command activity, but granular telemetry is only useful when mapped to defined privileged access purposes and review workflows. Otherwise, teams accumulate records they cannot triage at the speed incidents demand. This is a governance problem, not just a logging problem, and it sits squarely in the intersection of PAM, IGA, and NHI oversight. Practitioners should treat event scope and reviewability as one control design decision.
Portable session logging changes the evidentiary model for remote access. Recording interactive sessions into shared directories may help expose command history, but weak permissions such as world-writable storage create a new trust problem. The system then relies on a log repository that ordinary users can read or delete, which undermines the very audit evidence the design is meant to preserve. That is a classic example of control layering without control assurance. The practitioner implication is that session capture must be paired with immutability and restricted access.
Identity programmes should assume bastion logs are a control plane, not an afterthought. When organisations use bastions for SSH, RDP, or other administrative access, logs become part of the access architecture itself. If logging, forwarding, retention, and review are not designed together, the bastion becomes a governance exception rather than a governed access path. This is especially relevant where shared administrative pathways bridge human and machine access. The practitioner conclusion is that bastion audit design belongs in IAM and PAM architecture reviews, not in ad hoc infrastructure setup.
Named concept: audit trail survivability. This is the condition where privileged access records remain usable after the source host is compromised, altered, or deleted. The article shows that survivability depends on off-host storage, carefully scoped auditing, and operational review, not just on turning on more logs. The practitioner takeaway is to judge bastion logging by whether it can still support investigation after the bastion fails.
From our research:
- Only 5.7% of organisations have full visibility into their service accounts, according to Ultimate Guide to NHIs.
- 91.6% of secrets remain valid five days after the targeted organisation is notified, which shows how slowly remediation can lag behind exposure.
- For a wider view of the governance gap, see 52 NHI Breaches Analysis, which maps recurring failure patterns across real incidents.
What this signals
Audit trail survivability: bastion logging should now be treated as a resilience requirement, not a convenience feature. If the evidence lives only on the system being administered, the control fails the moment it is tested. Teams that manage privileged SSH paths should align logging architecture with Zero Trust expectations and preserve records outside the access plane.
The broader identity signal is that visibility gaps remain the norm, not the exception. With only 5.7% of organisations reporting full visibility into their service accounts, per Ultimate Guide to NHIs, bastion logging is only one part of a larger observability deficit that affects human admins and non-human actors alike. Programmes that do not connect logging to lifecycle and review will keep producing evidence they cannot operationalise.
For practitioners
- Separate evidence from the bastion host Forward SSH and audit logs to a secondary system so compromise of the jump box does not destroy the only record of privileged activity.
- Limit auditd to high-value targets Track only the files, directories, and command patterns that matter for privileged access investigations, such as account databases and sensitive admin paths.
- Harden session-record storage Avoid world-writable log directories and restrict read and delete permissions so captured sessions cannot be erased by ordinary users.
- Map bastion logs to review workflows Tie login records, command history, and file-change alerts to a defined triage process so the evidence is actually reviewed instead of archived indefinitely.
Key takeaways
- Bastion host logging is useful only if the audit trail survives host compromise and remains independently reviewable.
- The article shows that native Linux logs and auditd can create strong visibility, but they also introduce noise, storage, and permission risks.
- The control that matters most is not log generation alone, but durable off-host retention with scoped review and restricted access.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-07 | Bastion logging and secret handling touch NHI visibility and auditability. |
| NIST CSF 2.0 | PR.PT-1 | Protective technology should preserve access logs and system integrity. |
| NIST Zero Trust (SP 800-207) | PR.AC-4 | Privileged access paths need continuous verification and auditability. |
Forward bastion logs off-host and verify NHI evidence remains usable after compromise.
Key terms
- Bastion Host: A bastion host is a hardened jump server that mediates privileged administrative access to internal systems. It concentrates SSH or remote access into one controlled path, which makes logging, session oversight, and off-host evidence retention critical to its value as an access governance control.
- Auditd: Auditd is the Linux audit subsystem used to record system events such as file changes, command execution, and authentication-related activity. In privileged access environments, it provides detailed evidence, but the rules must be scoped carefully so the resulting logs remain reviewable and operationally useful.
- Audit Trail Survivability: Audit trail survivability is the degree to which access records remain available and trustworthy after the source system is compromised, altered, or deleted. It depends on off-host storage, access restrictions, retention design, and the ability to validate evidence independently of the asset being administered.
Deepen your knowledge
Bastion host audit logging, privileged session review, and NHI evidence retention are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or validating a logging model for privileged access, it is worth exploring.
This post draws on content published by StrongDM: How to Configure Bastion Host for SSH Logging | Part 3 - Tutorial. Read the original.
Published by the NHIMG editorial team on 2025-06-25.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org