Skip to content

Commit 3fa7986

Browse files
vsilentCopilot
andcommitted
release: v0.1.7 — security hardening (OWASP Top 10)
Bump version to 0.1.7. Update CHANGELOG with all 11 security fixes, status init command, and RUSTSEC-2026-0049 dependency fix. Update README: add status init to CLI, mark credentials as required, expand Security section with OWASP hardening points, bump example version. Update SECURITY.md: add authentication hardening, session security, bind address, and self-update integrity documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 53eb667 commit 3fa7986

5 files changed

Lines changed: 117 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# Changelog
22

3+
## 0.1.7 — 2026-04-10
4+
### Security — OWASP Top 10 Hardening
5+
6+
This is a **security release** addressing 6 Critical and 5 High severity findings from a comprehensive OWASP Top 10 audit.
7+
8+
#### A01: Broken Access Control
9+
- **No default credentials**`Credentials::from_env()` now returns an error when `STATUS_PANEL_USERNAME` / `STATUS_PANEL_PASSWORD` are unset; no admin/admin backdoor
10+
- **Container routes require auth**`/restart/{name}`, `/stop/{name}`, `/pause/{name}` now enforce session authentication
11+
- **SSL routes require auth**`/enable_ssl`, `/disable_ssl` now enforce session authentication
12+
- **AGENT_ID enforced**`validate_agent_id` rejects requests when `AGENT_ID` env var is unset or empty
13+
14+
#### A02: Cryptographic Failures
15+
- **Secure session cookies**`Set-Cookie` now includes `Secure; SameSite=Strict; HttpOnly`
16+
17+
#### A03: Injection
18+
- **Certbot command injection prevented** — email and domain values validated against shell metacharacters before `exec_in_container`
19+
- **Daemon shell fallback validated** — unrecognised commands now pass through `CommandValidator` before execution
20+
- New `security::validation` module with `is_safe_shell_value()`, `is_valid_domain()`, `is_valid_email()`, `is_safe_update_url()`
21+
22+
#### A04: Insecure Design
23+
- **Session TTL**`SessionStore` now tracks creation timestamps; `cleanup_expired(duration)` removes stale sessions
24+
25+
#### A05: Security Misconfiguration
26+
- **Default bind address is 127.0.0.1** — server no longer binds `0.0.0.0` by default; explicit `--bind 0.0.0.0` required for all-interfaces
27+
28+
#### A07: Identification and Authentication Failures
29+
- **Logout invalidates session**`logout_handler` extracts cookie, calls `delete_session`, and sets `Max-Age=0`
30+
31+
#### A08: Software and Data Integrity Failures
32+
- **HTTPS enforced for self-update**`start_update_job` rejects HTTP URLs
33+
- **SHA256 always computed** — hash is calculated on every download; warns if `UPDATE_EXPECTED_SHA256` is not set
34+
35+
### Added
36+
- `status init` command — generates default `config.json` and `.env` template on first run
37+
- Friendly error message when `config.json` is missing (replaces stack trace)
38+
- 12 automated OWASP security tests (`tests/owasp_security.rs`)
39+
40+
### Fixed
41+
- RUSTSEC-2026-0049 — upgraded `rustls-webpki` 0.103.8 → 0.103.10
42+
343
## 0.1.6 — 2026-04-08
444
### Added — Kata Containers Runtime Support
545

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "status-panel"
3-
version = "0.1.6"
3+
version = "0.1.7"
44
edition = "2021"
55

66
[features]

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ curl -sSfL https://raw.githubusercontent.com/trydirect/status/master/install.sh
3737
Pin a specific version or choose a custom directory:
3838

3939
```bash
40-
VERSION=v0.1.4 curl -sSfL https://raw.githubusercontent.com/trydirect/status/master/install.sh | sh
40+
VERSION=v0.1.7 curl -sSfL https://raw.githubusercontent.com/trydirect/status/master/install.sh | sh
4141
INSTALL_DIR=~/.local/bin curl -sSfL https://raw.githubusercontent.com/trydirect/status/master/install.sh | sh
4242
```
4343

@@ -50,6 +50,7 @@ status --version
5050
## CLI Commands
5151

5252
```
53+
status init Generate default config.json and .env
5354
status serve [--port 5000] [--with-ui] Start the HTTP API server
5455
status containers List all Docker containers
5556
status health [name] Check container or stack health
@@ -64,6 +65,29 @@ status update apply [--version V] Download and verify an update
6465
status update rollback Roll back to previous version
6566
```
6667

68+
## First Run
69+
70+
After installing, generate the default configuration files:
71+
72+
```bash
73+
status init # creates config.json and .env in current directory
74+
status init --config /etc/status # custom path
75+
```
76+
77+
Edit `.env` to set **required** credentials before starting:
78+
79+
```bash
80+
STATUS_PANEL_USERNAME=myuser
81+
STATUS_PANEL_PASSWORD=strong-secret
82+
AGENT_ID=my-server-01
83+
```
84+
85+
Then start the agent:
86+
87+
```bash
88+
status --config config.json
89+
```
90+
6791
## Running Modes
6892

6993
**CLI** — run a single command and exit:
@@ -158,23 +182,31 @@ The agent accepts signed commands from the Stacker dashboard covering the full l
158182

159183
## Security
160184

185+
- **No default credentials**`STATUS_PANEL_USERNAME` and `STATUS_PANEL_PASSWORD` must be set; login is disabled until configured
161186
- **HMAC-SHA256** request signing with `AGENT_TOKEN`
162187
- **Replay protection** via `X-Request-Id` tracking
163188
- **Rate limiting** per agent
189+
- **Session security** — HttpOnly + Secure + SameSite=Strict cookies; server-side session invalidation on logout; TTL-based cleanup
164190
- **Command validation** — conservative allowlist, blocked shells and metacharacters
191+
- **Injection prevention** — all shell-interpolated values (email, domains, container names) validated against metacharacters
165192
- **Exec sandboxing** — dangerous commands (`rm -rf /`, `mkfs`, `shutdown`, etc.) are blocked
193+
- **Localhost by default** — API server binds `127.0.0.1`; explicit `--bind 0.0.0.0` required for external access
194+
- **HTTPS-only updates** — self-update rejects HTTP download URLs; SHA256 verification on every download
166195
- **Audit logging** — all auth attempts and scope denials recorded
167196
- **Vault integration** — secrets and configs stored securely, never in plaintext
168197

169198
## Configuration
170199

171200
| Environment Variable | Description |
172201
|---------------------|-------------|
173-
| `AGENT_ID` | Unique agent identifier |
202+
| `STATUS_PANEL_USERNAME` | **Required.** Login username |
203+
| `STATUS_PANEL_PASSWORD` | **Required.** Login password |
204+
| `AGENT_ID` | **Required.** Unique agent identifier (protects API endpoints) |
174205
| `AGENT_TOKEN` | Authentication token for signed requests |
175206
| `DASHBOARD_URL` | Remote dashboard URL |
176207
| `VAULT_ADDRESS` | HashiCorp Vault server URL |
177208
| `UPDATE_SERVER_URL` | Remote update server for version checks |
209+
| `UPDATE_EXPECTED_SHA256` | Expected SHA256 hash for self-update binary |
178210
| `COMPOSE_AGENT_ENABLED` | Enable compose-agent mode |
179211
| `METRICS_INTERVAL_SECS` | Metrics collection interval |
180212

SECURITY.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,47 @@ The project maintainers will then work with you to resolve any issues where requ
88

99
---
1010

11+
## Authentication Hardening (v0.1.7+)
12+
13+
### Credential Configuration
14+
15+
The agent has **no default credentials**. Authentication is disabled until you explicitly configure:
16+
17+
```bash
18+
STATUS_PANEL_USERNAME=your-username
19+
STATUS_PANEL_PASSWORD=your-strong-password
20+
```
21+
22+
If these environment variables are not set:
23+
- Login returns `503 Service Unavailable`
24+
- A warning is logged on every login attempt
25+
- Run `status init` to generate a `.env` template
26+
27+
### Agent ID Protection
28+
29+
The `AGENT_ID` environment variable must be set to protect API endpoints (`/api/self/*`, `/api/v1/*`). When unset, these endpoints return `401 Unauthorized`.
30+
31+
### Session Security
32+
33+
- Sessions are stored in-memory with creation timestamps
34+
- `cleanup_expired(duration)` removes sessions older than the TTL
35+
- Logout invalidates the session server-side and clears the cookie
36+
- Cookies use `HttpOnly; Secure; SameSite=Strict` attributes
37+
- `Max-Age=0` is set on logout to prevent stale cookies
38+
39+
### Bind Address
40+
41+
The API server defaults to `127.0.0.1` (localhost only). To expose on all interfaces, explicitly pass `--bind 0.0.0.0`. This prevents accidental exposure on public networks.
42+
43+
### Self-Update Integrity
44+
45+
- Update downloads require HTTPS — HTTP URLs are rejected
46+
- SHA256 hash is computed on every download
47+
- If `UPDATE_EXPECTED_SHA256` is set, hash must match or the update fails
48+
- If not set, a warning is logged with the computed hash for manual verification
49+
50+
---
51+
1152
## Vault Integration Security
1253

1354
### Token Rotation Best Practices

0 commit comments

Comments
 (0)