> For the complete documentation index, see [llms.txt](https://hardening.khandal.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hardening.khandal.tech/system-hardening.md). Agents can also search and read this documentation through its [MCP server](https://hardening.khandal.tech/~gitbook/mcp).

# System Hardening

A practical knowledge base for reducing attack surface, strengthening systems, and maintaining secure configurations.

**Reduce the attack surface. Eliminate unnecessary exposure. Build systems that remain secure under real-world operating conditions.**

System Hardening is a technical knowledge base for securing operating systems, endpoints, networks, applications, infrastructure, and the workflows that connect them. It brings together practical configuration guidance, security baselines, verification procedures, and operational notes for building and maintaining systems with a smaller attack surface.

The objective is not to make a system appear secure. It is to make its security posture deliberate, measurable, reproducible, and maintainable.

{% hint style="info" %}
**Core principle:** A hardened system is not simply a system with more security tools installed. It is a system with fewer unnecessary components, less exposed functionality, controlled privileges, defensible configurations, and evidence that its security controls work.
{% endhint %}

## What this knowledge base covers

This space is organized around the security controls that shape a system's attack surface.

| Domain                          | Focus                                                                                                    |
| ------------------------------- | -------------------------------------------------------------------------------------------------------- |
| **Operating system hardening**  | Secure configuration for Windows and Linux, service reduction, permissions, kernel and platform controls |
| **Endpoint security**           | Host firewall, application control, endpoint protection, device security, and removable-media controls   |
| **Identity and access**         | Least privilege, authentication, credential protection, account hygiene, and privileged access           |
| **Network hardening**           | Network exposure, firewall policy, segmentation, secure name resolution, and remote-access controls      |
| **Application security**        | Secure defaults, dependency hygiene, sandboxing, runtime restrictions, and configuration management      |
| **Privacy and data protection** | Encryption, data handling, telemetry choices, secure storage, and backup protection                      |
| **Monitoring and auditing**     | System logs, security events, integrity monitoring, configuration drift, and validation                  |
| **Operational security**        | Patch management, recovery, maintenance, documentation, and repeatable security workflows                |

Coverage will expand as platform-specific guides and tested procedures are added.

## The hardening methodology

Every hardening task should follow a consistent process. This prevents configuration changes from becoming a collection of unverified tweaks.

1. **Establish the baseline.** Identify the platform, version, role, existing configuration, business or operational requirements, and current exposure.
2. **Reduce unnecessary exposure.** Remove or disable components, services, accounts, ports, protocols, and features that are not required.
3. **Enforce security controls.** Apply least privilege, secure authentication, host and network controls, encryption, application restrictions, and appropriate platform security features.
4. **Verify the result.** Confirm that the intended control is active, test expected behavior, inspect logs, and check for unintended impact.
5. **Document and maintain.** Record the change, rationale, validation evidence, rollback path, and maintenance requirements. Reassess after updates or changes in system role.

## Design principles

These principles guide the recommendations and procedures in this space.

* **Least functionality:** Every enabled service, package, feature, protocol, and open interface should have a reason to exist.
* **Least privilege:** Users, processes, and services receive only the permissions required for their role.
* **Secure by default:** Prefer restrictive defaults and explicit allow-lists over broad permissions and implicit trust.
* **Defense in depth:** Use complementary preventive, detective, and recovery controls rather than relying on a single mechanism.
* **Verifiable configuration:** A setting is not considered effective merely because a command completed successfully. Validate the resulting state.
* **Reproducibility:** Prefer documented procedures and configuration-as-code where practical, with clear prerequisites and version context.
* **Recoverability:** Every high-impact change should have a tested or documented recovery path.
* **Operational simplicity:** A control that cannot be maintained consistently can become a liability. Favor proportionate controls that survive routine use.

## The law of inversion: start with failure

Before adding a control, ask how the system could fail or be compromised without it.

Consider the attacker's path: Which interfaces are reachable? Which services can be abused? Which identities hold excessive privileges? Which secrets are exposed? Which security assumptions are unverified? Which failures would go undetected?

Then work backward:

| Inversion question                 | Defensive response                                                                  |
| ---------------------------------- | ----------------------------------------------------------------------------------- |
| What should not be reachable?      | Remove exposure, restrict interfaces, and apply network filtering                   |
| What should not be executable?     | Apply application control, remove unnecessary tooling, and restrict execution paths |
| What should not be trusted?        | Validate identities, enforce least privilege, and constrain trust boundaries        |
| What should not persist unnoticed? | Monitor persistence locations, configuration drift, and security-relevant events    |
| What should not be lost?           | Protect backups, recovery material, and configuration records                       |
| What should never be assumed?      | Verify controls through observable evidence and repeatable tests                    |

This approach prioritizes removing failure paths before adding layers of complexity.

## Documentation standards

Each technical guide should make it possible for another operator to understand, reproduce, and validate the procedure.

Where applicable, guides should include:

* **Scope and objective:** What the procedure secures and what it does not cover.
* **Environment:** Supported operating systems, versions, editions, dependencies, and assumptions.
* **Risk and impact:** Security benefit, compatibility considerations, operational trade-offs, and potential failure modes.
* **Prerequisites:** Required privileges, tools, backups, and access.
* **Implementation:** Exact settings, commands, configuration paths, and explanations of consequential parameters.
* **Validation:** Commands or checks that prove the expected state has been achieved.
* **Rollback and recovery:** How to reverse the change or recover from an unintended outcome.
* **References:** Vendor documentation, standards, advisories, and other authoritative sources.

Commands should be explained rather than presented as unexplained copy-paste snippets. Platform-specific behavior and version differences must be called out explicitly.

## How to use this space

Start with the guide that matches the platform or security domain you are working on. Establish the system's baseline before applying changes, and treat each procedure as a controlled configuration change.

For every recommendation, distinguish between:

* **Required controls** — necessary for the stated security objective.
* **Recommended controls** — improve defense in depth but may depend on the environment.
* **Optional hardening** — useful in specific threat models, with trade-offs that should be understood before deployment.

Do not apply a setting blindly to production systems. Test compatibility, preserve recovery access, and validate the result in the target environment.

## Planned documentation map

The following areas define the intended structure of this knowledge base. Individual guides will be added as procedures are researched, tested, and documented.

* **Foundations:** Threat modeling, attack-surface analysis, hardening methodology, and security baselines.
* **Windows:** Windows 10/11 security configuration, Defender, Firewall, BitLocker, account controls, PowerShell, and attack-surface reduction.
* **Linux:** User and privilege management, SSH, firewalling, services, package integrity, mandatory access controls, and audit configuration.
* **Network:** Host and network firewalls, segmentation, DNS security, secure remote access, and exposed-service review.
* **Applications and development:** Browser and application isolation, dependency hygiene, secrets handling, and secure developer workstations.
* **Validation and maintenance:** Security assessment, configuration auditing, patching, monitoring, backup, and recovery.

## Scope and limitations

Hardening is contextual. A control that is appropriate for a personal workstation may be unsuitable for a server, a forensic workstation, a development environment, or a production service. Recommendations must be evaluated against the system's purpose, threat model, compliance obligations, and recovery requirements.

This knowledge base is intended for authorized defensive administration, security engineering, and research in controlled environments. It does not replace vendor guidance, formal risk assessment, or testing against the actual environment.

***

**Maintain the principle:** minimize what can be attacked, constrain what can be trusted, and verify what is supposed to protect the system.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hardening.khandal.tech/system-hardening.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
