keyhog-scanner 0.5.41

keyhog-scanner: high-performance SIMD-accelerated secret detection engine
Documentation
pub mod a3_decode;
#[cfg(feature = "multiline")]
pub mod a3_multiline;
pub mod a3_pipeline;
pub mod a4_lr2;
pub mod adjudicate;
pub mod alphabet_filter;
pub mod ascii_ci;
pub mod base64_byte_predicates;
pub mod base64_non_padding_equals;
pub mod bigram_bloom;
pub mod checksum;
pub mod checksum_extended;
pub mod compiler_alternation_rewrite_nested_groups;
pub mod compiler_build_ac_empty_returns_none;
pub mod compiler_build_prefix_propagation_longer_extends;
pub mod compiler_build_same_prefix_patterns_pairs;
pub mod compiler_extract_prefix_alternation_akia_asia;
pub mod compiler_extract_prefix_inline_flag_strip;
#[cfg(feature = "gpu")]
pub mod compiler_gpu_literals_empty_disables_gpu;
pub mod compiler_inner_literal_akia_mid_pattern;
pub mod compiler_is_escaped_literal_bracket;
pub mod compiler_phase2_keyword_skips_short;
pub mod compiler_tests;
pub mod confidence;
pub mod confidence_char_diversity_low_penalty;
pub mod confidence_exact_max_score_one;
pub mod confidence_generic_secret_policy;
pub mod confidence_literal_prefix_exact_thirty_five;
pub mod confidence_max_repeat_run_penalty;
pub mod confidence_moderate_entropy_exact_weight;
pub mod confidence_named_placeholder_repeat_run;
pub mod confidence_path_penalty_halves_test_dir;
pub mod confidence_path_penalty_none_path_passes_through;
pub mod confidence_path_penalty_preserves_production_path;
pub mod confidence_penalties;
pub mod confidence_post_ml_placeholder_exact_factor;
pub mod confidence_prefix_floor_jwt_eyj;
pub mod confidence_prefix_floor_skipped_for_placeholder;
pub mod confidence_prefix_floor_slack_xoxb;
pub mod confidence_prefixes;
pub mod confidence_sensitive_file_weight_ten_percent;
pub mod confidence_signals;
pub mod context;
pub mod context_assignment_yaml_mapping;
pub mod context_comparison_eq_not_assignment;
pub mod context_disclaimer_match_context_suppresses;
pub mod context_docstring_assignment_not_documentation;
pub mod context_encrypted_pgp_block;
pub mod context_encrypted_sops_marker;
pub mod context_example_credential_example_suffix;
pub mod context_example_empty_md5_hash;
pub mod context_example_x_dominated_mask;
pub mod context_extended;
pub mod context_fixtures_directory;
pub mod context_go_func_test_boundary;
pub mod context_go_test_file_suffix;
pub mod context_hard_suppress_assignment_never;
pub mod context_hard_suppress_documentation_below_half;
pub mod context_hard_suppress_encrypted_below_point_eight;
pub mod context_inference_fn_boundary;
pub mod context_markdown_fence_marks_documentation;
pub mod context_out_of_bounds_returns_unknown;
pub mod context_python_non_test_function_boundary;
pub mod context_quote_noise_not_docstring;
pub mod context_rust_test_file_suffix;
pub mod context_string_literal_detects_quotes;
pub mod context_test_directory_component;
pub mod context_test_filename_prefix_exact_stem;
pub mod context_tier_b_disclaimer_parser;
pub mod context_tier_b_test_path_parser;
pub mod context_tokio_test_attribute;
pub mod context_unknown_no_quotes_no_assignment;
pub mod crate_source_helper;
pub mod decode;
pub mod decode_caesar_shift_selection;
pub mod decode_structure;
pub mod detector_execution_policy;
pub mod detector_plan;
pub mod doc_marker_example_domain_case_insensitive;
pub mod engine;
pub mod engine_backend;
pub mod engine_cases;
pub mod engine_gpu_routing_cases;
pub mod engine_recovery;
pub mod engine_windowed_ceiling;
pub mod entropy;
pub mod entropy_cargo_toml_not_appropriate;
#[cfg(feature = "entropy")]
pub mod entropy_contiguous_floor;
pub mod entropy_credentials_env_exact_or_config;
pub mod entropy_dash_segmented_decoy;
pub mod entropy_data_uri_rejected;
pub mod entropy_english_prose_boundary;
pub mod entropy_env_staging_prefix_match;
pub mod entropy_fast;
pub mod entropy_fast_extended;
pub mod entropy_fast_x86_tier;
pub mod entropy_hex_digest_context_gate;
#[cfg(feature = "entropy")]
pub mod entropy_isolated_floors;
pub mod entropy_jwt_shape_rejected;
pub mod entropy_keywords_identifier;
pub mod entropy_package_lock_not_appropriate;
pub mod entropy_placeholder_upper_example;
pub mod entropy_program_identifier_boundary;
pub mod entropy_scanner_gates;
pub mod entropy_secrets_rs_not_appropriate;
pub mod entropy_secrets_yaml_is_appropriate;
pub mod entropy_shannon_cache_matches_uncached;
pub mod entropy_symbolic_password_context_relaxation;
pub mod entropy_uniqueness_entropy_checks;
pub mod false_positive_integrity_disclaimer;
#[cfg(all(feature = "ml", feature = "multiline"))]
pub mod file_gate;
pub mod flaw_investigation;
pub mod gates;
pub mod gpu_cases;
pub mod gpu_input_budget;
pub mod gpu_shader_activation;
pub mod phase1_admission;
pub mod phase2_truncate_prefilter;
// gpu_regex_dfa_basic: requires `keyhog_scanner::engine::{build_regex_dfa, RegexDfaError}`
// which are not publicly exported. Needs engine API export or test restructuring.
// pub mod gpu_regex_dfa_basic;
pub mod homoglyph_map_integrity;
pub mod hs_mark_timing;
pub mod hw_probe;
pub mod hw_probe_cases;
pub mod inline_migrated;
pub mod is_sequential_placeholder_robustness;
#[cfg(feature = "entropy")]
pub mod isolated_bare_shape_gates;
pub mod jwt_analysis;
pub mod low_alnum_ratio_char_units;
#[cfg(feature = "simd")]
pub mod mark_stats;
pub mod ml_features_extraction;
#[cfg(feature = "ml")]
pub mod ml_scorer;
pub mod ml_weights_parse;
#[cfg(feature = "multiline")]
pub mod multiline;
#[cfg(feature = "multiline")]
pub mod multiline_large_file_keyword_gate;
#[cfg(feature = "entropy")]
pub mod phase2_entropy_helpers;
pub mod phase2_generic_bridge;
#[cfg(feature = "multiline")]
pub mod pipeline;
pub mod placeholder_suppression_boundaries;
pub mod prefix_trie;
pub mod prefix_trie_extended;
pub mod resolution;
pub mod resolution_extended;
pub mod root_facade;
pub mod scan_state;
pub mod scanner_misc;
pub mod segment_attribution;
pub mod service_vocab;
pub mod shape_canonical;
mod simdsieve_hot_pattern_index_oracle;
pub mod structured_parsers;
pub mod sub_facade;
mod suppression_decode_b64_peek;
mod suppression_decode_b64_roundtrip_proptest;
mod telemetry_serial;
pub mod token_randomness;
pub mod unicode_ascii_control_evasion;
pub mod unicode_combining_mark_blocks;
pub mod unicode_combining_marks_normalization;
pub mod unicode_evasion_anchor_parser;
pub mod unicode_fast_path_borrowed;
pub mod unicode_fullwidth_range_precision;
pub mod unicode_greek_homoglyph_normalization;
pub mod unicode_hardening;
pub mod unicode_hardening_normalization;
pub mod unicode_invisible_format_evasion;
pub mod unicode_mixed_evasion_normalization;
pub mod unicode_rtl_override_removal;
pub mod unicode_separator_and_bidi_completeness;
pub mod unicode_zero_width_removal;
pub mod z85_decode_alphabet_contract;

pub(crate) fn compiled_detector_plans(
    detectors: &[keyhog_core::DetectorSpec],
) -> crate::detector_plan::CompiledDetectorPlans {
    let strings = detectors
        .iter()
        .flat_map(|detector| {
            [
                detector.id.as_str(),
                detector.name.as_str(),
                detector.service.as_str(),
            ]
            .into_iter()
            .chain(
                detector
                    .entropy_fallback
                    .as_ref()
                    .into_iter()
                    .flat_map(|metadata| {
                        [
                            metadata.id.as_str(),
                            metadata.name.as_str(),
                            metadata.service.as_str(),
                        ]
                    }),
            )
        })
        .collect::<Vec<_>>();
    let interner = crate::static_intern::StaticInterner::from_detector_strings(strings);
    let companions = std::iter::repeat_with(Vec::new)
        .take(detectors.len())
        .collect();
    crate::detector_plan::CompiledDetectorPlans::compile(detectors, &interner, companions)
        .expect("test detector plans must compile")
}