diff --git a/CHANGELOG.md b/CHANGELOG.md index b8d0e0c..a814358 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.3.1] - 2026-11-13 + ### Added - CVE watch (`vuln.cve-watch`): matches every package on the host and in diff --git a/Cargo.toml b/Cargo.toml index defb84d..eae8d6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stackdog" -version = "0.3.0" +version = "0.3.1" authors = ["Vasili Pascal "] edition = "2021" description = "Security platform for Docker containers and Linux servers" diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 6fd96b8..a05d34e 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -1,7 +1,7 @@ # Stackdog Security - Development Plan **Last Updated:** 2026-04-07 -**Current Version:** 0.3.0 +**Current Version:** 0.3.1 **Status:** Phase 2 In Progress ## Project Vision @@ -560,7 +560,7 @@ cargo-deny = "0.14" |---------|-------------|----------|--------| | **v0.1.0** | 2022-03-01 | Initial container management | ✅ Released | | **v0.2.0** | 2026-03-13 | Security platform foundation | ✅ Complete | -| **v0.3.0** | Week 10 | ML anomaly detection | 🚧 In Progress | +| **v0.3.1** | Week 10 | ML anomaly detection | 🚧 In Progress | | **v0.4.0** | Week 12 | Alerting system | ⏳ Pending | | **v0.5.0** | Week 16 | Web dashboard | ⏳ Pending | | **v1.0.0** | Week 18 | Production release | ⏳ Pending | diff --git a/README.md b/README.md index 68c0f3f..9d6eb16 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stackdog Security -![Version](https://img.shields.io/badge/version-0.3.0-blue.svg) +![Version](https://img.shields.io/badge/version-0.3.1-blue.svg) ![License](https://img.shields.io/badge/license-MIT-green.svg) ![Rust](https://img.shields.io/badge/rust-1.75+-orange.svg) ![Platform](https://img.shields.io/badge/platform-linux%20%7C%20macos%20%7C%20windows-lightgrey.svg) @@ -179,7 +179,7 @@ curl -fsSL https://raw.githubusercontent.com/trydirect/stackdog/main/install.sh Pin a specific version: ```bash -curl -fsSL https://raw.githubusercontent.com/trydirect/stackdog/main/install.sh | sudo bash -s -- --version v0.3.0 +curl -fsSL https://raw.githubusercontent.com/trydirect/stackdog/main/install.sh | sudo bash -s -- --version v0.3.1 ``` If your repository has no published stable release yet, use `--version` explicitly. diff --git a/VERSION.md b/VERSION.md index 0d91a54..9e11b32 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -0.3.0 +0.3.1 diff --git a/docs/INDEX.md b/docs/INDEX.md index 3d20dd6..cc6a8d0 100644 --- a/docs/INDEX.md +++ b/docs/INDEX.md @@ -1,6 +1,6 @@ # Stackdog Security - Documentation Index -**Version:** 0.3.0 +**Version:** 0.3.1 **Last Updated:** 2026-04-07 --- diff --git a/install.sh b/install.sh index 52f7f1e..39f1422 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ # # Usage: # curl -fsSL https://raw.githubusercontent.com/trydirect/stackdog/main/install.sh | sudo bash -# curl -fsSL https://raw.githubusercontent.com/trydirect/stackdog/main/install.sh | sudo bash -s -- --version v0.3.0 +# curl -fsSL https://raw.githubusercontent.com/trydirect/stackdog/main/install.sh | sudo bash -s -- --version v0.3.1 # # Installs the stackdog binary to /usr/local/bin. # Requires: curl, tar, sha256sum (or shasum), Linux x86_64 or aarch64. @@ -73,7 +73,7 @@ resolve_version() { fi if [ -z "$TAG" ]; then - error "Could not determine latest release. Create a GitHub release, or specify one with --version (e.g. --version v0.3.0)." + error "Could not determine latest release. Create a GitHub release, or specify one with --version (e.g. --version v0.3.1)." fi VERSION="$(echo "$TAG" | sed 's/^v//')" @@ -136,7 +136,7 @@ main() { echo "Install stackdog binary to ${INSTALL_DIR}." echo "" echo "Options:" - echo " --version VERSION Install a specific version (e.g. v0.3.0)" + echo " --version VERSION Install a specific version (e.g. v0.3.1)" echo " --help Show this help" exit 0 ;; diff --git a/src/firewall/iptables.rs b/src/firewall/iptables.rs index db73884..0a0da29 100644 --- a/src/firewall/iptables.rs +++ b/src/firewall/iptables.rs @@ -289,10 +289,17 @@ impl IptablesBackend { .context("Failed to list iptables rules")?; if !output.status.success() { - anyhow::bail!( - "Failed to list rules: {}", - String::from_utf8_lossy(&output.stderr) - ); + let stderr = String::from_utf8_lossy(&output.stderr); + // A fresh box has no stackdog chain yet: nothing is banned, + // which is an empty list, not an error. + if stderr.contains("No chain/target/match by that name") + || stderr.contains("No chain matches") + || stderr.contains("does not exist") + || stderr.contains("No such file or directory") + { + return Ok(Vec::new()); + } + anyhow::bail!("Failed to list rules: {}", stderr); } let stdout = String::from_utf8_lossy(&output.stdout); diff --git a/src/firewall/nftables.rs b/src/firewall/nftables.rs index c4b125b..e1f240b 100644 --- a/src/firewall/nftables.rs +++ b/src/firewall/nftables.rs @@ -414,10 +414,13 @@ impl NfTablesBackend { .context("Failed to list nftables rules")?; if !output.status.success() { - anyhow::bail!( - "Failed to list rules: {}", - String::from_utf8_lossy(&output.stderr) - ); + let stderr = String::from_utf8_lossy(&output.stderr); + // A fresh box has no stackdog table or chain yet: nothing is + // banned, which is an empty list, not an error. + if stderr.contains("No such file or directory") || stderr.contains("does not exist") { + return Ok(Vec::new()); + } + anyhow::bail!("Failed to list rules: {}", stderr); } let stdout = String::from_utf8_lossy(&output.stdout); diff --git a/src/sniff/analyzer.rs b/src/sniff/analyzer.rs index 8120228..4dc9f60 100644 --- a/src/sniff/analyzer.rs +++ b/src/sniff/analyzer.rs @@ -68,6 +68,9 @@ impl std::fmt::Display for AnomalySeverity { } /// Trait for AI-powered log analysis +// async-trait expands to #[must_use] fns returning Result; newer clippy +// flags that Result already implies must_use. +#[allow(clippy::double_must_use)] #[async_trait] pub trait LogAnalyzer: Send + Sync { /// Summarize a batch of log entries diff --git a/src/sniff/reader.rs b/src/sniff/reader.rs index 8029226..51b3c2b 100644 --- a/src/sniff/reader.rs +++ b/src/sniff/reader.rs @@ -21,6 +21,9 @@ pub struct LogEntry { } /// Trait for reading log entries from a source +// async-trait expands to #[must_use] fns returning Result; newer clippy +// flags that Result already implies must_use. +#[allow(clippy::double_must_use)] #[async_trait] pub trait LogReader: Send + Sync { /// Read new entries since the last read position diff --git a/web/package.json b/web/package.json index bec7574..e2d7d3e 100644 --- a/web/package.json +++ b/web/package.json @@ -1,7 +1,7 @@ { "name": "stackdog-web", "description": "Stackdog Security Web Dashboard", - "version": "0.3.0", + "version": "0.3.1", "scripts": { "start": "cross-env REACT_APP_VERSION=$npm_package_version webpack serve --mode development", "build": "cross-env REACT_APP_VERSION=$npm_package_version webpack --mode production", diff --git a/website/app/docs/page.tsx b/website/app/docs/page.tsx index 53ff75c..39c3f8b 100644 --- a/website/app/docs/page.tsx +++ b/website/app/docs/page.tsx @@ -8,7 +8,7 @@ import { buildDocsStructuredData, toJsonLd } from '@/lib/structured-data'; const installCurl = 'curl -fsSL https://raw.githubusercontent.com/trydirect/stackdog/main/install.sh | sudo bash'; const installPinned = - 'curl -fsSL https://raw.githubusercontent.com/trydirect/stackdog/main/install.sh | sudo bash -s -- --version v0.3.0'; + 'curl -fsSL https://raw.githubusercontent.com/trydirect/stackdog/main/install.sh | sudo bash -s -- --version v0.3.1'; const installDocker = `docker run --rm -it \\ --name stackdog \\ --network host \\ diff --git a/website/app/monitoring-stack-security-events/page.tsx b/website/app/monitoring-stack-security-events/page.tsx new file mode 100644 index 0000000..1587aba --- /dev/null +++ b/website/app/monitoring-stack-security-events/page.tsx @@ -0,0 +1,271 @@ +import type { Metadata } from 'next'; +import Link from 'next/link'; +import { ArrowRight, PackageSearch, ShieldAlert, TerminalSquare } from 'lucide-react'; +import CopyButton from '@/components/CopyButton'; +import { getSiteUrl } from '@/lib/config'; +import { buildDocsStructuredData, toJsonLd } from '@/lib/structured-data'; + +const PAGE_PATH = '/monitoring-stack-security-events'; + +export const metadata: Metadata = { + title: 'Three Security Events in One Month Reshaped Our Monitoring Stack', + description: + 'PHP2Shell, SSHole and a month of automated exploitation taught Stackdog new layers: version checks, first-line bans, and a CVE watch that matches every installed package against OSV and CISA KEV. Now on brew and cargo.', + keywords: [ + 'Stackdog', + 'PHP2Shell', + 'SSHole', + 'CVE watch', + 'monitoring stack', + 'self-hosted security' + ], + alternates: { + canonical: PAGE_PATH + }, + openGraph: { + title: 'Three Security Events in One Month Reshaped Our Monitoring Stack — StackdogApp', + description: + 'Where Stackdog stands after PHP2Shell and SSHole, and why it now installs with one command.', + url: getSiteUrl() + PAGE_PATH + }, + twitter: { + title: 'Three Security Events in One Month Reshaped Our Monitoring Stack — StackdogApp', + description: + 'Where Stackdog stands after PHP2Shell and SSHole, and why it now installs with one command.' + } +}; + +const layers = [ + { + icon: ShieldAlert, + title: 'PHP2Shell (v0.2.8–0.2.9)', + body: 'Forced the version-check layer: which PHP builds predate the fix, on the host and inside every running container — and a detector for the exploit\u2019s actual footprint, the request that runs PHP out of memory while it is still being parsed.' + }, + { + icon: TerminalSquare, + title: 'SSHole (v0.3.0)', + body: 'Repeated the pattern for OpenSSH in days, and added the policy that one password login to a key-only account is already a foothold: first line bans.' + }, + { + icon: PackageSearch, + title: 'v0.3.1: CVE watch', + body: 'Generalized it: CVE watch now matches every installed package against OSV and CISA\u2019s exploited-vulnerability catalog, so next month\u2019s incident needs no release from us.' + } +]; + +const installCommands = [ + { + label: 'Homebrew', + code: 'brew install trydirect/tap/stackdog' + }, + { + label: 'cargo', + code: 'cargo install stackdog' + } +]; + +function CodeSample({ code, label }: { code: string; label: string }) { + return ( +
+
+

{label}

+ +
+
+        {code}
+      
+
+ ); +} + +export default function MonitoringStackSecurityEventsPage() { + return ( +
+