How oggy-and-the-cockroaches/rasp works
Sentinel is a Python/FastAPI runtime-protection prototype with a C++ decision engine. The current workflow is: an app installs protection with a policy, runtime hooks inspect supported operations, events are evaluated by the native engine, and blocked actions are logged and returned as HTTP errors. The README identifies requests interception as the supported MVP; SQL, HTML, and process checks are present in the sampled runtime and engine excerpts. Policy building, patching, and formal verification are future work. Some runtime internals are excerpted only partially, so uncertain links are omitted.
Main entry points: runtime.py Runtime hooks · engine.py Native adapter · events.py Event model · __init__.py SDK API
Components 20
Python SDK
- SDK API
python/sentinel/__init__.py - Policy loader
python/sentinel/policy.py - Event model
python/sentinel/events.py
Runtime protection
- Runtime hooks
python/sentinel/runtime.py - HTTP send guard
python/sentinel/runtime.py - SQL guard
python/sentinel/runtime.py - HTML guard
python/sentinel/runtime.py - Process guard
python/sentinel/runtime.py - Request middleware
python/sentinel/runtime.py
Native enforcement
- Native adapter
python/sentinel/engine.py - C ABI bridge
core/cpp/src/bridge.cpp - C++ evaluator
core/cpp/src/engine.cpp - Engine contract
core/cpp/include/sentinel/engine.hpp
Audit logging
- JSON event store
python/sentinel/runtime.py - Log endpoints
python/sentinel/runtime.py
Other components
- App developer
- FastAPI app
- requests client
- SQLite
- Subprocess
Connections 31
- App developer → SDK API: installs protection
README.md - SDK API → Policy loader: loads policy
- SDK API → Runtime hooks: protects app
python/sentinel/__init__.py - SDK API → Event model: exports events
python/sentinel/__init__.py - Runtime hooks → Native adapter: creates engine
python/sentinel/runtime.py - Runtime hooks → Request middleware: registers middleware
python/sentinel/runtime.py - Runtime hooks → requests client: patches requests
python/sentinel/runtime.py - HTTP send guard → Event model: creates event
python/sentinel/runtime.py - HTTP send guard → Native adapter: evaluates event
python/sentinel/runtime.py - HTTP send guard → requests client: calls original
python/sentinel/runtime.py - HTTP send guard → JSON event store: appends violation
python/sentinel/runtime.py - Runtime hooks → SQLite: patches connection
python/sentinel/runtime.py - SQL guard → Event model: creates event
python/sentinel/runtime.py - SQL guard → Native adapter: evaluates event
python/sentinel/runtime.py - SQL guard → JSON event store: appends violation
python/sentinel/runtime.py - Runtime hooks → Subprocess: patches execution
python/sentinel/runtime.py - Process guard → Event model: creates event
python/sentinel/runtime.py - Process guard → Native adapter: evaluates event
python/sentinel/runtime.py - Process guard → JSON event store: appends violation
python/sentinel/runtime.py - Request middleware → HTML guard: checks input
python/sentinel/runtime.py - HTML guard → Event model: creates event
python/sentinel/runtime.py - HTML guard → Native adapter: evaluates event
python/sentinel/runtime.py - HTML guard → JSON event store: appends violation
python/sentinel/runtime.py - Native adapter → C ABI bridge: calls evaluator
- C ABI bridge → Engine contract: builds event
core/cpp/src/bridge.cpp - C ABI bridge → C++ evaluator: evaluates event
core/cpp/src/bridge.cpp - C++ evaluator → Engine contract: implements interface
core/cpp/src/engine.cpp - Runtime hooks → JSON event store: configures store
python/sentinel/runtime.py - Runtime hooks → Log endpoints: registers routes
python/sentinel/runtime.py - Log endpoints → JSON event store: reads events
python/sentinel/runtime.py - Request middleware → FastAPI app: handles requests
python/sentinel/runtime.py