Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3acc2fd
Add networking and security audit documentation
Daemon-linux Nov 17, 2026
4daf93f
Add networking and security audit documentation
Daemon-linux Nov 17, 2026
7a9e431
Add networking and security audit documentation
Daemon-linux Nov 17, 2026
8342e2a
Add networking and security audit documentation
Daemon-linux Nov 17, 2026
1f9d169
Fix audit evidence collection and anonymization
Daemon-linux Nov 17, 2026
f459ca7
Fix audit evidence collection and anonymization
Daemon-linux Nov 17, 2026
2aa6971
Add anonymized networking and security evidence
Daemon-linux Nov 17, 2026
b3fe802
Add complete login definitions audit capture
Daemon-linux Nov 17, 2026
d64c84d
Preserve original login definitions wording
Daemon-linux Nov 17, 2026
cb3a490
Preserve Phase 3 collection metadata
Daemon-linux Nov 17, 2026
f23803c
Preserve project README and add audit stage
Daemon-linux Nov 17, 2026
b24a942
Add networking audit evidence to index
Daemon-linux Nov 17, 2026
f5ff9bf
Index networking security audit documentation
Daemon-linux Nov 17, 2026
f1281db
Add collection metadata and SHA256 evidence manifest
Daemon-linux Nov 17, 2026
f6080e7
Add collection metadata and SHA256 evidence manifest
Daemon-linux Nov 17, 2026
65f6dad
Document evidence checksum manifest
Daemon-linux Nov 17, 2026
8a7bf55
Fix IPv6 anonymization and output path validation
Daemon-linux Nov 17, 2026
e399afc
Add anonymizer regression tests
Daemon-linux Nov 17, 2026
df4f45f
Run Python anonymizer regression tests in CI
Daemon-linux Nov 17, 2026
54326b1
Fix shell validation log formatting
Daemon-linux Nov 17, 2026
f0fff67
Test anonymizer destination path overlap protection
Daemon-linux Nov 17, 2026
fd49814
Avoid writing an invalid checksum manifest when sha256sum is unavailable
Daemon-linux Nov 17, 2026
3c087af
Clarify optional checksum manifest behavior
Daemon-linux Nov 17, 2026
d09a743
Add collector smoke test to audit tooling CI
Daemon-linux Nov 17, 2026
adc7c80
Preserve standard loopback MAC in anonymized evidence
Daemon-linux Nov 17, 2026
6d896c6
Test preservation of standard loopback MAC
Daemon-linux Nov 17, 2026
b4c59f9
Clarify loopback MAC anonymization policy
Daemon-linux Nov 17, 2026
8040d9d
Clarify networking and security audit stage
Daemon-linux Nov 17, 2026
26c4b53
Clarify network and security evidence index
Daemon-linux Nov 17, 2026
36b9b9c
Link audit report directly to evidence and collector
Daemon-linux Nov 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion .github/workflows/shell-syntax.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate shell scripts
name: Validate audit tooling

on:
push:
Expand All @@ -24,3 +24,34 @@ jobs:
printf 'Checking %s\n' "$script"
bash -n "$script"
done < <(find scripts -type f -name '*.sh' -print0)

- name: Smoke-test network evidence collector
shell: bash
run: |
set -Eeuo pipefail
temporary_directory="$(mktemp -d)"
trap 'rm -rf -- "$temporary_directory"' EXIT
output_directory="$temporary_directory/evidence"
bash scripts/collect-evidence/collect-network-security-evidence.sh "$output_directory"
text_file_count="$(find "$output_directory" -maxdepth 1 -type f -name '*.txt' | wc -l)"
test "$text_file_count" -eq 31
test -f "$output_directory/SHA256SUMS"
(cd "$output_directory" && sha256sum --check SHA256SUMS)

python-validation:
name: Python syntax and anonymizer tests
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Validate Python syntax
run: python -m py_compile scripts/collect-evidence/anonymize-audit-evidence.py

- name: Test anonymizer
run: python -m unittest discover -s scripts/collect-evidence -p 'test_*.py' -v
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ See [the build reference](references/BUILD-REFERENCE.md) and [build environment
| [06 — Kernel and bootloader](screenshots/06-kernel-and-bootloader/README.md) | Kernel configuration, modules, boot files and GRUB |
| [07 — Testing and validation](screenshots/07-testing-and-validation/README.md) | Existing test-log inventory and validation limitations |
| [08 — Final system](screenshots/08-final-system/README.md) | GRUB menu, first boot and final system state |
| [09 — Networking and security baseline audit](screenshots/09-networking-and-system-audit/README.md) | 30 anonymized network/security command captures and audit report |

The `screenshots/` directory retains its historical name, but includes text captures, scripts and archives as well as images.

Expand All @@ -57,6 +58,7 @@ The `screenshots/` directory retains its historical name, but includes text capt
- [Boot process: firmware, GRUB, kernel and systemd](docs/boot-process.md)
- [ELF binaries and dynamic linking](docs/elf-and-dynamic-linking.md)
- [Testing and validation methodology](docs/testing-and-validation.md)
- [Networking and security baseline audit](docs/networking-and-security-audit.md)
- [Troubleshooting](troubleshooting/README.md)
- [Project sources](references/sources.md)

Expand All @@ -69,13 +71,15 @@ The `screenshots/` directory retains its historical name, but includes text capt
- Linux kernel configuration and modules
- GRUB bootloader and system initialization with systemd
- Test-log interpretation and troubleshooting
- Networking, name resolution, service state and security-baseline evidence

## Evidence policy

- Captured output records what a command reported at collection time.
- A command-presence check is not proof that a package test suite passed.
- A compiler's native target is not automatically the LFS target triplet.
- Test failures, skips and incomplete records must not be relabeled as successful results.
- The networking/security audit is read-only; it is not a penetration test or security certification.
- The LFS book itself is not included; use the official [LFS 13.1-systemd book](https://www.linuxfromscratch.org/lfs/view/13.1-systemd/).

## License
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Project-authored explanations that complement the captured evidence. These docum
- [ELF and dynamic linking](elf-and-dynamic-linking.md) — executable formats, shared libraries and inspection commands.
- [Testing and validation](testing-and-validation.md) — interpreting logs and separating presence checks from test results.
- [Test archive audit](test-archive-audit.md) — findings and limitations from the archived LFS test summaries.
- [Networking and security baseline audit](networking-and-security-audit.md) — read-only review of network configuration, resolver state, services, accounts, firewall visibility and selected kernel parameters.

## Documentation rules

Expand Down
217 changes: 217 additions & 0 deletions docs/networking-and-security-audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
# Networking and Security Baseline Audit

## 1. Overview

This document records a read-only networking and security baseline review of the Linux From Scratch (LFS) 13.1-systemd system built for this project. The captured system identifies itself as Linux From Scratch, runs on x86_64, and reported kernel `7.1.8`. The virtual machine uses KVM/QEMU.

The purpose is to document the system as built, not to apply custom hardening. No firewall, resolver, account, kernel, or systemd service settings were changed during this audit.

This is a configuration and evidence review. It is not a penetration test, vulnerability scan, security certification, or production-readiness assessment.

## 2. Scope and methodology

The audit uses 30 command-output captures collected in two phases:

- **Phase 2 (14 captures):** interfaces, IP addressing, routing, DNS lookup, listening sockets, running and failed services, accounts, groups, account-file metadata, SSH unit lookup, kernel, OS release, and hostname.
- **Phase 3 (16 captures):** resolver status and service, networkd service, resolver files, network configuration file inventory, enabled unit files, systemd sandboxing scores, firewall command availability, forwarding settings, selected network sysctls, login definitions, shell umask, and interactive-shell account listing.

The evidence describes the state at collection time (2026-11-15). It is not a guarantee of the system's current state after later boots or configuration changes. Original command output has been retained in individual text files, with identifying values anonymized where appropriate.

### Evidence labels

- **Verified from captured output:** directly shown by one or more supplied command outputs.
- **Observed:** a recorded runtime/configuration value that is not automatically a defect.
- **Not verified:** the available commands or output do not establish the claim.
- **Out of scope:** deliberately not tested or modified.

## 3. Network configuration

**Verified from captured output:**

- Interface `enp1s0` was up.
- IPv4 address: `192.168.122.54/24`, obtained through DHCP.
- Default gateway: `192.168.122.1`.
- Connected network: `192.168.122.0/24`.
- The loopback interface was present.

The `getent hosts example.com` test returned two IPv6 address records. This verifies that this particular name lookup succeeded at collection time. It does not independently establish general Internet reachability, connectivity to arbitrary destinations, or DNS reliability.

## 4. DNS and name resolution

**Verified from captured output:**

- `systemd-resolved.service` was enabled and active (running).
- `/etc/resolv.conf` was a symbolic link to `../run/systemd/resolve/stub-resolv.conf`.
- The stub resolver file pointed local clients to `127.0.0.53`.
- `resolvectl status` reported global current DNS server `1.1.1.1` and the per-link DNS server `192.168.122.1` for `enp1s0`.
- The output listed fallback servers from Cloudflare, Google, and Quad9.

**Observed runtime protocol state:**

- Global LLMNR: enabled.
- Global mDNS: enabled.
- On `enp1s0`: LLMNR enabled and mDNS disabled.
- DNS-over-TLS: disabled in the reported status.
- DNSSEC: reported as `no/unsupported`.

The captured `/etc/systemd/resolved.conf` showed the relevant directives commented out. This means the file does not show explicit local values for those settings. The audit does not infer that the runtime state was manually configured, nor does it establish whether drop-in configuration exists outside the captured file. Runtime observations are taken from `resolvectl status`.

## 5. Network and systemd services

**Verified from captured output:**

- Phase 2 listed 11 loaded service units in the running state.
- `systemctl --failed` listed zero loaded failed units at collection time.
- `systemd-networkd.service` and `systemd-resolved.service` were enabled and active.
- Phase 3 listed 32 enabled unit files.

The 32 enabled unit files are not 32 running services. The list includes services, sockets, and targets; enabled state describes unit enablement, not necessarily current activity.

The networkd journal included:

`Could not set hostname: Access denied`

The available evidence does not establish the cause, whether the message was transient, or whether it had an operational impact. It is recorded as an observation, not diagnosed as a failure.

The command `systemctl is-enabled sshd` returned `not-found` (exit status 4). This only means the queried systemd unit name was not found. It does not prove that no SSH client, differently named unit, or other SSH server implementation exists.

## 6. Listening sockets

The `ss -tulpn` capture showed:

- DNS stub sockets on loopback addresses `127.0.0.53:53` and `127.0.0.54:53`.
- UDP sockets on wildcard addresses at port 5353.
- UDP and TCP sockets on wildcard addresses at port 5355.

Ports 5353 and 5355 are commonly associated with mDNS and LLMNR. The resolver status is consistent with LLMNR being active on the captured link and mDNS being disabled on that link, despite global mDNS being enabled.

A wildcard-bound socket is a listening-socket observation. It does not by itself prove reachability from an untrusted network, successful remote access, exploitability, or a vulnerability. Network topology and packet-filtering state were not established by these captures.

## 7. Accounts and account-file permissions

The captured account listing showed `root` as the only account whose shell did not end in `false` or `nologin`. The separate shell-filter command returned:

`root:/bin/bash`

This is a statement about the captured `getent passwd` data and the exact filter used; it is not a complete authentication or authorization audit.

The captured metadata for account files was:

| File | Mode | Owner |
|---|---:|---|
| `/etc/passwd` | `0644` | `root:root` |
| `/etc/group` | `0644` | `root:root` |
| `/etc/shadow` | `0400` | `root:root` |

Only file metadata was collected for `/etc/shadow`; its contents were not included.

## 8. Kernel network parameters

The following values were captured:

| Parameter | Observed value |
|---|---:|
| `net.ipv4.ip_forward` | `0` |
| `net.ipv6.conf.all.forwarding` | `0` |
| `net.ipv4.conf.all.rp_filter` | `0` |
| `net.ipv4.conf.all.accept_redirects` | `1` |
| `net.ipv4.conf.all.send_redirects` | `1` |
| `net.ipv4.conf.all.accept_source_route` | `0` |
| `net.ipv6.conf.all.accept_redirects` | `1` |

These are reported as observed values. They are not automatically classified as defects, and this report does not claim they are universal defaults for every LFS installation.

## 9. Firewall inspection

The two captured commands reported:

- `nft list ruleset`: `Command unavailable: nft`
- `iptables-save`: `Command unavailable: iptables-save`

**Firewall state: Not verified.**

The absence of these command-line utilities does not prove that packet filtering is disabled or that no firewall rules exist in the kernel or elsewhere. The evidence is insufficient to claim that a firewall is enabled or disabled.

## 10. systemd service sandboxing analysis

`systemd-analyze security --no-pager` returned exposure scores and labels including `UNSAFE`, `EXPOSED`, `MEDIUM`, and `OK`.

These are systemd's service-sandboxing exposure heuristics. They are not vulnerability scan findings, exploitability assessments, or evidence that a service is compromised. A score must be interpreted in the context of each unit's purpose and required privileges. No sandbox settings were changed.

## 11. Login definitions and umask

The captured `/etc/login.defs` included, among other values:

- `UMASK 022`
- `ENCRYPT_METHOD YESCRYPT`
- `PASS_MIN_LEN 5`
- `PASS_ALWAYS_WARN yes`
- `LOGIN_RETRIES 5`
- `LOGIN_TIMEOUT 60`
- `PASS_CHANGE_TRIES 5`
- `SU_WHEEL_ONLY no`
- `PREVENT_NO_AUTH superuser`
- UID/GID allocation ranges and subordinate-ID ranges as shown in the raw capture.

The separate Bash umask probe returned `0022`.

These are configuration values as printed by the system. The presence of `ENCRYPT_METHOD YESCRYPT` in `login.defs` does not prove that existing password hashes use yescrypt; the shadow-file contents and actual password-change path were not audited. Likewise, `PASS_MIN_LEN` is recorded as a setting, not proof that a particular PAM or password-change path enforces that minimum.

## 12. Findings and evidence classification

### Verified from captured output

- The system identified itself as Linux From Scratch and reported kernel `7.1.8`.
- `enp1s0` was up with the captured DHCP IPv4 address and default route.
- The tested lookup for `example.com` returned IPv6 records.
- `systemd-networkd` and `systemd-resolved` were enabled and active.
- The running-service query listed 11 units; the failed-unit query listed zero.
- The account-file metadata and selected kernel network parameters were captured.
- IPv4 and IPv6 forwarding were both reported as disabled.

### Observed, not automatically classified as defects

- LLMNR and mDNS runtime state.
- DNSSEC and DNS-over-TLS status.
- Wildcard-bound sockets on ports 5353 and 5355.
- Selected network sysctl values.
- Login defaults and Bash umask.
- systemd sandboxing exposure scores.
- The networkd hostname access-denied journal message.

### Not verified

- Effective firewall ruleset and packet-filtering state.
- General Internet reachability or DNS reliability beyond the single lookup.
- Availability of every possible SSH server implementation.
- Cause and impact of the networkd hostname message.
- Actual password-hash algorithms for existing accounts.
- Overall resistance to attack or production security posture.

### Out of scope

- Penetration testing and vulnerability scanning.
- Custom kernel hardening.
- Firewall installation or policy changes.
- Resolver or DNS policy changes.
- Account/authentication policy changes.
- systemd service sandbox modifications.
- Production security certification.

## 13. Collection limitations

The Phase 3 collector had an exit-status reporting defect: the helper could print the status of a subsequent `echo` rather than the command being tested. Consequently, the Phase 3 `Exit status` annotations are not authoritative. The command output itself, including explicit errors and unavailable-command messages, remains the evidence to interpret.

The Phase 2 `systemctl is-enabled sshd` output explicitly reported `not-found` and exit status 4. Do not generalize that result beyond the queried unit.

## 14. Conclusion

This review documents the observed networking and security baseline of the captured LFS 13.1-systemd build. It intentionally preserves the system as built and does not prescribe or apply custom hardening.

The evidence supports specific statements about the captured interfaces, resolver, service state, account metadata, and selected kernel parameters. It does not support a blanket claim that the system is secure, insecure, firewall-protected, or production-ready.

## 15. Evidence and reproducibility

The accompanying [evidence directory](../screenshots/09-networking-and-system-audit/README.md) contains the 30 individual Phase 2 and Phase 3 text captures. Identifying MAC/UUID values and the MAC-derived IPv6 link-local interface identifier are replaced with explicit placeholders; technical configuration values and command output are retained.

The [read-only collector](../scripts/collect-evidence/collect-network-security-evidence.sh) is available in the repository. It writes fresh raw output to a separate directory. Review and anonymize that output before publishing; do not overwrite the existing evidence.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Command: ip -br link

lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
enp1s0 UP <MAC_ADDRESS> <BROADCAST,MULTICAST,UP,LOWER_UP>

Exit status: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Command: ip -br address

lo UNKNOWN 127.0.0.1/8 ::1/128
enp1s0 UP 192.168.122.54/24 metric 1024 fe80::[ANONYMIZED_INTERFACE_ID]/64

Exit status: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Command: ip route show

default via 192.168.122.1 dev enp1s0 proto dhcp src 192.168.122.54 metric 1024
192.168.122.0/24 dev enp1s0 proto kernel scope link src 192.168.122.54 metric 1024
192.168.122.1 dev enp1s0 proto dhcp scope link src 192.168.122.54 metric 1024

Exit status: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Command: getent hosts example.com

2a06:98c1:3122:: example.com
2a06:98c1:3123:: example.com

Exit status: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Command: ss -tulpn

Netid State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
udp UNCONN 0 0 0.0.0.0:5353 0.0.0.0:* users:(("systemd-resolve",pid=183,fd=17))
udp UNCONN 0 0 0.0.0.0:5355 0.0.0.0:* users:(("systemd-resolve",pid=183,fd=13))
udp UNCONN 0 0 127.0.0.54:53 0.0.0.0:* users:(("systemd-resolve",pid=183,fd=24))
udp UNCONN 0 0 127.0.0.53:53 0.0.0.0:* users:(("systemd-resolve",pid=183,fd=22))
udp UNCONN 0 0 *:5353 *:* users:(("systemd-resolve",pid=183,fd=18))
udp UNCONN 0 0 *:5355 *:* users:(("systemd-resolve",pid=183,fd=15))
tcp LISTEN 0 0 127.0.0.54:53 0.0.0.0:* users:(("systemd-resolve",pid=183,fd=25))
tcp LISTEN 0 0 127.0.0.53:53 0.0.0.0:* users:(("systemd-resolve",pid=183,fd=23))
tcp LISTEN 0 0 0.0.0.0:5355 0.0.0.0:* users:(("systemd-resolve",pid=183,fd=14))
tcp LISTEN 0 0 *:5355 *:* users:(("systemd-resolve",pid=183,fd=16))

Exit status: 0
22 changes: 22 additions & 0 deletions screenshots/09-networking-and-system-audit/06-running-services.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Command: systemctl list-units --type=service --state=running --no-pager

UNIT LOAD ACTIVE SUB DESCRIPTION
dbus.service loaded active running D-Bus System Message Bus
[email protected] loaded active running Getty on tty1
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running User Login Management
systemd-networkd.service loaded active running Network Management
systemd-nsresourced.service loaded active running Namespace Resource Manager
systemd-oomd.service loaded active running Userspace Out-Of-Memory (OOM) Killer
systemd-resolved.service loaded active running Network Name Resolution
systemd-timesyncd.service loaded active running Network Time Synchronization
systemd-udevd.service loaded active running Rule-based Manager for Device Events and Files
systemd-userdbd.service loaded active running User Database Manager

Legend: LOAD → Reflects whether the unit definition was properly loaded.
ACTIVE → The high-level unit activation state, i.e. generalization of SUB.
SUB → The low-level unit activation state, values depend on unit type.

11 loaded units listed.

Exit status: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Command: systemctl --failed --no-pager

UNIT LOAD ACTIVE SUB DESCRIPTION

0 loaded units listed.

Exit status: 0
Loading
Loading