infrastructure capa

infrastructure-security-scan

Soft-spot security auditor: pure check library (SSH/headers/CORS). Assessment, not exploitation.

Soft-spot security auditor: pure check library (SSH/headers/CORS). Assessment, not exploitation.

Tierinfrastructure
Roleunclassified (baselined)
Pathcrates/infrastructure/security-scan
Edition2021
Targetsinfrastructure_security_scan
Public items8 across 8 modules
Tests20

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

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`

ItemWhat 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`

ItemWhat 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`

ItemWhat it is
fn check_process_iocs(names : & & str) -> Vec <ScanFinding>Flag any process/unit name matching a known IOC fragment.

`checks::packages`

ItemWhat 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`

ItemWhat it is
fn check_open_ports(open : & u16, allowed : & u16) -> Vec <ScanFinding>Compare observed open ports against the expected allowlist

`checks::ssh`

ItemWhat 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`

ItemWhat it is
pub struct TlsObservationWhat 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.

ExportDefined 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)
Locationcrates/infrastructure/security-scan
Vocabulary in force (lexicon)current

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`infrastructure-hardening`infrastructurenoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
http^1.1noalways
serde^1derivenoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
serde_json^1noalways

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

KindNameSource
libinfrastructure_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

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone 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.

1 workspace crate depends on this one: operations-net-discovery.

Verification

KindCount
Unit tests20
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
checks::cors100
checks::headers100
checks::ioc100
checks::packages100
checks::ports100
checks::ssh100
checks::tls200

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc88
Public modules with a //! block88
pie showData
    title Public items with rustdoc
    "Documented" : 8
    "No rustdoc detected" : 0

Metrics

MetricValue
Rust source files11
Source lines762
Code lines574
Public API items8
Public modules8
Tests20
Examples0
Cargo features0
Direct runtime dependencies3
Workspace reverse dependencies1
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.

Todas las infrastructure · Manual