Skip to main content
Glama

harden_bastion

Destructive

Harden the sshd configuration of an Ankra-provisioned cluster's SSH bastion by applying a curated, lockout-safe action set as a revertable drop-in under /etc/ssh/sshd_config.d: disable_password_auth (also disables keyboard-interactive auth), disable_x11_forwarding, restrict_root_login (root becomes key-only), tighten_auth_limits (MaxAuthTries 3, LoginGraceTime 20, MaxStartups 10:30:200), or revert_hardening to remove the drop-in and restore the previous configuration. Omitting actions applies the full hardening set. It does NOT run arbitrary commands - only these curated actions, with every guardrail enforced server-side. The job validates the new configuration with sshd -t BEFORE activating it, rolls back automatically if validation fails, reloads (never restarts) sshd so existing sessions survive, and proves a fresh SSH connection still authenticates afterwards. The platform's own key-authenticated connection is the lockout backstop: disabling password auth cannot cut off platform access. It refuses to disable password authentication while the journal shows password logins in the last 7 days unless acknowledge_password_lockout is true - run diagnose_bastion first and confirm those consumers hold working keys. The result's report is authoritative: 'applied' true or false, 'refused' with 'refusal_reason' when a guardrail stopped it, 'validation'/'reload' when the new configuration was rejected or the reload failed, and 'fully_effective' plus 'shadowed_directives' when the drop-in is live but an earlier-matching sshd directive overrides part of it. Use this after diagnose_bastion reports password authentication enabled, sustained brute-force pressure, or MaxStartups throttling.

Input Schema

NameRequiredDescriptionDefault
actionsNoCurated hardening actions to apply. Omit for the full hardening set (an empty list is rejected, never widened). revert_hardening must be the only action when used.
cluster_idNoUUID of the cluster. Optional when a cluster is selected.
cluster_nameNoExact name of the cluster. Optional when a cluster is selected.
acknowledge_password_lockoutNoSet true only after confirming every consumer seen authenticating with a password holds a working SSH key; required when the journal shows password logins in the last 7 days.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already flag destructiveHint=true and non-idempotent, but the description goes well beyond them: it discloses the drop-in location, sshd -t validation before activation, automatic rollback on validation failure, reload-not-restart so sessions survive, and the key-authenticated platform connection as a lockout backstop. It also discloses the refusal guardrail and the report fields (applied/refused/validation/reload/fully_effective/shadowed_directives), which the annotations cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose and the action list before the safety narrative, and nearly every clause carries distinct information. It is one long paragraph, though, so the guardrails/result-shape material is harder to scan than it needs to be; splitting the report-field list would improve it without losing content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description compensates by defining the result contract (applied, refused+refusal_reason, validation/reload, fully_effective+shadowed_directives) in the authoritative-result sentence. Combined with the refusal precondition and rollback behavior, an agent has everything needed to invoke and interpret this destructive tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% so a baseline of 3 would be defensible, but the description adds meaning the schema does not: the concrete effect of each action (keyboard-interactive also disabled, root becomes key-only, MaxAuthTries 3 / LoginGraceTime 20 / MaxStartups 10:30:200) and that omitting actions applies the full set. This turns the bare enum into actionable semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a precise verb+resource ('Harden the sshd configuration of ... SSH bastion') and immediately scopes it with a curated, lockout-safe action set applied as a revertable drop-in. It explicitly distinguishes itself from siblings by saying it does NOT run arbitrary commands and by naming diagnose_bastion as the prerequisite. An agent can separate it from diagnose_bastion, get_bastion_health, and resize_bastion without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit trigger ('Use this after diagnose_bastion reports password authentication enabled, sustained brute-force pressure, or MaxStartups throttling'), names the alternative (diagnose_bastion first), and states a conditional exclusion for disabling password auth unless acknowledge_password_lockout is true. The preconditions for each action are spelled out rather than implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources