334 private links
A safe, single-binary, offline viewer for the official BSI Grundschutz++ catalog, written in Rust. The complete OSCAL catalog from the BSI Stand-der-Technik-Bibliothek is embedded in the executable at compile time: copying the binary to any machine is a full installation — no install step, no database, no network access required.
So yes, it's one binary and it is one way to transfer data and make it usable.
The project is available on GitLab: https://gitlab.com/vPierre/ndaal_public_bsi_grundschutz_oscal_viewer
Five Rust working groups stance on the AI usage on Rust lang
Full of great explanations about securing (hardening) Rust code.
- treat panic behavior as part of your API. Decide explicitly whether panics should unwind or abort, and avoid uncontrolled panics.
- enable stricter Clippy lints (such as indexing and arithmetic checks) when panic freedom is important.
- use a panic hook to shutdown gracefully, set reports, cleanup, collect diagnostics and
- sanitize panic (and logging) messages while logging.
veilis a good crate for that. - avoid unbounded recursion. Prefer iterative algorithms or use depth limits.
- releases builds behave differently. They should be accordingly tested.
- audit dependencies with cargo-audit and cargo-deny
- secure allocation (for defense-in-depth when using unsafe code or FFI) with
mimallocor similar. Measure performance before enabling it globally. - use minimal runtime images if needed (rust distroless). It reduces the attack surface.
- use multi-stage builds with
cargo-chef,--lockedand proper.dockerignore - avoid alpine musl lib c as it introduces subtle runtime differences; at least be aware of them.
- use Linux
landlockto restrict filesystem access even after compromission - never run as root unless absolutely necessary. Drop as much Linux capabilities as possible.
- use Miri to detect undefined behavior, invalid pointer usage and unsafe-ode bugs.
- handle SIGTERM/SIGINT properly. Stop accepting new work, finish inflight requests, flush buffers and then exit cleanly
- protect external dependencies (database, API, cache) with circuit breakers so repeated failures don't cascade
- put explicit limits on everything: upload size, request bodies, queues, timeouts, thread counts,
- expose two health endpoints: a liveness probe and a readiness probe. The liveness probe checks if the process is alive at all, while the readiness probe checks if the process is healthy enough to handle traffic.
- Use fuzzing (
cargo-fuzz,honggfuzz), coverage (cargo-llvm-cov), unsafe detection (cargo-geiger), and memory-analysis tools alongside Rust's compile-time guarantees.
A ripgrep dedicated for Rust
- Stop allocating useless strings: to_string(), .clone(), HashMap borrow the string
- Optimize
hashmaplookups withhashmap.entry().or_insert(0) += 1instead of 3 lookups: in an if condition, insert operation and update. - Use as much core as possible: rewrite loops as iterators and then use rayon with
par_lines. remove()in array is a costly O(n) operation. If order is not important, preferswap_remove.
- Rust doesn't prevent TOCTOU (Time-of-Check to Time-of-Use) race conditions (file path resolution → use file handlers directly)
- Panics are denial-of-service vulnerabilities when handling untrusted input.
- In case of a well established tool, compatibility is a security feature.
- Resolve external information before crossing trust boundaries.
- The interactions with the operating system is a security boundary in Rust. The developer has to be careful.
The post goes in-depth for many cases.
For later when it will be needed.
Some projects has more value to be written in Rust:
- Rust's safety allow to use complex patterns more safely
- Concurrent or multi-threaded systems
- Security-critical components
There are three approaches for ar Rust migration:
- Full Rewrite
- the codebase is relatively small and the scope is tractable
- there is an exhaustive blackbpx test suite that validates behavior
- the API surface is well defined and stable
- the deployment environment is controlled
- Incremental migration for each module
- all other use cases
- Incremental migration with vertical features: each feature is built from the ground up to use 100% Rust code. Business value can be measured directly.
The incremental migration has its own challenge: FFI with C and C++. The rule of thumb is to keep the code responsible for the memory allocation do the deallocation.
An alternative yet similar to VSCode
From 2-10 nanoseconds to 700 picoseconds to format a number.
TL;DR yes.
- creates-mirror
- cargo doc
cargo add <crate> --offlinefrom the global cache registry
But after programming in Rust for 10 years, I think that your coding style has the biggest impact on how your Rust code will look and feel.
People often say Rust’s syntax is ugly, but I’d argue the syntax is the least interesting thing about Rust. The semantics (the bits and pieces the language provides to express your ideas and how those bits combine to build interesting things) are much more important.
Parsing a .env can be clunky in basic algorithm, but elegant in Rust.
Tips:
read_to_string()instead of using a path, opening a file, creating a vector, adding the content to the vector to make a string- Use type inference:
let mut cfg = HashMap::new() - Lean into the typesystem:
.lines()to split strings safely and iterates over the linessplit_once()to get each key-value pair for each lines
- leverage error handling: use an enum to list all possible errors with important values and
thiserrorcan handle the error message
fn parse_config_file(path: &str) -> Result<HashMap<String, String>, ParseError> {
let content = read_to_string(path)?;
let mut config = HashMap::new();
for line in content.lines() {
match KeyValue::try_from(line) {
Ok(kv) => { config.insert(kv.key, kv.value); },
Err(ParseError::InvalidLine(_)) => continue, // Skip invalid lines
Err(e) => return Err(e), // Fail on any other error
}
}
Ok(config)
}
and why this code structure offers more extensibility!
Rust’s beauty is in its semantics and the core mechanics it provides: ownership, borrowing, pattern matching, traits, and so on. If you merely look at its (admittedly foreign) syntax, you overlook the real elegance of the language.
If there is anything that makes Rust “ugly”, it isn’t its syntax but the fact that it doesn’t hide the complexity underneath. Rust values explicitness and you have to deal with the harsh reality that computing is messy. Turns out our assumptions about a program’s execution are often wrong and our mental models are flawed.
Fortunately, we can encapsulate a lot of the complexity behind ergonomic abstractions; it just takes some effort! So don’t worry: once you start to confront your bad habits and look around for better abstractions, Rust stops being ugly.
A simple strategy to build subproceses that does one thing and one thing well.
An stdx
The project support project target dir selections compared to cargo-clean-recursive.
A feedback with Claude Fable 5 and how engineering can change.