
Bastion Host Hardening: Control the Admin Path to Production
A bastion host is only useful if it is the single, logged way into production. Harden the admin path: who gets in, how they authenticate, and what gets recorded.
The short answer
A bastion host hardens the administrative path to production by making it narrow, named and recorded. Production servers accept admin connections only from the bastion; each administrator has an individual account with phishing-resistant authentication; access is granted per target and expires; and every session is logged off-host. If servers can also be reached another way, the bastion adds paperwork, not protection.
Who this is for
This is for the CTO, head of infrastructure or security lead at an online casino, crypto exchange, sportsbook or fintech whose production servers are administered over SSH or RDP and who wants one defensible answer to the auditor's question, "Who can log in to production, and how do you know what they did?" It sits next to your baseline work, not instead of it. For the order of hardening in an iGaming cloud estate, see cloud hardening for an online casino; for exchanges, hardening a crypto exchange. This article covers one control in those lists, the admin path, in enough depth to implement and to check.
What a bastion actually enforces
The word "bastion" gets used for any jump server. The useful definition is functional. A bastion is working when four statements are true at the same time:
- Single path. There is no other way to get an administrative session on a production server. Network rules, not good intentions, enforce it.
- Named identity. Every session starts from an individual account that maps to one person, so the log says who.
- Scoped, expiring access. The account can reach the targets its role needs, for the time it needs them, and not the whole estate permanently.
- Independent record. The evidence of what happened lives somewhere an administrator, or an attacker using an administrator's access, cannot quietly edit.
If one of the four fails, the bastion becomes a ceremonial gate. The most common failure is the first: a bastion exists, but a legacy security group still allows admin ports from a wider range, a vendor has a direct path, or a monitoring tool holds a standing key with shell access. Attackers find the second door.

Step 1: close every other door first
Before hardening the bastion itself, establish what can currently reach administrative ports. This is the part most teams skip, because it is tedious and it is where the real exposure is found.
- Enumerate. List every server and every administrative service (SSH, RDP, database consoles, hypervisor and cloud management interfaces, out-of-band controllers). Record which source ranges can reach each one.
- Compare with the design. The answer you want is "only the bastion or the management network." Every other source is either a finding or an exception that needs an owner and an expiry.
- Check the cloud layer too. Cloud provider consoles and API keys are administrative paths. A hardened SSH route does not help if an access key with broad rights sits in a CI variable.
- Re-check after changes. New servers often inherit permissive defaults. Configuration drift after go-live is how a clean design degrades.
An authenticated check from the outside and from the inside will tell you more than a diagram. This is what a server hardening engagement verifies first, because it determines how much of the rest matters.
Step 2: harden the bastion itself
The bastion is a high-value target by design: it holds a path to everything. Keep it small and boring.
| Area | What to do | Why |
|---|---|---|
| Role | Run only the access service and its logging agent; no web server, no admin tooling, no compilers | Fewer components, fewer flaws to exploit |
| Exposure | Allow inbound only from the sources that genuinely need it, such as a corporate egress range or a VPN | Shrinks who can even attempt a login |
| Authentication | Individual accounts; key-based or certificate-based login; password login off; a second factor, preferably a hardware key | Removes guessable and shareable credentials |
| Authorization | Restrict login to a named group; map roles to target lists | Limits blast radius of one stolen account |
| Forwarding | Disable agent and port forwarding unless a documented need exists | Stops the bastion becoming a general-purpose relay |
| Patching | Treat it as a priority-one asset in the patch schedule | A flaw here equals a flaw in front of everything |
| Build | Create it from a known image or configuration, rebuild rather than repair | Makes tampering visible and recovery routine |
| Logging | Send authentication and session logs off-host in near real time | Preserves evidence if the host is compromised |
The exact settings depend on your operating system and access product. The OpenSSH documentation describes the relevant server options, and a CIS Benchmark for your platform gives a reviewed starting point. Take it as a baseline to adapt and to test, not a certificate.
Step 3: replace standing access with grants
Permanent access for everyone who might need it one day is the default in most estates, and it is the thing that turns a single phished engineer into a full compromise. The better pattern is a grant:
- Per role, per target group. Support engineers reach application hosts; database administrators reach database hosts; nobody reaches everything.
- Time-bound. Elevated access expires. A short-lived credential issued after approval costs the engineer a few seconds and removes the "forgotten key from two years ago" problem.
- Approved by someone who is not the requester for the sensitive tier: signing hosts, payment back-office systems, production databases.
- Written down. The grant record, who, what, why, until when, is what lets you answer an audit question without archaeology.
Two groups need separate treatment because they are often outside the staff list: vendors and break-glass accounts. A vendor path should be a named account, on the same bastion, with an end date, not a permanent tunnel. A break-glass account, for the day the identity system is down, should exist, be sealed, be monitored and alert loudly when used. For what happens to access when people leave, identity hardening in an online casino shows how help-desk and identity processes become the weak link.
Step 4: make the record trustworthy
Logging is the least exciting part of the design and the one that decides whether you can investigate. Decide in advance:
- What is logged. Authentication success and failure, source address, target, start and end time. Where your policy and privacy rules allow, session recording for the highest-risk tier.
- Where it goes. Off the bastion, to a system the administrators do not control, with restricted deletion.
- Who reads it. A log nobody reviews is a delay, not a control. Route bastion events to your monitoring, whether in-house or a managed SOC, and agree which patterns are worth a page: a login from a new country, a grant used outside its window, a break-glass account in use.
- How long it is kept. Set by your regulators and your investigations need, not by the default disk size.
This record is also what makes later forensics possible; the order of what to capture is in incident evidence preservation.
Common ways the design is bypassed
Reviews of admin paths find the same bypasses repeatedly:
- A second bastion built by a team in a hurry and never retired.
- Shared accounts kept "for emergencies" and used daily.
- Long-lived private keys on laptops and in repositories, with no inventory.
- Cloud console access that skips the bastion entirely and reaches the same servers via an agent or serial console.
- Monitoring and backup tools with root-equivalent access and their own network path.
- Direct vendor tunnels that predate the policy.
None of these needs a sophisticated attacker. They need one credential and one open port. Each is a line in an inventory you can write in an afternoon.
Limitations
A bastion is one control among many. It does not stop an attacker who steals an engineer's valid session, abuses a legitimate grant, or exploits an application flaw reachable without admin access. It adds latency and a point of failure, so the break-glass procedure and the availability of the bastion itself need planning. The table above is a template; the correct controls depend on your operating systems, access products and regulatory obligations, and nothing here is a statement about any specific vendor's product.
What to do next
Start with Step 1: write down every source that can reach an administrative port today and mark what is not the bastion. That list is the work plan. If you want a second pair of eyes on that inventory and on your baseline, request a baseline review. The security hardening page describes how AnySec scopes and verifies this kind of work.
Sources and review
This article draws on public guidance: NIST SP 800-123, Guide to General Server Security, on securing server access and administration; the CIS Critical Security Controls v8, which include account management and access control safeguards; and the OpenSSH manual pages for server configuration options. The four-statement test and the table are an AnySec Engineering working template, not a standard. This article cites no AnySec-original statistics or SLA figures. Reviewed by AnySec Engineering on 2026-12-01.
Related reading
- Cloud hardening for an online casino: what comes first — where admin-path control sits among the early hardening steps.
- Server hardening report: what it must contain — how to check that access findings are reported with evidence.
- Configuration drift after go-live — keeping a clean admin path from decaying.
Frequently asked questions
- What is a bastion host?
- A bastion host is a deliberately hardened server that acts as the single controlled entry point for administrators who need to reach production systems. Admin sessions go through it instead of connecting to each server directly. Its value is not the machine itself but the rule it enforces: one narrow path in, with strong authentication, access control and a record of every session.
- Is a bastion host the same as a VPN?
- No. A VPN extends a network to a user's device, so a compromised laptop can reach whatever the VPN routes to. A bastion host brokers individual administrative sessions to named targets and can record them. Many teams use both: the VPN gets an engineer onto a management network, and the bastion decides which servers they may administer and logs what they do.
- Should production servers accept SSH from the internet?
- As a rule, no. Production servers should accept administrative connections only from the bastion or a management network, with the firewall or security group enforcing that. Direct internet-facing admin ports are a frequent target for credential guessing and for exploitation of any flaw in the service. Closing them removes a large part of the exposed surface in one change.
- How should administrators authenticate to a bastion?
- With individual accounts, a second factor that resists phishing such as a hardware security key, and no shared logins. Password-only SSH and long-lived shared keys make it impossible to say who did what and are hard to revoke. Short-lived credentials issued per session reduce what a stolen laptop or key is worth.
- What should a bastion host log?
- At minimum: who authenticated, from where, when, which target they reached, and when the session ended. Where policy allows, record session activity as well. Ship the logs off the bastion to a separate system, so that someone who compromises the host cannot edit their own trail, and feed them to whoever monitors your environment.
Rather not learn this in production.
Talk to the engineers behind these write-ups — no sales script, a straight read on where you stand.
Get a fixed quote