Skip to content

Commit b18befd

Browse files
authored
Merge pull request #7 from vsilent/feature/detectors
Feature/detectors
2 parents cb6c405 + 3438805 commit b18befd

File tree

24 files changed

+2443
-32
lines changed

24 files changed

+2443
-32
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ jobs:
3636
run: cargo install cross --git https://github.com/cross-rs/cross
3737

3838
- name: Build release binary
39+
env:
40+
CARGO_TARGET_DIR: target-cross
3941
run: cross build --release --target ${{ matrix.target }}
4042

4143
- name: Package
4244
run: |
4345
mkdir -p dist
44-
cp target/${{ matrix.target }}/release/stackdog dist/stackdog
46+
cp target-cross/${{ matrix.target }}/release/stackdog dist/stackdog
4547
cd dist
4648
tar czf ${{ matrix.artifact }}.tar.gz stackdog
4749
sha256sum ${{ matrix.artifact }}.tar.gz > ${{ matrix.artifact }}.tar.gz.sha256

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ Cargo.lock
3333
# End of https://www.gitignore.io/api/rust,code
3434

3535
.idea
36-
<<<<<<< HEAD
37-
=======
3836
*.db
39-
>>>>>>> testing
4037
docs/tasks/
38+
web/node_modules/
39+
web/dist/

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.2.2] - 2026-04-07
11+
1012
### Fixed
1113

1214
- **CLI startup robustness**`.env` loading is now non-fatal.
@@ -19,6 +21,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1921

2022
### Added
2123

24+
- **Expanded detector framework** with additional log-driven detection coverage.
25+
- Reverse shell, sensitive file access, cloud metadata / SSRF, exfiltration chain, and secret leakage detectors.
26+
- file integrity monitoring with SQLite-backed baselines via `STACKDOG_FIM_PATHS`.
27+
- configuration assessment via `STACKDOG_SCA_PATHS`.
28+
- package inventory heuristics via `STACKDOG_PACKAGE_INVENTORY_PATHS`.
29+
- Docker posture audits for privileged mode, host namespaces, dangerous capabilities, Docker socket mounts, and writable sensitive mounts.
30+
31+
- **Improved syslog ingestion**
32+
- RFC3164 and RFC5424 parsing in file-based log ingestion for cleaner timestamps and normalized message bodies.
33+
2234
#### Log Sniffing & Analysis (`stackdog sniff`)
2335
- **CLI Subcommands** — Multi-mode binary with `stackdog serve` and `stackdog sniff`
2436
- `--once` flag for single-pass mode
@@ -76,6 +88,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7688
- Refactored `main.rs` to dispatch `serve`/`sniff` subcommands via clap
7789
- Added `events`, `rules`, `alerting`, `models` modules to binary crate
7890
- Updated `.env.sample` with `STACKDOG_LOG_SOURCES`, `STACKDOG_AI_*` config vars
91+
- Version metadata updated to `0.2.2` across Cargo, the web package manifest, and current release documentation.
7992

8093
### Testing
8194

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stackdog"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
authors = ["Vasili Pascal <info@try.direct>"]
55
edition = "2021"
66
description = "Security platform for Docker containers and Linux servers"
@@ -49,6 +49,7 @@ bollard = "0.16"
4949

5050
# HTTP client (for LLM API)
5151
reqwest = { version = "0.12", default-features = false, features = ["json", "blocking", "rustls-tls"] }
52+
sha2 = "0.10"
5253

5354
# Compression
5455
zstd = "0.13"

DEVELOPMENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Stackdog Security - Development Plan
22

3-
**Last Updated:** 2026-03-13
4-
**Current Version:** 0.2.0
3+
**Last Updated:** 2026-04-07
4+
**Current Version:** 0.2.2
55
**Status:** Phase 2 In Progress
66

77
## Project Vision

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Stackdog Security
22

3-
![Version](https://img.shields.io/badge/version-0.2.1-blue.svg)
3+
![Version](https://img.shields.io/badge/version-0.2.2-blue.svg)
44
![License](https://img.shields.io/badge/license-MIT-green.svg)
55
![Rust](https://img.shields.io/badge/rust-1.75+-orange.svg)
66
![Platform](https://img.shields.io/badge/platform-linux%20%7C%20macos%20%7C%20windows-lightgrey.svg)
@@ -19,6 +19,7 @@
1919

2020
- **📊 Real-time Monitoring** — eBPF-based syscall monitoring with minimal overhead (<5% CPU)
2121
- **🔍 Log Sniffing** — Discover, read, and AI-summarize logs from containers and system files
22+
- **🧭 Detector Framework** — Rust-native detector registry for web attack heuristics and outbound exfiltration indicators
2223
- **🤖 AI/ML Detection** — Candle-powered anomaly detection + OpenAI/Ollama log analysis
2324
- **🚨 Alert System** — Multi-channel notifications (Slack, email, webhook)
2425
- **🔒 Automated Response** — nftables/iptables firewall, container quarantine
@@ -52,7 +53,7 @@ curl -fsSL https://raw.githubusercontent.com/vsilent/stackdog/main/install.sh |
5253

5354
Pin a specific version:
5455
```bash
55-
curl -fsSL https://raw.githubusercontent.com/vsilent/stackdog/main/install.sh | sudo bash -s -- --version v0.2.1
56+
curl -fsSL https://raw.githubusercontent.com/vsilent/stackdog/main/install.sh | sudo bash -s -- --version v0.2.2
5657
```
5758

5859
If your repository has no published stable release yet, use `--version` explicitly.
@@ -179,6 +180,14 @@ cargo run -- sniff --consume --output ./log-archive
179180
cargo run -- sniff --sources "/var/log/myapp.log,/opt/service/logs"
180181
```
181182

183+
The built-in sniff pipeline now includes Rust-native detectors for:
184+
185+
- web attack indicators such as SQL injection probes, path traversal probes, login brute force, and webshell-style requests
186+
- exfiltration-style indicators such as suspicious SMTP/attachment activity and large outbound transfer hints in logs
187+
- reverse shell behavior, sensitive file access, cloud metadata / SSRF access, exfiltration chains, and secret leakage in logs
188+
- Wazuh-inspired file integrity monitoring for explicit paths configured with `STACKDOG_FIM_PATHS=/etc/ssh/sshd_config,/app/.env`
189+
- Wazuh-inspired configuration assessment via `STACKDOG_SCA_PATHS`, package inventory heuristics via `STACKDOG_PACKAGE_INVENTORY_PATHS`, Docker posture audits, and improved RFC3164/RFC5424 syslog parsing
190+
182191
### Use as Library
183192

184193
Add to your `Cargo.toml`:

VERSION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.1
1+
0.2.2

docs/INDEX.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Stackdog Security - Documentation Index
22

3-
**Version:** 0.2.0
4-
**Last Updated:** 2026-03-13
3+
**Version:** 0.2.2
4+
**Last Updated:** 2026-04-07
55

66
---
77

install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Usage:
55
# curl -fsSL https://raw.githubusercontent.com/vsilent/stackdog/main/install.sh | sudo bash
6-
# curl -fsSL https://raw.githubusercontent.com/vsilent/stackdog/main/install.sh | sudo bash -s -- --version v0.2.0
6+
# curl -fsSL https://raw.githubusercontent.com/vsilent/stackdog/main/install.sh | sudo bash -s -- --version v0.2.2
77
#
88
# Installs the stackdog binary to /usr/local/bin.
99
# Requires: curl, tar, sha256sum (or shasum), Linux x86_64 or aarch64.
@@ -73,7 +73,7 @@ resolve_version() {
7373
fi
7474

7575
if [ -z "$TAG" ]; then
76-
error "Could not determine latest release. Create a GitHub release, or specify one with --version (e.g. --version v0.2.0)."
76+
error "Could not determine latest release. Create a GitHub release, or specify one with --version (e.g. --version v0.2.2)."
7777
fi
7878

7979
VERSION="$(echo "$TAG" | sed 's/^v//')"
@@ -136,7 +136,7 @@ main() {
136136
echo "Install stackdog binary to ${INSTALL_DIR}."
137137
echo ""
138138
echo "Options:"
139-
echo " --version VERSION Install a specific version (e.g. v0.2.0)"
139+
echo " --version VERSION Install a specific version (e.g. v0.2.2)"
140140
echo " --help Show this help"
141141
exit 0
142142
;;

src/collectors/ebpf/loader.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
//!
55
//! Note: This module is only available on Linux with the ebpf feature enabled
66
7+
#[cfg(all(target_os = "linux", feature = "ebpf"))]
8+
use anyhow::Context;
79
use anyhow::Result;
810
use std::collections::HashMap;
911

0 commit comments

Comments
 (0)