| Crates.io | palisade-config |
| lib.rs | palisade-config |
| version | 0.1.0 |
| created_at | 2026-01-12 00:01:35.085146+00 |
| updated_at | 2026-01-12 00:01:35.085146+00 |
| description | Security-conscious configuration management for honeypot systems with cryptographic tag derivation |
| homepage | |
| repository | https://github.com/Guivernoir/palisade-config |
| max_upload_size | |
| id | 2036742 |
| size | 325,543 |
Security-hardened configuration management for honeypot and deception infrastructure.
This library handles cryptographic secrets and security-critical configuration.
Before using in production:
SECURITY.md completelyThis is not a toyβmisconfiguration creates attack vectors.
Palisade Config provides a battle-tested configuration system for deception infrastructure with a focus on:
In deception systems, configuration IS security:
| Configuration Issue | Attack Vector |
|---|---|
| Config file leaks | Reveals system architecture |
| Weak entropy | Enables artifact correlation |
| Path disclosure | Information reconnaissance |
| Threshold tuning | False negatives/positives |
| Memory persistence | Forensic recovery |
This library treats configuration as a first-class security boundary.
[dependencies]
palisade-config = "0.1.0"
palisade-errors = "0.1.0" # Required for error handling
use palisade_config::{Config, PolicyConfig, ValidationMode};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Load configuration (infrastructure)
let config = Config::from_file("/etc/honeypot/config.toml")?;
config.validate_with_mode(ValidationMode::Strict)?;
// Load policy (detection logic)
let policy = PolicyConfig::from_file("/etc/honeypot/policy.toml")?;
policy.validate()?;
// Derive cryptographically unique artifact tags
let hostname = config.hostname();
let artifact_tag = config.deception.root_tag
.derive_artifact_tag(&hostname, "fake-aws-credentials");
println!("Artifact tag: {}", artifact_tag);
// Check for suspicious processes (zero-allocation hot path)
if policy.is_suspicious_process("mimikatz.exe") {
println!("THREAT DETECTED!");
}
Ok(())
}
config.toml (infrastructure):
version = 1
[agent]
instance_id = "honeypot-prod-web-01"
work_dir = "/var/lib/palisade-agent"
environment = "production"
[deception]
root_tag = "a1b2c3d4e5f67890abcdef1234567890a1b2c3d4e5f67890abcdef1234567890"
decoy_paths = [
"/home/admin/.aws/credentials",
"/opt/secrets/database.key"
]
credential_types = ["aws", "ssh", "gcp"]
honeytoken_count = 10
artifact_permissions = 0o600
[telemetry]
watch_paths = ["/home", "/opt"]
event_buffer_size = 50000
enable_syscall_monitor = false
[logging]
log_path = "/var/log/palisade-agent/agent.log"
format = "json"
level = "INFO"
policy.toml (detection logic):
version = 1
[scoring]
correlation_window_secs = 300
alert_threshold = 60.0
enable_time_scoring = true
[scoring.weights]
artifact_access = 50.0
suspicious_process = 35.0
rapid_enumeration = 25.0
[response]
cooldown_secs = 60
dry_run = false
[[response.rules]]
severity = "Critical"
action = "isolate_host"
conditions = [
{ type = "min_confidence", threshold = 85.0 },
{ type = "min_signal_types", count = 3 }
]
[deception]
suspicious_processes = ["mimikatz", "procdump", "lazagne"]
Palisade enforces a strict separation:
βββββββββββββββββββββββββββββββββββββββββββ
β Configuration (Cold) β
β β£ Infrastructure: paths, buffers β
β β£ Capabilities: what can run β
β β£ Requires deployment to change β
β β£ Versioned with application β
βββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββ
β Policy (Hot) β
β β£ Decision logic: thresholds, rules β
β β£ Detection patterns: signatures β
β β£ Hot-reloadable without restart β
β β£ Independently versioned β
βββββββββββββββββββββββββββββββββββββββββββ
Why this matters:
Artifacts are tagged using a secure derivation hierarchy:
root_tag (256-bit secret, never exposed)
β SHA3-512(root_tag || hostname)
host_tag (per-deployment, internal only)
β SHA3-512(host_tag || artifact_id)
artifact_tag (per-decoy, embedded in files)
Security Properties:
Example:
let root = RootTag::generate();
// Different hosts get different tags for same artifact
let tag_host_a = root.derive_artifact_tag("host-a", "ssh-key");
let tag_host_b = root.derive_artifact_tag("host-b", "ssh-key");
assert_ne!(tag_host_a, tag_host_b); // Zero correlation!
All sensitive data is protected with ZeroizeOnDrop:
{
let config = Config::from_file("config.toml")?;
// Use config...
} // β Memory zeroized here, forensically unrecoverable
Protected Types:
RootTag: Cryptographic secretsProtectedString: Instance IDs, tokensProtectedPath: Work directories, artifact locationspub enum ValidationMode {
Standard, // Format checks, no filesystem I/O
Strict, // Paths must exist, permissions verified
}
When to use:
palisade-config/
βββ config.rs # Infrastructure configuration
βββ policy.rs # Detection and response policy
βββ tags.rs # Cryptographic tag derivation
βββ validation.rs # Configuration diffing and validation
βββ defaults.rs # Centralized default values
βββ lib.rs # Public API exports
Layer 1: Memory Protection
β ZeroizeOnDrop on all sensitive fields
β No Clone trait on secrets
Layer 2: Cryptographic Isolation
β SHA3-512 tag derivation
β Per-host, per-artifact uniqueness
Layer 3: Validation
β Comprehensive format checks
β Entropy validation
β Platform-aware security
Layer 4: Error Handling
β Obfuscated external messages
β Detailed internal logging
β Timing normalization
Integration with palisade-errors provides:
// External: "Configuration validation failed"
// Internal: "deception.honeytoken_count must be 1-100, got 250"
Track security-significant changes for audit trails:
let old = Config::from_file("config.old.toml")?;
let new = Config::from_file("config.new.toml")?;
for change in old.diff(&new) {
match change {
ConfigChange::RootTagChanged { old_hash, new_hash } => {
println!("WARNING: Root tag rotation detected");
}
ConfigChange::PathsChanged { added, removed } => {
println!("Artifact paths modified");
}
_ => {}
}
}
Tune detection without downtime:
let mut current_policy = PolicyConfig::from_file("policy.toml")?;
// ... later, reload policy ...
let new_policy = PolicyConfig::from_file("policy.toml")?;
if current_policy.diff(&new_policy).is_empty() {
println!("No changes detected");
} else {
current_policy = new_policy; // Atomic update
println!("Policy updated");
}
Performance-critical operations avoid heap usage:
// Single allocation (input conversion), then pure scanning
policy.is_suspicious_process("MIMIKATZ.exe"); // ~48-59ns
Configuration files MUST be 0600 (owner-only) on Unix systems.
The library enforces this:
// Fails if config file is readable by group/others
Config::from_file("/etc/honeypot/config.toml")?;
The root_tag is the crown jewel of your deception infrastructure.
Best practices:
RootTag::generate() (cryptographically secure RNG)All root tags undergo comprehensive validation:
This catches:
Unix-specific checks:
Other platforms:
Real benchmark results from cargo bench on 2010 hardware(Dell Latitude E6410):
| Operation | Time | Details |
|---|---|---|
| Config default creation | 4.18 Β΅s | Creating default config from scratch |
| Config validation | 13.88 ns | Standard mode validation (format checks) |
| Config diff (identical) | 878.70 ns | Comparing two identical configurations |
| Config to TOML | 22.84 Β΅s | Serializing config to TOML format |
| Config from TOML | 34.04 Β΅s | Deserializing config from TOML |
| Config load from file | 49.31 Β΅s | Full file read + parse + validation |
| Hostname resolution | 506.32 ns | Resolving system hostname |
| Validate standard mode | 13.79 ns | Standard validation (no filesystem I/O) |
| Operation | Time | Details |
|---|---|---|
| Root tag generation | 2.37 Β΅s | Generating new 256-bit cryptographic tag |
| Root tag hash access | 635.37 ps | Accessing cached hash value |
| Root tag derivation | 2.68 Β΅s | Deriving host tag from root tag (SHA3-512) |
| Tag generation | 2.02 Β΅s | Full tag generation process |
| Tag derive host | 784.52 ns | Deriving host-specific tag |
| Tag derive artifact | 2.68 Β΅s | Deriving artifact tag (SHA3-512 + hex) |
| Tag hash access | 636.76 ps | Accessing cached tag hash |
| Tag hash comparison | 633.87 ps | Comparing two tag hashes (constant-time) |
| Operation | Time | Details |
|---|---|---|
| Policy default creation | 169.90 ns | Creating default policy configuration |
| Policy validation | 145.88 ns | Validating policy format and constraints |
| Suspicious process (benign) | 51.73 ns | Checking non-malicious process name |
| Suspicious process (malicious) | 59.69 ns | Detecting known malicious process (hit) |
| Suspicious process (mixed) | 48.59 ns | Case-insensitive pattern matching |
| Severity classification (low) | 633.85 ps | Low severity event classification |
| Severity classification (med) | 635.84 ps | Medium severity event classification |
| Severity classification (high) | 639.57 ps | High severity event classification |
| Severity classification (crit) | 666.62 ps | Critical severity event classification |
| Policy diff (identical) | 545.03 ns | Comparing two identical policy configurations |
| Operation | Time | Details |
|---|---|---|
| Validate standard | 15.22 ns | Standard validation mode (format only) |
| Validate full | 15.24 ns | Full validation (all checks enabled) |
Key Performance Characteristics:
See the examples/ directory:
basic_usage.rs - Loading and validating configurationtag_derivation.rs - Cryptographic tag hierarchypolicy_hot_reload.rs - Hot-reloading policiescomprehensive_validation.rs - All validation modesproduction_deployment.rs - Production-ready setupchange_tracking.rs - Configuration diffingRun examples:
cargo run --example basic_usage
cargo run --example tag_derivation
# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test
cargo test test_root_tag_generation
# Run benchmarks
cargo bench
# Check formatting
cargo fmt --check
# Linting
cargo clippy -- -D warnings
Full API documentation available at docs.rs/palisade-config
Quick links:
Config - Main configurationPolicyConfig - Detection policyRootTag - Cryptographic tagsValidationMode - Validation strictnessDO NOT open public issues for security vulnerabilities.
See SECURITY.md for responsible disclosure procedures.
Contributions welcome! Please ensure:
cargo test)cargo fmt)cargo clippy)cargo bench)Licensed under either of:
at your option.
A: Yes! The security properties (memory zeroization, cryptographic isolation, comprehensive validation) are valuable for any security-critical configuration system.
A: SHA3-512 is NIST-approved (FIPS 202) and more conservative. BLAKE3 is faster but less widely audited. For key derivation (not a hot path at ~2.7Β΅s), we choose conservatism over raw speed.
A: Root tag rotation requires:
This is intentionally manual to prevent accidental rotation.
A: Yes! Policies are designed for hot-reloading with <1Β΅s diff operations. Configuration (infrastructure) requires restart.
A: The library fails fast with an error. You must provide a new root tag with sufficient entropy. This prevents weak secrets from being used.
A: Not yet. Community security review welcome. See SECURITY.md.
A: It's not slowβit's thorough. This includes file I/O, TOML parsing, entropy validation, permission checks, and format validation. For a security-critical operation performed once at startup, correctness trumps speed.
Built with β€οΈ and paranoia.