Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
e72c96b
ebpf files
Mar 17, 2026
8759564
refactoring, ebpf / containers
Mar 19, 2026
2f6db16
feat(cli): add clap subcommands (serve/sniff) + sniff config
Mar 30, 2026
27f3d6f
feat(sniff): log source discovery + database persistence
Mar 30, 2026
c9164c5
feat(sniff): log reader trait + File/Docker/Journald implementations
Mar 30, 2026
dc09c3e
feat(sniff): AI log analysis with OpenAI and pattern backends
Mar 30, 2026
b358eac
feat(sniff): consume mode — zstd compression, dedup, log purge
Mar 30, 2026
1658cc6
feat(sniff): reporter + orchestrator loop
Mar 30, 2026
2f38be3
feat(sniff): REST API for log sources and summaries
Mar 30, 2026
5f4b05c
docs: update CHANGELOG and README for sniff feature
Mar 30, 2026
ac3e579
Merge feature/sniff-logs: log discovery, AI analysis, archival
Mar 30, 2026
49b37aa
chore: remove task files from repo and gitignore
Mar 30, 2026
c8e5c90
feat: add curl-based binary installation
Mar 30, 2026
83cf1d2
docs: fix ML module status — stub infrastructure, not in progress
Mar 30, 2026
b2ffc0a
feat(cli): add --ai-model and --ai-api-url flags to sniff command
Mar 31, 2026
01942f8
feat(sniff): add debug logging and robust LLM JSON extraction
Mar 31, 2026
9504301
feat(alerting): implement real Slack webhook notifications
Mar 31, 2026
72d7515
Update docker.yml
vsilent Mar 31, 2026
d364801
ci: upgrade deprecated GitHub Actions to v4
Mar 31, 2026
c4d222e
Merge pull request #1 from vsilent/dev
vsilent Mar 31, 2026
7112a0b
ci: modernize Docker CICD workflow
Mar 31, 2026
3973c53
build: switch to musl targets and rustls for portable binaries
Mar 31, 2026
4601763
chore: add pre-commit hook and apply cargo fmt
Mar 31, 2026
fa74035
fix: resolve all clippy warnings
Mar 31, 2026
cc4a9b2
fix: use _pid consistently in get_process_comm
Mar 31, 2026
db9e5c0
fix: resolve clippy errors in Linux-only firewall modules
Mar 31, 2026
a22ab6d
fix: remove redundant to_string() in format! args
Mar 31, 2026
431089b
fix: convert NfTable to string before passing to args()
Mar 31, 2026
ebf9310
chore: bump VERSION.md to 0.2.0
Mar 31, 2026
1cf2162
fix: resolve warnings in tests and examples
Mar 31, 2026
56dcd95
fix: restore mutable enricher in enrichment tests
Mar 31, 2026
7824052
fix: align test mutability and silence unused ptrace events var
Mar 31, 2026
77ed42a
fix(tests): clean remaining all-target warnings and invalid literal
Mar 31, 2026
f1ed8e7
fix: restore used enrichment vars and silence ptrace unused vars
Mar 31, 2026
f919cc9
fix: handle non-linux unused vars in enrichment tests
Mar 31, 2026
c8a2b84
test: fix ebpf loader creation assertion for linux builds
Mar 31, 2026
ad49047
test: use valid 64-char hex container ID in enrichment test
Mar 31, 2026
bc6967c
ci: fallback to npm install when web lockfile is missing
Mar 31, 2026
a9757d4
web: add webpack config with TS entrypoint for dashboard build
Mar 31, 2026
8d37e7b
web: fix dashboard import paths and TypeScript build errors
Mar 31, 2026
2cf69c4
log: show API URL instead of dashboard bind address
Mar 31, 2026
4229627
web: default API/WS endpoints to APP_PORT or 5555
Mar 31, 2026
f3b23e9
web: normalize container API payloads to prevent runtime crashes
Mar 31, 2026
3e6cae5
web: fix threat statistics endpoint path
Mar 31, 2026
a0508b0
web: guard ThreatMap against missing stats buckets
Mar 31, 2026
9366741
web: restore CSS injection and degrade gracefully without WS endpoint
Mar 31, 2026
99c85b1
web: add left sidebar navigation to dashboard layout
Mar 31, 2026
a6aac14
web: move logo to sidebar and add top actions bar
Mar 31, 2026
8bf0648
Merge pull request #2 from vsilent/dev
vsilent Mar 31, 2026
2f152b7
install: fallback when latest release is missing
Mar 31, 2026
d3500d4
Merge pull request #3 from vsilent/dev
vsilent Mar 31, 2026
4255698
fix: avoid panic on malformed .env
Mar 31, 2026
3ceb0a6
docs: update README and changelog for installer/env fixes
Mar 31, 2026
c216882
Limit sniff analyzer prompts
Apr 2, 2026
e17e57b
Merge pull request #4 from trydirect/dev
vsilent Apr 2, 2026
1101c5a
Add live mail abuse guard
Apr 3, 2026
83434cf
iptables & nftables
Apr 3, 2026
ca0944f
multiple updates, eBPF, container API quality is improved
Apr 3, 2026
c845579
tests, ip_ban engine implemented, frontend dashboard improvements
Apr 4, 2026
1c30685
logs, containers in ui, ports, ws
Apr 4, 2026
400a99f
context.to_string()
Apr 4, 2026
5ee1267
clippy fix
Apr 4, 2026
49d4488
clippy fix
Apr 4, 2026
d790554
clippy fix
Apr 4, 2026
c316f94
ip_ban::engine::tests
Apr 5, 2026
7e4c2ab
GLIBC_2.39 not found fix, using musl
Apr 6, 2026
5956f4d
docker files
Apr 6, 2026
e2c9a46
multi stage build
Apr 6, 2026
8437ada
The problem was cross build reusing the default target directory, wh…
Apr 6, 2026
b724897
mount docker.sock to stackdog container
Apr 6, 2026
cb6c405
Merge pull request #6 from vsilent/dev
vsilent Apr 6, 2026
1a6ed9b
Merge upstream main\n\nResolve merge conflicts after pulling upstream…
Apr 6, 2026
79ce963
Audit, analyze syslog, new detectors, sniff command enriched
Apr 7, 2026
3438805
Audit, analyze syslog, new detectors, sniff command enriched
Apr 7, 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
18 changes: 18 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
set -e

echo "🐕 Stackdog pre-commit: running cargo fmt..."
cargo fmt --all -- --check || {
echo "❌ cargo fmt failed. Run 'cargo fmt --all' to fix."
exit 1
}

echo "🐕 Stackdog pre-commit: running cargo clippy..."
cargo clippy 2>&1
CLIPPY_EXIT=$?
if [ $CLIPPY_EXIT -ne 0 ]; then
echo "❌ cargo clippy failed to compile. Fix errors before committing."
exit 1
fi

echo "✅ Pre-commit checks passed."
4 changes: 2 additions & 2 deletions .github/workflows/codacy-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
Expand All @@ -41,6 +41,6 @@ jobs:

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
189 changes: 64 additions & 125 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,161 +2,100 @@

on:
push:
branches:
- master
- testing
branches: [main, dev]
pull_request:
branches:
- master
branches: [main, dev]

jobs:
cicd-linux-docker:
name: Cargo and npm build
#runs-on: ubuntu-latest
runs-on: [self-hosted, linux]
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt, clippy
targets: x86_64-unknown-linux-musl

- name: Cache cargo registry
uses: actions/cache@v2.1.6
with:
path: ~/.cargo/registry
key: docker-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
docker-registry-
docker-

- name: Cache cargo index
uses: actions/cache@v2.1.6
with:
path: ~/.cargo/git
key: docker-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
docker-index-
docker-
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross

- name: Generate Secret Key
run: |
head -c16 /dev/urandom > src/secret.key
run: head -c16 /dev/urandom > src/secret.key

- name: Cache cargo build
uses: actions/cache@v2.1.6
with:
path: target
key: docker-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
docker-build-
docker-

- name: Cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Check
run: cargo check

- name: Cargo test
if: ${{ always() }}
uses: actions-rs/cargo@v1
with:
command: test
- name: Format check
run: cargo fmt --all -- --check

- name: Rustfmt
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt
command: fmt
args: --all -- --check

- name: Rustfmt
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: clippy
command: clippy
args: -- -D warnings

- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Clippy
run: cargo clippy -- -D warnings

- name: Test
run: cargo test

- name: Build static release
env:
CARGO_TARGET_DIR: target-cross
run: cross build --release --target x86_64-unknown-linux-musl

- name: npm install, build, and test
- name: Build frontend
working-directory: ./web
run: |
npm install
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi
npm run build
# npm test

- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: dist-without-markdown
path: |
web/dist
!web/dist/**/*.md

# - name: Archive code coverage results
# uses: actions/upload-artifact@v2
# with:
# name: code-coverage-report
# path: output/test/code-coverage.html
- name: Display structure of downloaded files
run: ls -R web/dist

- name: Copy app files and zip
- name: Package app
run: |
mkdir -p app/stackdog/dist
cp target/release/stackdog app/stackdog
cp -a web/dist/. app/stackdog
cp target-cross/x86_64-unknown-linux-musl/release/stackdog app/stackdog/
cp -a web/dist/. app/stackdog/
cp docker/prod/Dockerfile app/Dockerfile
cd app
touch .env
tar -czvf ../app.tar.gz .
cd ..
touch app/.env
tar -czf app.tar.gz -C app .

- name: Upload app archive for Docker job
uses: actions/upload-artifact@v2.2.2
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: artifact-linux-docker
name: app-archive
path: app.tar.gz
retention-days: 1

cicd-docker:
name: CICD Docker
#runs-on: ubuntu-latest
runs-on: [self-hosted, linux]
needs: cicd-linux-docker
docker:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +11 to +74
name: Docker Build & Push
runs-on: ubuntu-latest
needs: build
steps:
- name: Download app archive
uses: actions/download-artifact@v2
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: artifact-linux-docker
name: app-archive

- name: Extract app archive
run: tar -zxvf app.tar.gz
- name: Extract archive
run: tar -xzf app.tar.gz

- name: Display structure of downloaded files
run: ls -R
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker build and publish
uses: docker/build-push-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: trydirect/stackdog
add_git_labels: true
tag_with_ref: true
#no-cache: true

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: trydirect/stackdog:latest

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Comment on lines +75 to +101
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
- target: x86_64-unknown-linux-musl
artifact: stackdog-linux-x86_64
- target: aarch64-unknown-linux-gnu
- target: aarch64-unknown-linux-musl
artifact: stackdog-linux-aarch64

steps:
Expand All @@ -36,12 +36,14 @@ jobs:
run: cargo install cross --git https://github.com/cross-rs/cross

- name: Build release binary
env:
CARGO_TARGET_DIR: target-cross
run: cross build --release --target ${{ matrix.target }}

- name: Package
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/stackdog dist/stackdog
cp target-cross/${{ matrix.target }}/release/stackdog dist/stackdog
cd dist
tar czf ${{ matrix.artifact }}.tar.gz stackdog
sha256sum ${{ matrix.artifact }}.tar.gz > ${{ matrix.artifact }}.tar.gz.sha256
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ Cargo.lock
# End of https://www.gitignore.io/api/rust,code

.idea
*.db
docs/tasks/
web/node_modules/
web/dist/
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.2] - 2026-04-07

### Fixed

- **CLI startup robustness**`.env` loading is now non-fatal.
- `stackdog --help` and other commands no longer panic when `.env` is missing or contains malformed lines.
- Stackdog now logs a warning and continues with existing environment variables.

- **Installer release resolution**`install.sh` now handles missing `/releases/latest` responses gracefully.
- Falls back to the most recent release entry when no stable "latest" release is available.
- Improves error messaging and updates install examples to use the `main` branch script URL.

### Added

- **Expanded detector framework** with additional log-driven detection coverage.
- Reverse shell, sensitive file access, cloud metadata / SSRF, exfiltration chain, and secret leakage detectors.
- file integrity monitoring with SQLite-backed baselines via `STACKDOG_FIM_PATHS`.
- configuration assessment via `STACKDOG_SCA_PATHS`.
- package inventory heuristics via `STACKDOG_PACKAGE_INVENTORY_PATHS`.
- Docker posture audits for privileged mode, host namespaces, dangerous capabilities, Docker socket mounts, and writable sensitive mounts.

- **Improved syslog ingestion**
- RFC3164 and RFC5424 parsing in file-based log ingestion for cleaner timestamps and normalized message bodies.

#### Log Sniffing & Analysis (`stackdog sniff`)
- **CLI Subcommands** — Multi-mode binary with `stackdog serve` and `stackdog sniff`
- `--once` flag for single-pass mode
Expand Down Expand Up @@ -66,6 +88,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Refactored `main.rs` to dispatch `serve`/`sniff` subcommands via clap
- Added `events`, `rules`, `alerting`, `models` modules to binary crate
- Updated `.env.sample` with `STACKDOG_LOG_SOURCES`, `STACKDOG_AI_*` config vars
- Version metadata updated to `0.2.2` across Cargo, the web package manifest, and current release documentation.

### Testing

Expand Down
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stackdog"
version = "0.2.0"
version = "0.2.2"
authors = ["Vasili Pascal <info@try.direct>"]
edition = "2021"
description = "Security platform for Docker containers and Linux servers"
Expand Down Expand Up @@ -48,13 +48,15 @@ r2d2 = "0.8"
bollard = "0.16"

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

# Compression
zstd = "0.13"

# Stream utilities
futures-util = "0.3"
lettre = { version = "0.11", default-features = false, features = ["tokio1", "tokio1-rustls-tls", "builder", "smtp-transport"] }

# eBPF (Linux only)
[target.'cfg(target_os = "linux")'.dependencies]
Expand All @@ -78,6 +80,8 @@ ebpf = []
# Testing
tokio-test = "0.4"
tempfile = "3"
actix-test = "0.1"
awc = "3"

# Benchmarking
criterion = { version = "0.5", features = ["html_reports"] }
Expand Down
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Stackdog Security - Development Plan

**Last Updated:** 2026-03-13
**Current Version:** 0.2.0
**Last Updated:** 2026-04-07
**Current Version:** 0.2.2
**Status:** Phase 2 In Progress

## Project Vision
Expand Down
Loading
Loading