Soft-spot security auditor: pure check library (SSH/headers/CORS). Assessment, not exploitation.
| Tier | infrastructure |
| Role | unclassified (baselined) |
| Path | crates/infrastructure/security-scan |
| Edition | 2021 |
| Targets | infrastructure_security_scan |
| Public items | 8 across 8 modules |
| Tests | 20 |
What it is for
infrastructure-security-scan — soft-spot security auditor.
A pure check library: SSH / header / CORS analysis over injected observations. It does NOT fetch, schedule, store, or know about jobs / DB / tenants — that is the security-scan-runner (operations layer), which collects observations, drives these checks, and maps ScanFindings onto assessments::Finding.
Assessment, not exploitation: no payloads, no exploits, no writes.
# Closed loop with infrastructure-hardening
The header check verifies exactly what infrastructure_hardening::HardeningConfig declares — a single source of truth, so the auditor can't drift from what hardening promises.
# Dual-use guardrail
Active / intrusive checks require an ActiveScanGrant, obtainable only from an authorized ScanTarget. Unauthorized active scanning is therefore impossible at the type level, not merely discouraged by a CLI default.
Capabilities
checks::cors (other)
CORS reflection check.
| Item |
|---|
fn check_cors_reflection(acao : Option <& str>, allow_credentials : bool, probed_origin : & str,) -> Vec <ScanFinding> |
checks::headers (other)
Response security-header coverage check.
| Item |
|---|
fn check_security_headers(observed : & HeaderMap, expected : & HardeningConfig,) -> Vec <ScanFinding> |
checks::ioc (other)
Indicator-of-compromise sweep over an injected process / unit name list.
| Item |
|---|
fn check_process_iocs(names : & & str) -> Vec <ScanFinding> |
checks::packages (other)
Pending-security-update check over apt-get -s upgrade output.
| Item |
|---|
fn check_pending_security_updates(apt_simulate_output : & str) -> Vec <ScanFinding> |
checks::ports (other)
Open-port check: flag listeners that aren't on the expected allowlist.
| Item |
|---|
fn check_open_ports(open : & u16, allowed : & u16) -> Vec <ScanFinding> |
checks::ssh (other)
SSH daemon config check.
| Item |
|---|
fn check_sshd_config(effective_config : & str) -> Vec <ScanFinding> |
TlsObservation
TLS posture check (over an injected observation — e.g. from an openssl
| Item |
|---|
pub struct TlsObservation |
fn check_tls(observed : & TlsObservation) -> Vec <ScanFinding> |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
infrastructure_security_scan
checkschecks::corschecks::headerschecks::iocchecks::packageschecks::portschecks::sshchecks::tls
flowchart TD n_infrastructure_security_scan["infrastructure_security_scan"] n_infrastructure_security_scan --> n_checks["checks"] n_checks --> n_checks__cors["cors"] n_checks --> n_checks__headers["headers"] n_checks --> n_checks__ioc["ioc"] n_checks --> n_checks__packages["packages"] n_checks --> n_checks__ports["ports"] n_checks --> n_checks__ssh["ssh"] n_checks --> n_checks__tls["tls"]
Public surface
`checks::cors`
| Item | What it is |
|---|---|
fn check_cors_reflection(acao : Option <& str>, allow_credentials : bool, probed_origin : & str,) -> Vec <ScanFinding> | acao = observed Access-Control-Allow-Origin header value (if any) when the server was probed with Origin: {probed_origin}. |
`checks::headers`
| Item | What it is |
|---|---|
fn check_security_headers(observed : & HeaderMap, expected : & HardeningConfig,) -> Vec <ScanFinding> | Report a finding for every header expected declares that is absent from the live observed response. |
`checks::ioc`
| Item | What it is |
|---|---|
fn check_process_iocs(names : & & str) -> Vec <ScanFinding> | Flag any process/unit name matching a known IOC fragment. |
`checks::packages`
| Item | What it is |
|---|---|
fn check_pending_security_updates(apt_simulate_output : & str) -> Vec <ScanFinding> | Parse simulated apt output; report a finding if security updates are pending. |
`checks::ports`
| Item | What it is |
|---|---|
fn check_open_ports(open : & u16, allowed : & u16) -> Vec <ScanFinding> | Compare observed open ports against the expected allowlist |
`checks::ssh`
| Item | What it is |
|---|---|
fn check_sshd_config(effective_config : & str) -> Vec <ScanFinding> | Audit effective sshd config text for the high-risk defaults that left the incident box open (root login + password auth over SSH). |
`checks::tls`
| Item | What it is |
|---|---|
pub struct TlsObservation | What the runner observed about a target's TLS configuration. |
fn check_tls(observed : & TlsObservation) -> Vec <ScanFinding> | Flag deprecated protocols, weak ciphers, and near/post-expiry certs. |
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
{ActiveScanGrant,ScanTarget} | target::{ActiveScanGrant,ScanTarget} |
{ScanFinding,ScanSeverity} | finding::{ScanFinding,ScanSeverity} |
Boundary
Depends on no other workspace tier.
Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | infrastructure |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/infrastructure/security-scan |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `infrastructure-hardening` | infrastructure | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
http | ^1.1 | — | no | always |
serde | ^1 | derive | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
serde_json | ^1 | — | no | always |
Build. None.
Depended on by. 1 workspace crate.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_operations_net_discovery["operations-net-discovery"] -->|uses| SELF SELF["infrastructure-security-scan"] SELF -->|runtime| n_infrastructure_hardening["infrastructure-hardening"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| lib | infrastructure_security_scan | `src/lib.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
1 workspace crate depends on this one: operations-net-discovery.
Verification
| Kind | Count |
|---|---|
| Unit tests | 20 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
checks::cors | 1 | 0 | 0 |
checks::headers | 1 | 0 | 0 |
checks::ioc | 1 | 0 | 0 |
checks::packages | 1 | 0 | 0 |
checks::ports | 1 | 0 | 0 |
checks::ssh | 1 | 0 | 0 |
checks::tls | 2 | 0 | 0 |
What the tests establish, by name:
no_reflection_no_finding—src/checks/cors.rsreflect_with_credentials_is_critical—src/checks/cors.rsreflect_without_credentials_is_medium—src/checks/cors.rsfully_hardened_response_has_no_findings—src/checks/headers.rsmissing_headers_are_reported—src/checks/headers.rsclean_process_list_no_findings—src/checks/ioc.rsincident_miner_is_critical—src/checks/ioc.rsnothing_pending_no_finding—src/checks/packages.rspending_nginx_security_update_is_high—src/checks/packages.rsall_expected_no_findings—src/checks/ports.rsunexpected_port_flagged_and_telnet_is_high—src/checks/ports.rshardened_ssh_has_no_findings—src/checks/ssh.rsopen_root_password_login_flagged—src/checks/ssh.rslegacy_protocol_and_expired_cert_flagged—src/checks/tls.rsmodern_tls_is_clean—src/checks/tls.rsfinding_round_trips_json—src/finding.rsseverity_orders_low_to_critical—src/finding.rsauthorized_target_yields_grant—src/target.rspassive_target_yields_no_active_grant—src/target.rsrange_target_is_unauthorized_until_authorized—src/target.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 8 | 8 |
Public modules with a //! block | 8 | 8 |
pie showData
title Public items with rustdoc
"Documented" : 8
"No rustdoc detected" : 0
Metrics
| Metric | Value |
|---|---|
| Rust source files | 11 |
| Source lines | 762 |
| Code lines | 574 |
| Public API items | 8 |
| Public modules | 8 |
| Tests | 20 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 3 |
| Workspace reverse dependencies | 1 |
pie showData
title Public API by kind
"function" : 7
"struct" : 1
pie showData
title Rust source composition
"Code" : 574
"Blank or comment" : 188
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.