Repository Analysis

elastic/detection-rules

16.6 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of elastic/detection-rules, a Python project with 2,654 GitHub stars. SynthScan v2.0 examined 502,815 lines of code across 2833 source files, recording 2055 pattern matches distributed across 16 syntactic categories. The overall adjusted score of 16.6 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

16.6
Adjusted Score
16.6
Raw Score
100%
Time Factor
2026-07-14
Last Push
2.7K
Stars
Python
Language
502.8K
Lines of Code
2.8K
Files
2.1K
Pattern Hits
2026-07-14
Scan Date
0.55
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 1564MEDIUM 33LOW 458

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 2055 distinct pattern matches across 16 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Cross-File Repetition1560 hits · 7800 pts
SeverityFileLineSnippetContext
HIGH…/credential_access_entra_id_risk_detection_signal.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…ing_block/collection_microsoft_purview_dlp_signal.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…initial_access_microsoft_air_investigation_signal.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…vasion_microsoft_security_compliance_admin_signal.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…cess_microsoft_purview_security_compliance_signal.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…/collection_microsoft_purview_insider_risk_signal.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…k/initial_access_microsoft_defender_alerts_signal.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…ess_microsoft_defender_threat_intelligence_signal.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…nitial_access_microsoft_quarantine_hygiene_signal.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…ge_escalation_endgame_process_injection_prevented.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…ge_escalation_endgame_cred_manipulation_prevented.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGHrules/promotions/endgame_ransomware_detected.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…es/promotions/endgame_adversary_behavior_detected.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGHrules/promotions/endgame_malware_detected.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…es/promotions/execution_endgame_exploit_prevented.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGHrules/promotions/endgame_malware_prevented.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…ege_escalation_endgame_permission_theft_prevented.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…lege_escalation_endgame_permission_theft_detected.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…ege_escalation_endgame_process_injection_detected.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…ege_escalation_endgame_cred_manipulation_detected.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGHrules/promotions/endgame_ransomware_prevented.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…s/credential_access_endgame_cred_dumping_detected.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…/credential_access_endgame_cred_dumping_prevented.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…les/promotions/execution_endgame_exploit_detected.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGHrules/promotions/external_alerts.toml0## setup ### additional notes for information on troubleshooting the maximum alerts warning please refer to this [guide]STRING
HIGH…k/command_and_control_certutil_network_connection.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…persistence_ml_windows_anomalous_process_creation.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…es/ml/persistence_ml_rare_process_by_host_windows.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…les/windows/defense_evasion_masquerading_werfault.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…startup_folder_file_written_by_suspicious_process.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…ege_escalation_service_control_spawned_script_int.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGHrules/windows/execution_via_compiled_html_file.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…/windows/defense_evasion_execution_lolbas_wuauclt.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…ilege_escalation_unusual_parentchild_relationship.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…nd_and_control_remote_file_copy_desktopimgdownldr.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…egister_server_program_connecting_to_the_internet.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…defense_evasion_execution_msbuild_started_renamed.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGHrules/windows/lateral_movement_remote_services.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…ows/defense_evasion_suspicious_zoom_child_process.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…es/windows/persistence_system_shells_via_services.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGHrules/windows/execution_from_unusual_path_cmdline.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGHrules/windows/command_and_control_certreq_postdata.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…es/windows/command_and_control_common_webservices.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…teral_movement_execution_via_file_shares_sequence.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…ows/defense_evasion_suspicious_short_program_name.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…se_evasion_network_connection_from_windows_binary.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…es/windows/defense_evasion_from_unusual_directory.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…s_persistence_network_logon_provider_modification.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…s/credential_access_kerberoasting_unusual_process.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…ding_the_hidden_file_attribute_with_via_attribexe.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGHrules/windows/persistence_time_provider_mod.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…elp_executable_program_connecting_to_the_internet.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…dows/defense_evasion_suspicious_certutil_commands.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…indows/discovery_privileged_localgroup_membership.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…ows/credential_access_lsass_memdump_handle_access.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGHrules/windows/persistence_startup_folder_scripts.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…eforce_multiple_logon_failure_followed_by_success.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…windows/command_and_control_ingress_transfer_bits.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGH…indows/credential_access_bruteforce_admin_account.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
HIGHrules/windows/persistence_adobe_hijack_persistence.toml0select description, display_name, name, path, pid, service_type, start_type, status, user_account from services where noSTRING
1500 more matches not shown…
Hyper-Verbose Identifiers255 hits · 242 pts
SeverityFileLineSnippetContext
LOWdetection_rules/misc.py198def load_current_package_version() -> str:CODE
LOWdetection_rules/misc.py291def get_default_elasticsearch_client() -> Elasticsearch:CODE
LOWdetection_rules/misc.py318def get_default_kibana_client() -> Kibana:CODE
LOWdetection_rules/mixins.py42def get_dataclass_required_fields(cls: Any) -> list[str]:CODE
LOWdetection_rules/mixins.py250 def validate_field_compatibility(self, data: dict[str, Any], **_: dict[str, Any]) -> None:CODE
LOWdetection_rules/exception.py277def parse_exceptions_results_from_api(CODE
LOWdetection_rules/action_connector.py60 def from_action_connector_dict(CODE
LOWdetection_rules/action_connector.py126def parse_action_connector_results_from_api(CODE
LOWdetection_rules/action_connector.py141def build_action_connector_objects( # noqa: PLR0913CODE
LOWdetection_rules/index_mappings.py41def delete_nested_key_from_dict(d: dict[str, Any], compound_key: str) -> None:CODE
LOWdetection_rules/index_mappings.py52def flat_schema_to_index_mapping(flat_schema: dict[str, str]) -> dict[str, Any]:CODE
LOWdetection_rules/index_mappings.py101def create_index_with_index_mapping(CODE
LOWdetection_rules/index_mappings.py149def get_simulated_index_template_mappings(elastic_client: Elasticsearch, name: str) -> dict[str, Any]:CODE
LOWdetection_rules/index_mappings.py162def prune_mappings_of_unsupported_types(CODE
LOWdetection_rules/index_mappings.py193def prepare_integration_mappings( # noqa: PLR0913CODE
LOWdetection_rules/index_mappings.py240def get_index_to_package_lookup(indices: list[str], index_lookup: dict[str, Any]) -> dict[str, Any]:CODE
LOWdetection_rules/index_mappings.py257def get_filtered_index_schema( # noqa: PLR0913CODE
LOWdetection_rules/index_mappings.py356def execute_query_against_indices(CODE
LOWdetection_rules/index_mappings.py414def find_flattened_fields_with_subfields(mapping: dict[str, Any], path: str = "") -> list[str]:CODE
LOWdetection_rules/config.py368def load_current_package_version() -> str:CODE
LOWdetection_rules/esql.py23def get_esql_query_event_dataset_integrations(query: str) -> list[EventDataset]:CODE
LOWdetection_rules/rule_loader.py142def update_metadata_from_file(rule_path: Path, fields_to_update: dict[str, Any]) -> dict[str, Any]:CODE
LOWdetection_rules/docs.py731def convert_markdown_to_asciidoc(text: str) -> str:CODE
LOWdetection_rules/docs.py922 def generate_current_rule_summary(self) -> None:CODE
LOWdetection_rules/docs.py1030 def generate_downloadable_updates_summary(self) -> None:STRING
LOWdetection_rules/remote_validation.py262 def validate_machine_learning(_: Any, __: TOMLRuleContents) -> dict[str, str]:CODE
LOWdetection_rules/eswrap.py47def parse_unique_field_results(CODE
LOWdetection_rules/rule_validators.py132def custom_base_parse_decorator(func: Callable[..., Any]) -> Callable[..., Any]:CODE
LOWdetection_rules/rule_validators.py173 def _prepare_integration_schema(CODE
LOWdetection_rules/rule_validators.py309 def validate_query_text_with_schema(CODE
LOWdetection_rules/rule_validators.py389 def _build_synthetic_sequence_from_subquery(self, subquery: "ast.SubqueryBy") -> str:CODE
LOWdetection_rules/rule_validators.py416 def add_accumulated_integration_targets(query_text: str, packaged: list[dict[str, Any]], context: str) -> None:CODE
LOWdetection_rules/rule_validators.py647 def validate_query_text_with_schema( # noqa: PLR0913CODE
LOWdetection_rules/rule_validators.py710 def validate_rule_type_configurations(self, data: EQLRuleData, meta: RuleMeta) -> tuple[list[str], bool]:CODE
LOWdetection_rules/rule_validators.py787 def validate_columns_index_mapping(CODE
LOWdetection_rules/rule_validators.py868 def remote_validate_rule_contents(CODE
LOWdetection_rules/custom_schemas.py89def update_auto_generated_schema(index: str, field: str, field_type: str | None = None) -> None:CODE
LOWdetection_rules/attack.py216def build_redirected_techniques_map(threads: int = 50) -> dict[str, Any]:CODE
LOWdetection_rules/attack.py235def refresh_redirected_techniques_map(threads: int = 50) -> None:CODE
LOWdetection_rules/ml.py176 def get_all_existing_model_files(self) -> list[dict[str, Any]]:CODE
LOWdetection_rules/ml.py228 def remove_ml_scripts_pipelines(cls, es_client: Elasticsearch, ml_type: list[str]) -> dict[str, Any]:CODE
LOWdetection_rules/ml.py272def get_ml_model_manifests_by_model_id(repo_name: str = "elastic/detection-rules") -> dict[str, ReleaseManifest]:CODE
LOWdetection_rules/beats.py23def _decompress_and_save_schema(url: str, release_name: str) -> None:CODE
LOWdetection_rules/beats.py90def download_latest_beats_schema() -> None:CODE
LOWdetection_rules/devtools.py413 def save_double_bumps_to_file(double_bumps: list[tuple[str, str, int, int]], save_path: Path) -> None:CODE
LOWdetection_rules/devtools.py1592def build_integration_manifests(overwrite: bool, integration: str, prerelease: bool = False) -> None:CODE
LOWdetection_rules/devtools.py1614def build_integration_schemas(overwrite: bool, integration: str) -> None:CODE
LOWdetection_rules/devtools.py1630def show_latest_compatible_version(package: str, stack_version: str) -> None:CODE
LOWdetection_rules/rule.py135 def get_validation_stack_versions(self) -> dict[str, dict[str, Any]]:CODE
LOWdetection_rules/rule.py177 def render_investigate_osquery_to_string(self) -> dict[definitions.TransformTypes, list[str]]:CODE
LOWdetection_rules/rule.py803 def validates_index_and_data_view_id(self, data: dict[str, Any], **_: Any) -> None:CODE
LOWdetection_rules/rule.py809 def validates_query_or_filters(self, data: dict[str, Any], **_: Any) -> None:CODE
LOWdetection_rules/rule.py1283 def convert_supported_version(cls, stack_version: str | None) -> Version:CODE
LOWdetection_rules/rule.py1452 def _convert_add_related_integrations(self, obj: dict[str, Any]) -> None:CODE
LOWdetection_rules/rule.py1507 def _convert_add_required_fields(self, obj: dict[str, Any]) -> None:CODE
LOWdetection_rules/rule.py1552 def _convert_get_setup_content(self, note_tree: list[Any]) -> str:CODE
LOWdetection_rules/rule.py1575 def check_explicit_restricted_field_version(self, field_name: str) -> bool:CODE
LOWdetection_rules/rule.py1582 def check_restricted_field_version(self, field_name: str) -> bool:CODE
LOWdetection_rules/rule.py1599 def get_packaged_integrations(CODE
LOWdetection_rules/rule.py1635 def post_conversion_validation(self, value: dict[str, Any], **_: Any) -> None:CODE
195 more matches not shown…
Deep Nesting78 hits · 69 pts
SeverityFileLineSnippetContext
LOWdetection_rules/misc.py351CODE
LOWdetection_rules/misc.py354CODE
LOWdetection_rules/misc.py370CODE
LOWdetection_rules/cli_utils.py33CODE
LOWdetection_rules/cli_utils.py237CODE
LOWdetection_rules/exception.py277CODE
LOWdetection_rules/exception.py309CODE
LOWdetection_rules/kbwrap.py273CODE
LOWdetection_rules/kbwrap.py556CODE
LOWdetection_rules/action_connector.py141CODE
LOWdetection_rules/index_mappings.py390CODE
LOWdetection_rules/config.py235CODE
LOWdetection_rules/config.py147CODE
LOWdetection_rules/esql.py23CODE
LOWdetection_rules/docs.py63CODE
LOWdetection_rules/docs.py882CODE
LOWdetection_rules/eswrap.py47CODE
LOWdetection_rules/eswrap.py184CODE
LOWdetection_rules/eswrap.py251CODE
LOWdetection_rules/rule_validators.py94CODE
LOWdetection_rules/rule_validators.py396CODE
LOWdetection_rules/rule_validators.py647CODE
LOWdetection_rules/rule_validators.py416CODE
LOWdetection_rules/version_lock.py192CODE
LOWdetection_rules/custom_schemas.py23CODE
LOWdetection_rules/ml.py272CODE
LOWdetection_rules/ml.py228CODE
LOWdetection_rules/beats.py23CODE
LOWdetection_rules/beats.py104CODE
LOWdetection_rules/beats.py261CODE
LOWdetection_rules/navigator.py214CODE
LOWdetection_rules/devtools.py503CODE
LOWdetection_rules/devtools.py1137CODE
LOWdetection_rules/devtools.py1424CODE
LOWdetection_rules/devtools.py1749CODE
LOWdetection_rules/rule.py603CODE
LOWdetection_rules/rule.py657CODE
LOWdetection_rules/rule.py995CODE
LOWdetection_rules/rule.py1415CODE
LOWdetection_rules/rule.py1452CODE
LOWdetection_rules/rule.py1552CODE
LOWdetection_rules/rule.py1599CODE
LOWdetection_rules/utils.py73CODE
LOWdetection_rules/rule_formatter.py60CODE
LOWdetection_rules/rule_formatter.py109CODE
LOWdetection_rules/rule_formatter.py221CODE
LOWdetection_rules/rule_formatter.py112CODE
LOWdetection_rules/rule_formatter.py242CODE
LOWdetection_rules/generic_loader.py139CODE
LOWdetection_rules/main.py186CODE
LOWdetection_rules/main.py522CODE
LOWdetection_rules/main.py576CODE
LOWdetection_rules/integrations.py114CODE
LOWdetection_rules/integrations.py186CODE
LOWdetection_rules/ecs.py157CODE
LOWdetection_rules/ecs.py280CODE
LOWtests/test_specific_rules.py88CODE
LOWtests/test_all_rules.py208CODE
LOWtests/test_all_rules.py326CODE
LOWtests/test_all_rules.py405CODE
18 more matches not shown…
Redundant / Tautological Comments22 hits · 36 pts
SeverityFileLineSnippetContext
LOWdetection_rules/cli_utils.py220 # Check if flag or config is set to not include tactic in the filenameCOMMENT
LOWdetection_rules/exception.py232 # Check if self.path has a .toml extensionCOMMENT
LOWdetection_rules/kbwrap.py356 # Assign counts to variablesCOMMENT
LOWdetection_rules/kbwrap.py390 # Check if flag or config is set to not include tactic in the filenameCOMMENT
LOWdetection_rules/kbwrap.py392 # Check if the flag is set to not include tactic in the filenameCOMMENT
LOWdetection_rules/action_connector.py104 # Check if self.path has a .toml extensionCOMMENT
LOWdetection_rules/index_mappings.py398 # Check if the field has a `fields` keyCOMMENT
LOWdetection_rules/index_mappings.py400 # Check if any subfield in `fields` also has a `fields` keyCOMMENT
LOWdetection_rules/index_mappings.py422 # Check if the field is of type 'flattened' and has a 'fields' keyCOMMENT
LOWdetection_rules/index_mappings.py425 # Check if the field is of type 'flattened' and has a 'properties' keyCOMMENT
LOWdetection_rules/config.py329 # Check if the file existsCOMMENT
LOWdetection_rules/rule_validators.py806 # Check if the column exists in combined_mappings or a valid field generated from a function or operatorCOMMENT
LOWdetection_rules/utils.py76 # Check if the string looks like a JSON listCOMMENT
LOWdetection_rules/integrations.py117 # Check if the file already exists and handle accordinglyCOMMENT
LOWdetection_rules/integrations.py156 # Check if the file is a matchCOMMENT
LOWtests/test_all_rules.py1445 # Check if note field contains ## Triage and analysisCOMMENT
LOWtests/test_all_rules.py1458 # Check if `### Investigating` is present and if so, check if it is followed by the rule name.COMMENT
LOWtests/test_all_rules.py1415 # Check if the risk_score falls within the range for the severity levelCOMMENT
LOWhunting/definitions.py59 # Check if either "stats by" or "| keep" exists in the queryCOMMENT
LOWhunting/utils.py115 # Check if the folder_name exists and if it's a list, convert it to a dictionaryCOMMENT
LOWhunting/__main__.py99 # Output results using tabulateCOMMENT
LOW.github/workflows/esql-validation.yml25 # Check if the event is a pushCOMMENT
Excessive Try-Catch Wrapping28 hits · 34 pts
SeverityFileLineSnippetContext
LOWdetection_rules/cli_utils.py394 except Exception as e:CODE
LOWdetection_rules/exception.py348 except Exception as e:CODE
LOWdetection_rules/kbwrap.py414 except Exception as e:CODE
LOWdetection_rules/kbwrap.py489 except Exception as e:CODE
LOWdetection_rules/kbwrap.py509 except Exception as e:CODE
LOWdetection_rules/kbwrap.py525 except Exception as e:CODE
LOWdetection_rules/action_connector.py183 except Exception as e:CODE
LOWdetection_rules/rule_loader.py352 except Exception:CODE
MEDIUMdetection_rules/rule_loader.py353 print(f"Error loading rule in {path}")CODE
LOWdetection_rules/rule_loader.py550 except Exception:CODE
MEDIUMdetection_rules/rule_loader.py551 print(f"Error loading rule in {path}")CODE
LOWdetection_rules/rule_loader.py735 except Exception as e: # noqa: BLE001CODE
LOWdetection_rules/remote_validation.py194 except Exception as exc:CODE
LOWdetection_rules/remote_validation.py211 except Exception as exc:CODE
LOWdetection_rules/remote_validation.py234 except Exception as exc:CODE
LOWdetection_rules/rule_validators.py705 except Exception as exc: # noqa: BLE001CODE
MEDIUMdetection_rules/beats.py53 print(f"Error loading {name}, not a valid YAML")CODE
LOWdetection_rules/devtools.py1636 except Exception as e: # noqa: BLE001CODE
LOWdetection_rules/devtools.py1645 except Exception as e: # noqa: BLE001CODE
LOWdetection_rules/rule.py572 except Exception as e:CODE
LOWdetection_rules/rule.py583 except Exception as e:CODE
LOWdetection_rules/rule.py630 except Exception as e:CODE
LOWdetection_rules/generic_loader.py174 except Exception:CODE
MEDIUMdetection_rules/generic_loader.py175 print(f"Error loading item in {path}")CODE
LOWtests/test_all_rules.py1642 except Exception: # noqa: BLE001, S112CODE
LOWtests/base.py61 except Exception as e: # noqa: BLE001CODE
LOWhunting/run.py54 except Exception as e: # noqa: BLE001CODE
LOWlib/kibana/kibana/resources.py220 except Exception:CODE
Modern AI Meta-Vocabulary20 hits · 31 pts
SeverityFileLineSnippetContext
MEDIUM…nse_evasion_bedrock_guardrail_deleted_or_weakened.toml69 "https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html"STRING
MEDIUM…drock_knowledge_base_or_rag_data_source_poisoning.toml34### Investigating AWS Bedrock Knowledge Base or RAG Data Source TamperingCOMMENT
MEDIUM…ck_multiple_attempts_to_use_denied_models_by_user.toml53 "https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-components.html",STRING
MEDIUM…ck_multiple_attempts_to_use_denied_models_by_user.toml64https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.htmlCODE
MEDIUM…_guardrails_multiple_violations_in_single_request.toml57 "https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-components.html",STRING
MEDIUM…_guardrails_multiple_violations_in_single_request.toml68https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.htmlCODE
MEDIUM…_bedrock/aws_bedrock_execution_without_guardrails.toml56 "https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-components.html",STRING
MEDIUM…_bedrock/aws_bedrock_execution_without_guardrails.toml67https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.htmlCODE
MEDIUM…_bedrock/aws_bedrock_execution_without_guardrails.toml88// Filter for invocations without guardrailsSTRING
MEDIUM…k/aws_bedrock_high_resource_consumption_detection.toml66https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.htmlCODE
MEDIUM…edrock_high_confidence_misconduct_blocks_detected.toml56 "https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-components.html",STRING
MEDIUM…edrock_high_confidence_misconduct_blocks_detected.toml67https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.htmlCODE
MEDIUM…iple_sensitive_information_policy_blocks_detected.toml55 "https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-components.html",STRING
MEDIUM…iple_sensitive_information_policy_blocks_detected.toml66https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.htmlCODE
MEDIUM…aws_bedrock_multiple_topic_policy_blocks_detected.toml55 "https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-components.html",STRING
MEDIUM…aws_bedrock_multiple_topic_policy_blocks_detected.toml66https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.htmlCODE
MEDIUM…ock_guardrails_multiple_violations_by_single_user.toml57 "https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-components.html",STRING
MEDIUM…ock_guardrails_multiple_violations_by_single_user.toml68https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.htmlCODE
MEDIUM…/aws_bedrock_multiple_word_policy_blocks_detected.toml55 "https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-components.html",STRING
MEDIUM…/aws_bedrock_multiple_word_policy_blocks_detected.toml66https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.htmlCODE
Unused Imports25 hits · 24 pts
SeverityFileLineSnippetContext
LOWdetection_rules/kbwrap.py31CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/__init__.py8CODE
LOWdetection_rules/rule.py58CODE
LOWdetection_rules/schemas/__init__.py18CODE
LOWlib/kibana/kibana/__init__.py8CODE
LOWlib/kibana/kibana/__init__.py9CODE
LOWlib/kibana/kibana/__init__.py9CODE
LOWlib/kql/kql/__init__.py11CODE
LOWlib/kql/kql/__init__.py11CODE
LOWlib/kql/kql/parser.py18CODE
LOWlib/kql/kql/evaluator.py10CODE
Over-Commented Block18 hits · 18 pts
SeverityFileLineSnippetContext
LOW.pre-commit-config.yaml21 # language: systemCOMMENT
LOWdetection_rules/etc/_config.yaml21 # exception_dir: exceptionsCOMMENT
LOWdetection_rules/etc/_config.yaml41## ├── exception_1.tomlCOMMENT
LOWdetection_rules/etc/_config.yaml61# stack-schema-map.yaml file when using a custom rules directory and config.COMMENT
LOWdetection_rules/etc/_config.yaml81# going to the environment variable if both are set. Having both these options allows for configuring testing onCOMMENT
LOWdetection_rules/etc/__init__.py1# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under oneCOMMENT
LOWdetection_rules/etc/stack-schema-map.yaml1# Purpose: Alignment of stack with beats and ecs versionsCOMMENT
LOWdetection_rules/etc/stack-schema-map.yaml21COMMENT
LOWdetection_rules/etc/stack-schema-map.yaml41# "8.2.0":COMMENT
LOWdetection_rules/etc/stack-schema-map.yaml61# beats: "8.6.1"COMMENT
LOWdetection_rules/etc/stack-schema-map.yaml81# beats: "8.10.3"COMMENT
LOWdetection_rules/etc/stack-schema-map.yaml101# beats: "8.14.3"COMMENT
LOWdetection_rules/etc/stack-schema-map.yaml121# beats: "8.18.0"COMMENT
LOWdetection_rules/etc/example_test_config.yaml1COMMENT
LOWtests/kuery/__init__.py1# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under oneCOMMENT
LOWtests/data/__init__.py1# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under oneCOMMENT
LOWhunting/__init__.py1# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under oneCOMMENT
LOW.github/stale.yml41closeComment: >COMMENT
Modern Structural Boilerplate14 hits · 17 pts
SeverityFileLineSnippetContext
LOWdetection_rules/custom_schemas.py89def update_auto_generated_schema(index: str, field: str, field_type: str | None = None) -> None:CODE
LOWdetection_rules/attack.py185def update_threat_map(rule_threat_map: list[dict[str, Any]]) -> None:CODE
LOWdetection_rules/navigator.py171 def _update_all(self, rule: TOMLRule, tactic: str, technique_id: str) -> None:CODE
LOWdetection_rules/navigator.py175 def _update_platforms(self, rule: TOMLRule, tactic: str, technique_id: str) -> None:CODE
LOWdetection_rules/navigator.py181 def _update_indexes(self, rule: TOMLRule, tactic: str, technique_id: str) -> None:CODE
LOWdetection_rules/navigator.py186 def _update_tags(self, rule: TOMLRule, tactic: str, technique_id: str) -> None:CODE
LOWdetection_rules/devtools.py1656def update_rule_data_schemas() -> None:CODE
LOWdetection_rules/rule.py1374 def set_version_lock(self, value: VersionLock) -> None:CODE
LOWdetection_rules/rule.py1802 def set_version_lock(self, value: VersionLock | None) -> None:CODE
LOWdetection_rules/utils.py168def set_all_validation_bypass(env_value: bool = False) -> None:CODE
LOWdetection_rules/utils.py174def set_nested_value(obj: dict[str, Any], compound_key: str, value: Any) -> None:CODE
LOWhunting/utils.py95def update_index_yml(base_path: Path) -> None:CODE
LOWhunting/markdown.py92 def update_or_add_entry(self, hunt_config: Hunt, toml_path: Path) -> None:CODE
LOWhunting/markdown.py130 def update_index_md(self) -> None:CODE
Self-Referential Comments6 hits · 17 pts
SeverityFileLineSnippetContext
MEDIUMdetection_rules/devtools.py769 # Create a pull request (not done yet, but we need the PR number)COMMENT
MEDIUMdetection_rules/custom_rules.py139 # Create the stack-schema-map.yaml fileCOMMENT
MEDIUMhunting/definitions.py10# Define the hunting directory pathCOMMENT
MEDIUMhunting/__main__.py78 # Create an instance of the QueryIndex classCOMMENT
MEDIUMhunting/__main__.py225 # Create a QueryRunner instanceCOMMENT
MEDIUM.github/workflows/kibana-mitre-update.yml18 KIBANA_ISSUE_NUMBER: 166152 # Define the Kibana issue number as a variableCODE
Cross-Language Confusion4 hits · 15 pts
SeverityFileLineSnippetContext
HIGHdetection_rules/kbwrap.py132 action_connector_type_error = "expected value of type [string] but got [undefined]"CODE
HIGHtests/test_python_library.py295 [any where azure.identityprotection.properties.user_principal_name != null] by azure.identityprotection.properCODE
HIGHtests/test_transform_fields.py27 """!{osquery{"label":"Osquery - Retrieve Services Running on User Accounts","query":"SELECT description, disSTRING
HIGHtests/test_transform_fields.py107 query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM STRING
Verbosity Indicators8 hits · 15 pts
SeverityFileLineSnippetContext
LOWhunting/search.py58 # Step 1: If data source is provided, filter by data source firstCOMMENT
LOWhunting/search.py67 # Step 2: If MITRE filter is provided, process the filterCOMMENT
LOWhunting/search.py80 # Step 3: If keyword is provided, search for it in name, description, and notesCOMMENT
LOWhunting/search.py145 # Step 1: Check files first by their 'integration' fieldCOMMENT
LOWhunting/search.py157 # Step 2: Check the index for generic data sources (e.g., 'aws', 'linux')COMMENT
LOW…uditd_sensitive_cloud_and_host_identity_file_open.toml76### Step 1: Add Auditd Manager in FleetCOMMENT
LOW…uditd_sensitive_cloud_and_host_identity_file_open.toml84### Step 2: Paste audit rules into Auditd ManagerCOMMENT
LOW…uditd_sensitive_cloud_and_host_identity_file_open.toml125### Step 3: Reload and verifyCOMMENT
Structural Annotation Overuse8 hits · 15 pts
SeverityFileLineSnippetContext
LOWhunting/search.py58 # Step 1: If data source is provided, filter by data source firstCOMMENT
LOWhunting/search.py67 # Step 2: If MITRE filter is provided, process the filterCOMMENT
LOWhunting/search.py80 # Step 3: If keyword is provided, search for it in name, description, and notesCOMMENT
LOWhunting/search.py145 # Step 1: Check files first by their 'integration' fieldCOMMENT
LOWhunting/search.py157 # Step 2: Check the index for generic data sources (e.g., 'aws', 'linux')COMMENT
LOW…uditd_sensitive_cloud_and_host_identity_file_open.toml76### Step 1: Add Auditd Manager in FleetCOMMENT
LOW…uditd_sensitive_cloud_and_host_identity_file_open.toml84### Step 2: Paste audit rules into Auditd ManagerCOMMENT
LOW…uditd_sensitive_cloud_and_host_identity_file_open.toml125### Step 3: Reload and verifyCOMMENT
AI Slop Vocabulary4 hits · 8 pts
SeverityFileLineSnippetContext
LOWdetection_rules/rule_loader.py340 # if it already loaded the rule, then we can just use it from thatCOMMENT
LOWdetection_rules/rule_loader.py537 # if it already loaded the rule, then we can just use it from thatCOMMENT
LOWdetection_rules/generic_loader.py166 # if it already loaded the item, then we can just use it from thatCOMMENT
MEDIUMtests/test_all_rules.py1239 # skip rules that do not leverage queries (i.e. machine learning)COMMENT
AI Structural Patterns3 hits · 3 pts
SeverityFileLineSnippetContext
LOWdetection_rules/cli_utils.py237CODE
LOWdetection_rules/kbwrap.py273CODE
LOWtests/test_python_library.py28CODE
Slop Phrases2 hits · 3 pts
SeverityFileLineSnippetContext
MEDIUM…s/aws_bedrock_sensitive_content_refusal_detection.toml14 gen_ai.completion LIKE "*I cannot provide any information about*"STRING
MEDIUM…e_administrator_privileges_assigned_to_okta_group.toml47- Training or onboarding sessions where temporary admin access is granted to groups for demonstration purposes can causeCODE