Skip to main content

Crate sdkt_audit

Crate sdkt_audit 

Source
Expand description

sdkt-audit — static security analysis for Soroban contracts (Gap C).

Offline, source-based heuristics for Soroban-specific logic/security bugs the Rust compiler does not catch (missing auth, unauthenticated cross-contract calls, unguarded initialize, suspicious move-after-use). No networking.

§Plugin authoring

Implement AuditRule, then register your rule with [register_rule] (or the register_rule! macro). Built-in rules register through the same RuleRegistry. See docs/plugin-authoring.md.

Re-exports§

pub use audit::all_rules;
pub use audit::audit_source;
pub use audit::audit_source_with;
pub use audit::audit_source_with_registry;
pub use audit::audit_source_with_spec;
pub use audit::scan_all_functions;
pub use audit::scan_all_functions_str;
pub use audit::AuditContext;
pub use audit::AuditRule;
pub use audit::FnScan;
pub use error::AuditError;
pub use plugin_doctor::doctor;
pub use plugin_doctor::doctor_installed;
pub use plugin_doctor::doctor_installed_with_root;
pub use plugin_doctor::doctor_with_root;
pub use plugin_doctor::DoctorReport;
pub use plugin_doctor::DoctorStage;
pub use plugin_doctor::DoctorStageStatus;
pub use plugin_doctor::DOCTOR_SAMPLE_CONTRACT;
pub use plugin_store::install_bundle;
pub use plugin_store::install_bundle_with_key;
pub use plugin_store::pack_bundle;
pub use plugin_store::verify_bundle;
pub use plugin_store::BundleVerification;
pub use plugin_store::InstallOpts;
pub use plugin_store::PluginMeta;
pub use plugin_store::StoreError;
pub use registry::register_builtin_rules;
pub use registry::register_rule;
pub use registry::run_registered;
pub use registry::BoxedRule;
pub use registry::RuleRegistry;
pub use rules::Auth001;
pub use rules::Auth002;
pub use rules::Auth003;
pub use rules::Auth004;
pub use rules::Move001;
pub use sarif::report_to_sarif_string;
pub use sarif::report_to_sarif_string_multi_file;
pub use sarif::to_sarif;
pub use sarif::to_sarif_multi_file;
pub use sarif::SarifLog;
pub use types::AuditReport;
pub use types::AuditSummary;
pub use types::Finding;
pub use types::RuleInfo;
pub use types::Severity;

Modules§

audit
Audit engine: rule trait, AST scanner, and entry points.
error
plugin_abi
C-ABI boundary types for dynamic audit plugins (, Phase B).
plugin_doctor
End-to-end diagnostic and self-check runner for sdkt-audit plugins.
plugin_store
Local, offline-first plugin store for sdkt-audit ().
registry
Rule registry — the extensibility backbone of sdkt-audit.
rules
Built-in audit rules. Each implements crate::audit::AuditRule.
sarif
SARIF 2.1.0 serializer for AuditReport.
types
Static security analysis types for Soroban contracts.

Macros§

register_rule
Register a rule into the process-wide RuleRegistry.