# harden_host

Host hardening: services, permissions, systemd, cron, umask, banners, USB control

Agent View of the PolicyLayer registry record for `harden_host`. HTML page: https://policylayer.com/tools/defense/harden-host

## Facts

- Tool: `harden_host`
- Server: Defense (`defense-mcp-server`) — https://policylayer.com/tools/defense.md
- Install: `npx -y defense-mcp-server`
- Homepage: git+https://github.com/bottobot/defense-mcp-server.git
- Risk category: Write (Medium risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 12 (1 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `mode` | string | no | Octal permissions, e.g. '600' |
| `path` | string | no | File or directory path |
| `group` | string | no | File group, e.g. 'root' |
| `owner` | string | no | File owner, e.g. 'root' |
| `scope` | string | no | Permissions audit scope |
| `action` | string | yes | Action to perform |
| `dry_run` | boolean | no | Preview changes |
| `service` | string | no | Service name |
| `targets` | array | no | Files to update for umask |
| `show_all` | boolean | no | Show all services, not just flagged |
| `device_id` | string | no | USB device ID in vendor:product format |
| `recursive` | boolean | no | Apply recursively |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "harden_host",
    "arguments": {
      "action": "<action>"
    }
  }
}
```

## Why harden_host is rated Medium

The tool creates or modifies system configurations (services, permissions, systemd, cron, umask, banners, USB control) which are reversible changes. While it affects security posture significantly, these modifications are not inherently destructive (can be undone/reverted) and do not execute arbitrary code or delete data.

From the tool's own definition: "Tool performs host hardening via modifying services, permissions, systemd configurations, cron jobs, umask settings, and system banners—all of which involve creating or modifying system configurations and settings."

Risk signals: Accepts file system path (path) · High parameter count (21 properties)

## Use case

AI agents use harden_host to create or update resources in Defense, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Defense environment.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Defense:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "harden_host": {
      "limits": [
        {
          "counter": "harden_host_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Defense (30)

- `app_harden` — Execute — https://policylayer.com/tools/defense/app-harden.md
- `container_isolation` — Execute — https://policylayer.com/tools/defense/container-isolation.md
- `crypto` — Execute — https://policylayer.com/tools/defense/crypto.md
- `ebpf` — Execute — https://policylayer.com/tools/defense/ebpf.md
- `firewall` — Execute — https://policylayer.com/tools/defense/firewall.md
- `harden_kernel` — Execute — https://policylayer.com/tools/defense/harden-kernel.md
- `honeypot_manage` — Execute — https://policylayer.com/tools/defense/honeypot-manage.md
- `incident_response` — Execute — https://policylayer.com/tools/defense/incident-response.md
- `malware` — Execute — https://policylayer.com/tools/defense/malware.md
- `sudo_session` — Execute — https://policylayer.com/tools/defense/sudo-session.md
- `vuln_manage` — Execute — https://policylayer.com/tools/defense/vuln-manage.md
- `waf_manage` — Execute — https://policylayer.com/tools/defense/waf-manage.md
- `wireless_security` — Execute — https://policylayer.com/tools/defense/wireless-security.md
- `zero_trust` — Execute — https://policylayer.com/tools/defense/zero-trust.md
- `api_security` — Read — https://policylayer.com/tools/defense/api-security.md
- `cloud_security` — Read — https://policylayer.com/tools/defense/cloud-security.md
- `dns_security` — Read — https://policylayer.com/tools/defense/dns-security.md
- `secrets` — Read — https://policylayer.com/tools/defense/secrets.md
- `access_control` — Write — https://policylayer.com/tools/defense/access-control.md
- `backup` — Write — https://policylayer.com/tools/defense/backup.md
- `compliance` — Write — https://policylayer.com/tools/defense/compliance.md
- `container_docker` — Write — https://policylayer.com/tools/defense/container-docker.md
- `defense_mgmt` — Write — https://policylayer.com/tools/defense/defense-mgmt.md
- `integrity` — Write — https://policylayer.com/tools/defense/integrity.md
- `log_management` — Write — https://policylayer.com/tools/defense/log-management.md
- `network_defense` — Write — https://policylayer.com/tools/defense/network-defense.md
- `patch` — Write — https://policylayer.com/tools/defense/patch.md
- `process_security` — Write — https://policylayer.com/tools/defense/process-security.md
- `supply_chain` — Write — https://policylayer.com/tools/defense/supply-chain.md
- `threat_intel` — Write — https://policylayer.com/tools/defense/threat-intel.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=defense · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/defense
