You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-4Lines changed: 38 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,12 @@ key_file = "~/.ssh/id_ed25519"
98
98
# vendor auto-detected from device hello
99
99
```
100
100
101
+
**Secrets:**`inventory.toml` may contain plaintext passwords. Prefer
102
+
`key_file` or SSH-agent auth where possible. If you must use inline
103
+
passwords, protect the file with `chmod 600 inventory.toml` and add it
104
+
to `.gitignore`. Passwords are stored in zeroizing memory and redacted
105
+
from `Debug` output, but the on-disk file itself is plaintext.
106
+
101
107
## Library — Quick Start
102
108
103
109
```toml
@@ -391,8 +397,25 @@ match result {
391
397
-**Mock transport tests** — session state machine, CommitUnknown detection, lock recovery
392
398
-**Integration tests** — 32 tests against a live Juniper vSRX including full edit-config round trips, vendor auto-detection, connection pooling, and concurrent sessions
393
399
400
+
### Prerequisites
401
+
402
+
The `rustnetconf-yang` subcrate builds `libyang2` from source via `yang2`'s `bundled` feature, which requires `cmake`. Install it before running workspace-wide tests or clippy:
403
+
394
404
```bash
395
-
cargo test --workspace # Run all tests
405
+
# Debian/Ubuntu
406
+
sudo apt-get install cmake
407
+
408
+
# macOS
409
+
brew install cmake
410
+
411
+
# Fedora/RHEL
412
+
sudo dnf install cmake
413
+
```
414
+
415
+
The core `rustnetconf` and `rustnetconf-cli` crates do not require `cmake`; `cargo test -p rustnetconf` works without it.
416
+
417
+
```bash
418
+
cargo test --workspace # Run all tests (requires cmake)
396
419
cargo test --test integration_vsrx # Run vSRX integration tests only
397
420
SKIP_INTEGRATION=1 cargo test# Skip tests requiring a device
398
421
```
@@ -408,7 +431,7 @@ SKIP_INTEGRATION=1 cargo test # Skip tests requiring a device
408
431
### Security Features
409
432
410
433
-**Credential zeroization** — Passwords and key passphrases use `Zeroizing<String>` (via the `zeroize` crate) and are securely erased from memory on drop.
411
-
-**SSH host key verification** — `HostKeyVerification` must be set explicitly (no `Default` impl). Use `Fingerprint("SHA256:...")`to pin host keys in production.`AcceptAll`is available for lab use but emits a `tracing::warn!`.
434
+
-**SSH host key verification** — `HostKeyVerification` must be set explicitly. The `ClientBuilder` default is `RejectAll` (fail closed): the SSH handshake fails until the caller pins a fingerprint via `Fingerprint("SHA256:...")`or explicitly opts in to`AcceptAll` for lab use (logs a `tracing::warn!`). `ProxyJump` hops parsed from `~/.ssh/config` likewise default to `RejectAll` and must be individually configured. In the CLI, set `host_key_fingerprint` per device in `inventory.toml`, or pass `--insecure-accept-host-key` for lab use only.
412
435
-**Shell-escaped ProxyCommand** — `%h` and `%p` substitutions are shell-escaped to prevent command injection via malicious hostnames.
413
436
-**XML fragment validation** — All user-provided RPC content is validated for well-formedness before insertion, preventing XML injection.
414
437
-**XML attribute escaping** — All message-id values are escaped to prevent XML attribute injection.
@@ -419,10 +442,21 @@ SKIP_INTEGRATION=1 cargo test # Skip tests requiring a device
`russh → internal-russh-forked-ssh-key → rsa 0.10.0-rc.16`. No fixed
450
+
upstream release is available yet. The advisory is risk-accepted with
451
+
rationale in `.cargo/audit.toml` and CI re-checks on every run. It only
452
+
matters when an **RSA** SSH key is used for authentication — Ed25519
453
+
and ECDSA paths are unaffected. Use the mitigation in the next section.
454
+
422
455
### Security Best Practices
423
456
424
-
- Use Ed25519 SSH keys (not RSA) for device authentication
425
-
- Set `host_key_verification(HostKeyVerification::Fingerprint(...))` in production — `HostKeyVerification` has no default, so you must choose explicitly
457
+
- Use Ed25519 SSH keys (not RSA) for device authentication (also mitigates
458
+
RUSTSEC-2023-0071 above)
459
+
- Set `host_key_verification(HostKeyVerification::Fingerprint(...))` in production — the default is `RejectAll` (fail closed), so the connection will refuse to complete until you choose a policy. For the CLI, set `host_key_fingerprint = "SHA256:..."` per device in `inventory.toml`.
426
460
- Set `.rpc_timeout(Duration::from_secs(30))` to prevent hanging on unresponsive devices
427
461
- Prefer SSH agent auth over inline passwords
428
462
- Store credentials in inventory.toml with restricted file permissions (`chmod 600`)
0 commit comments