# Linux Server Exposure Audit

> Read-only audit of a Linux server's real exposure surface: what is listening, who runs it, crash loops, and container failures systemd cannot see. Severity-ranked, changes nothing.

Linux Server Exposure Audit is a free AI agent skill on Agensi by 合尘猫 SavantCat, in DevOps & Cloud. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [合尘猫 SavantCat](https://www.agensi.io/creators/savantcat)
- Category: [DevOps & Cloud](https://www.agensi.io/skills/devops-cloud)
- Uses: 3
- Version: 1.0
- Last updated: 2026-10-07
- Security: scan passed (2026-10-07); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/linux-server-exposure-audit
- Tags: devops, linux-security, docker, systemd, server-hardening

## About this skill

### What it does

Audits a Linux server's real exposure surface and service health, read-only, and reports severity-ranked findings. It is built on one idea: an audit that checks a single layer is not an audit — the interesting failures live *between* layers.

Four layers matter: **cloud** (what the network allows in), **host** (what is listening, who runs it, what crashed), **container** (what Docker is actually doing), and **app** (does the real user path work). This skill checks the first three mechanically and states plainly that it does not cover the fourth.

### Why use it

Because the standard checks lie, in specific and repeatable ways:

- **`systemctl is-active` reports the unit, not the workload.** A service that has restarted 137 times is still "active", and your dashboard is still green. The honest counter is `NRestarts`.
- **Container failures are invisible to systemd.** `docker.service` stays active while containers crash-loop, and `systemctl --failed` reports zero. Both statements are true and both are useless. Container state has to be its own layer.
- **A service can be running as root while the unit file looks harmless**, because systemd uses the *last* assignment in a section — inserting `User=appuser` above an existing `User=root` silently does nothing.
- **`cap_drop: ALL` changes which file permissions work** inside a container. Its root loses the ability to bypass permission bits, so a "purely defensive" chmod on a bind-mounted directory can cut the container's access and take production down.
- **A firewall check can invert its own answer.** The string `not running` contains `running`. A scanner that searches for `running` reports an absent firewall as present and drops the finding entirely.

### How it works

1. Collects a fixed allowlist of read-only facts. `--print-commands` prints the entire list and runs none of it.
2. Classifies every fact by layer and severity. HIGH means reachable from outside or already broken for users. INFO means a deliberate trade-off, recorded so it stops reappearing in every future audit.
3. Emits a report with the specific fix for each finding, not a generic checklist.

`--from <dir>` captures facts on one host and analyzes them anywhere — including a host you cannot install anything on. It is also what makes the analyzer testable.

### Verified, not claimed

It ships a control-group self-check:

```
$ python scripts/self_check.py
unhealthy fixture : 18 findings {'HIGH': 8, 'MEDIUM': 5, 'LOW': 3, 'INFO': 2}
healthy fixture   : 0 findings
PASSED
```

The broken host must produce the expected findings at the expected severities, and the healthy host must produce **zero**. A scanner that always finds something is as useless as one that finds nothing. One bug in this skill's first draft — the firewall inversion above — was caught by exactly this check.

### What it is not

- It reports; it does not patch, restart, install, or change a single setting. Fixes are your decision.
- Not a malware or rootkit scanner.
- It reads the host's view of itself. The cloud security group must be checked separately.
- Not an application monitor. A port that accepts a connection is not a feature that works.
- Requires root for complete results; without it, process names are hidden and the report says so.

### FAQ

**Q: Will it change anything on my server?**
No. Every probe is read-only and lives in one literal allowlist you can print first with `--print-commands`. No shell is ever invoked, nothing is written to the host, and no network request is made. It runs with `shell=False` and a literal argument list, so there is no injection surface.

**Q: Does it need Python packages, or an API key?**
No. Standard library only, no network, no key. It degrades gracefully when `docker`, `getenforce`, or a firewall tool is absent — a host missing a tool loses those checks and reports the rest.

## Known limitations

Read-only tool. Does not audit application-level logic or cloud-provider security groups. Requires root for full host-level visibility.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Linux Server Exposure Audit skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this audit differ from standard system monitoring tools like systemctl?

Unlike tools that only check if a service is 'active,' this skill identifies hidden failures like container crash-loops, excessive service restarts, and root-privilege escalations that standard dashboards often miss.

### Can this skill automatically fix the security issues it finds?

No, the skill is strictly read-only and follows a 'no-touch' philosophy. It identifies vulnerabilities and provides specific remediation steps, but it will never modify your configurations, install packages, or restart services.

### Which Linux distributions and container runtimes are supported?

The skill is designed for any modern Linux environment and features deep integration for systemd and Docker; it gracefully skips checks for tools not present on your specific distribution.

### Does the audit require an internet connection or third-party Python libraries?

The skill operates with zero external dependencies and requires no API keys or internet access, making it ideal for air-gapped or high-security environments.

### Can I run the analysis on a different machine than the one being audited?

Yes, you can use the `--from <dir>` flag to ingest facts collected from one machine and analyze them on another, allowing you to audit sensitive hosts where you cannot install new software.

### Is root access mandatory for the audit to function?

While the skill can run as a standard user, it requires root privileges to accurately map process names to open ports and verify internal container states; it will explicitly flag any data it couldn't access due to permissions.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
