Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Add Alert Suppression for Addtional Rule Types #3986

Merged
merged 7 commits into from
Aug 15, 2024

Conversation

Mikaayenson
Copy link
Contributor

@Mikaayenson Mikaayenson commented Aug 14, 2024

Pull Request

Issue link(s): #3640

Summary - What I changed

Adds Alert Suppression support to our schemas for different rule types based on the Kibana Schemas.

PR Checklist

  • Link to the relevant Kibana PR or issue provided
  • Exported detection rule(s) from Kibana to showcase the feature(s)
  • Converted the exported ndjson file(s) to toml in the detection-rules repo
  • Re-exported the toml rule(s) to ndjson and re-imported into Kibana
  • Updated necessary unit tests to accommodate the feature
  • Applied min_compat restrictions to limit the feature to a specified minimum stack version
  • Executed all unit tests locally with a test toml rule to confirm passing
  • Included Kibana PR implementer as an optional reviewer for insights on the feature
  • Implemented requisite downgrade functionality
  • Cross-referenced the feature with product documentation for consistency
  • Incorporated a comprehensive test rule in unit tests for full schema coverage (no new base schemas were introduced)
  • Conducted system testing, including fleet, import, and create APIs

How To Test

Make Tests

Importing / Exporting Test Files

  1. Delete .txt extension:

rules_export_supression.ndjson.txt

  1. Try to import it into our repo:
(detection-rules-build) ➜  detection-rules git:(3640-fr-new-terms-suppression-schema-updates) ✗ python -m detection_rules import-rules-to-repo ~/Downloads/rules_export_supression.ndjson --required-only
Loaded config file: /Users/stryker/workspace/ElasticGitHub/detection-rules/.detection-rules-cfg.json

█▀▀▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄   ▄      █▀▀▄ ▄  ▄ ▄   ▄▄▄ ▄▄▄
█  █ █▄▄  █  █▄▄ █    █   █  █ █ █▀▄ █      █▄▄▀ █  █ █   █▄▄ █▄▄
█▄▄▀ █▄▄  █  █▄▄ █▄▄  █  ▄█▄ █▄█ █ ▀▄█      █ ▀▄ █▄▄█ █▄▄ █▄▄ ▄▄█

[+] Building rule for /Users/stryker/workspace/ElasticGitHub/detection-rules/rules/test_new_terms_suppress_rule.toml
[+] Building rule for /Users/stryker/workspace/ElasticGitHub/detection-rules/rules/test_esql_suppress_rule.toml
[+] Building rule for /Users/stryker/workspace/ElasticGitHub/detection-rules/rules/test_eql_suppress_rule.toml
[+] Building rule for /Users/stryker/workspace/ElasticGitHub/detection-rules/rules/test_ml_suppress_rule_per_execution.toml
[+] Building rule for /Users/stryker/workspace/ElasticGitHub/detection-rules/rules/test_threat_indicator_match_suppress_rule.toml
[+] Building rule for /Users/stryker/workspace/ElasticGitHub/detection-rules/rules/test_ml_suppress_rule.toml
6 results exported
6 rules converted
0 exceptions exported
0 actions connectors exported
(detection-rules-build) ➜  detectio
(detection-rules-build) ➜  detection-rules git:(3640-fr-new-terms-suppression-schema-updates) ✗ python -m detection_rules kibana --space "main" export-rules -s -d custom_rules   
Loaded config file: /Users/stryker/workspace/ElasticGitHub/detection-rules/.detection-rules-cfg.json

█▀▀▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄   ▄      █▀▀▄ ▄  ▄ ▄   ▄▄▄ ▄▄▄
█  █ █▄▄  █  █▄▄ █    █   █  █ █ █▀▄ █      █▄▄▀ █  █ █   █▄▄ █▄▄
█▄▄▀ █▄▄  █  █▄▄ █▄▄  █  ▄█▄ █▄█ █ ▀▄█      █ ▀▄ █▄▄█ █▄▄ █▄▄ ▄▄█

- skipping Test ESQL Suppress Rule - ValidationError
- skipping Test New Terms Suppress Rule - ValidationError
- skipping Test Threat Indicator Match Suppress Rule - ValidationError
- skipping Test EQL Suppress Rule - ValidationError
- skipping Test ML Suppress Rule Per Execution - ValidationError
- skipping Test ML Suppress Rule - ValidationError
6 results exported
0 rules converted
0 exceptions exported
0 action connectors exported
0 rules saved to custom_rules
0 exception lists saved to None
0 action connectors saved to None
6 errors saved to custom_rules/_errors.txt
(detection-rules-build) ➜  detection-rules git:(3640-fr-new-terms-suppression-schema-updates) ✗ 
(detection-rules-build) ➜  detection-rules git:(3640-fr-new-terms-suppression-schema-updates) ✗ python -m detection_rules kibana --space "main" import-rules -d custom_r
ules -o
Loaded config file: /Users/stryker/workspace/ElasticGitHub/detection-rules/.detection-rules-cfg.json

█▀▀▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄   ▄      █▀▀▄ ▄  ▄ ▄   ▄▄▄ ▄▄▄
█  █ █▄▄  █  █▄▄ █    █   █  █ █ █▀▄ █      █▄▄▀ █  █ █   █▄▄ █▄▄
█▄▄▀ █▄▄  █  █▄▄ █▄▄  █  ▄█▄ █▄█ █ ▀▄█      █ ▀▄ █▄▄█ █▄▄ █▄▄ ▄▄█

5 rule(s) successfully imported
 - 3ea1fa0a-0a25-4043-b23e-450e1e9c5730
 - 749ac911-16fd-406c-b1d1-d16b69322cbb
 - 804d56c3-18bd-4e92-81f4-0c4f08af6e24
 - c5904049-0d3a-4416-ad23-e1cceaf9f9f2
 - fbdbcb5f-1e75-4931-92b2-aedc830c9b8e
(detection-rules-build) ➜  detection-rules git:(3640-fr-new-terms-suppression-schema-updates) ✗ python -m detection_rules export-rules-from-repo -d custom_rules
Loaded config file: /Users/stryker/workspace/ElasticGitHub/detection-rules/.detection-rules-cfg.json

█▀▀▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄   ▄      █▀▀▄ ▄  ▄ ▄   ▄▄▄ ▄▄▄
█  █ █▄▄  █  █▄▄ █    █   █  █ █ █▀▄ █      █▄▄▀ █  █ █   █▄▄ █▄▄
█▄▄▀ █▄▄  █  █▄▄ █▄▄  █  ▄█▄ █▄█ █ ▀▄█      █ ▀▄ █▄▄█ █▄▄ █▄▄ ▄▄█

Exported 5 rules into /Users/stryker/workspace/ElasticGitHub/detection-rules/exports/20240815T084001L.ndjson

Unit Tests

Have to test locally since we dont have rules with this feature in our repo yet.

(detection-rules-build) ➜  detection-rules git:(3640-fr-new-terms-suppression-schema-updates) ✗ python -m detection_rules test
Loaded config file: /Users/stryker/workspace/ElasticGitHub/detection-rules/.detection-rules-cfg.json

█▀▀▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄   ▄      █▀▀▄ ▄  ▄ ▄   ▄▄▄ ▄▄▄
█  █ █▄▄  █  █▄▄ █    █   █  █ █ █▀▄ █      █▄▄▀ █  █ █   █▄▄ █▄▄
█▄▄▀ █▄▄  █  █▄▄ █▄▄  █  ▄█▄ █▄█ █ ▀▄█      █ ▀▄ █▄▄█ █▄▄ █▄▄ ▄▄█

========================================================================= test session starts ==========================================================================
platform darwin -- Python 3.12.2, pytest-8.2.0, pluggy-1.5.0 -- /Users/stryker/workspace/ElasticGitHub/detection-rules/env/detection-rules-build/bin/python
cachedir: .pytest_cache
rootdir: /Users/stryker/workspace/ElasticGitHub/detection-rules
configfile: pyproject.toml
plugins: typeguard-3.0.2
collected 150 items                                                                                                                                                    

tests/kuery/test_dsl.py::TestKQLtoDSL::test_and_query PASSED                                                                                                     [  0%]
tests/kuery/test_dsl.py::TestKQLtoDSL::test_field_exists PASSED                                                                                                  [  1%]
tests/kuery/test_dsl.py::TestKQLtoDSL::test_field_inequality PASSED                                                                                              [  2%]
tests/kuery/test_dsl.py::TestKQLtoDSL::test_field_match PASSED                                                                                                   [  2%]
tests/kuery/test_dsl.py::TestKQLtoDSL::test_not_query PASSED                                                                                                     [  3%]
tests/kuery/test_dsl.py::TestKQLtoDSL::test_optimizations PASSED                                                                                                 [  4%]
tests/kuery/test_dsl.py::TestKQLtoDSL::test_or_query PASSED                                                                                                      [  4%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_and_query PASSED                                                                                                  [  5%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_boolean_precedence PASSED                                                                                         [  6%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_field_equals PASSED                                                                                               [  6%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_field_inequality PASSED                                                                                           [  7%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_ip_checks PASSED                                                                                                  [  8%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_list_of_values PASSED                                                                                             [  8%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_not_query PASSED                                                                                                  [  9%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_or_query PASSED                                                                                                   [ 10%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_wildcard_field PASSED                                                                                             [ 10%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_and_expr PASSED                                                                                              [ 11%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_and_values PASSED                                                                                            [ 12%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_cidr_match PASSED                                                                                            [ 12%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_field_exists PASSED                                                                                          [ 13%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_flattening PASSED                                                                                            [ 14%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_list_value PASSED                                                                                            [ 14%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_not_value PASSED                                                                                             [ 15%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_or_expr PASSED                                                                                               [ 16%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_or_values PASSED                                                                                             [ 16%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_quoted_wildcard PASSED                                                                                       [ 17%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_range PASSED                                                                                                 [ 18%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_single_value PASSED                                                                                          [ 18%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_wildcard PASSED                                                                                              [ 19%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_and_query PASSED                                                                                                  [ 20%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_boolean_precedence PASSED                                                                                         [ 20%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_field_equals PASSED                                                                                               [ 21%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_field_inequality PASSED                                                                                           [ 22%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_list_of_values PASSED                                                                                             [ 22%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_lone_value PASSED                                                                                                 [ 23%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_nested_query PASSED                                                                                               [ 24%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_not_query PASSED                                                                                                  [ 24%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_or_query PASSED                                                                                                   [ 25%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_schema PASSED                                                                                                     [ 26%]
tests/kuery/test_lint.py::LintTests::test_and_not PASSED                                                                                                         [ 26%]
tests/kuery/test_lint.py::LintTests::test_compound PASSED                                                                                                        [ 27%]
tests/kuery/test_lint.py::LintTests::test_double_negate PASSED                                                                                                   [ 28%]
tests/kuery/test_lint.py::LintTests::test_extract_not PASSED                                                                                                     [ 28%]
tests/kuery/test_lint.py::LintTests::test_ip PASSED                                                                                                              [ 29%]
tests/kuery/test_lint.py::LintTests::test_lint_field PASSED                                                                                                      [ 30%]
tests/kuery/test_lint.py::LintTests::test_lint_precedence PASSED                                                                                                 [ 30%]
tests/kuery/test_lint.py::LintTests::test_merge_fields PASSED                                                                                                    [ 31%]
tests/kuery/test_lint.py::LintTests::test_mixed_demorgans PASSED                                                                                                 [ 32%]
tests/kuery/test_lint.py::LintTests::test_not_demorgans PASSED                                                                                                   [ 32%]
tests/kuery/test_lint.py::LintTests::test_not_or PASSED                                                                                                          [ 33%]
tests/kuery/test_lint.py::LintTests::test_upper_tokens PASSED                                                                                                    [ 34%]
tests/kuery/test_parser.py::ParserTests::test_conversion PASSED                                                                                                  [ 34%]
tests/kuery/test_parser.py::ParserTests::test_date PASSED                                                                                                        [ 35%]
tests/kuery/test_parser.py::ParserTests::test_keyword PASSED                                                                                                     [ 36%]
tests/kuery/test_parser.py::ParserTests::test_list_equals PASSED                                                                                                 [ 36%]
tests/kuery/test_parser.py::ParserTests::test_multiple_types_fail PASSED                                                                                         [ 37%]
tests/kuery/test_parser.py::ParserTests::test_multiple_types_success PASSED                                                                                      [ 38%]
tests/kuery/test_parser.py::ParserTests::test_number_exists PASSED                                                                                               [ 38%]
tests/kuery/test_parser.py::ParserTests::test_number_wildcard_fail PASSED                                                                                        [ 39%]
tests/kuery/test_parser.py::ParserTests::test_type_family_fail PASSED                                                                                            [ 40%]
tests/kuery/test_parser.py::ParserTests::test_type_family_success PASSED                                                                                         [ 40%]
tests/test_all_rules.py::TestAlertSuppression::test_eql_non_sequence_support_only PASSED                                                                         [ 41%]
tests/test_all_rules.py::TestAlertSuppression::test_group_field_in_schemas PASSED                                                                                [ 42%]
tests/test_all_rules.py::TestBuildTimeFields::test_build_fields_min_stack PASSED                                                                                 [ 42%]
tests/test_all_rules.py::TestIncompatibleFields::test_rule_backports_for_restricted_fields PASSED                                                                [ 43%]
tests/test_all_rules.py::TestIntegrationRules::test_all_min_stack_rules_have_comment PASSED                                                                      [ 44%]
tests/test_all_rules.py::TestIntegrationRules::test_integration_guide SKIPPED (8.3+ Stacks Have Related Integrations Feature)                                    [ 44%]
tests/test_all_rules.py::TestIntegrationRules::test_ml_integration_jobs_exist PASSED                                                                             [ 45%]
tests/test_all_rules.py::TestIntegrationRules::test_rule_demotions PASSED                                                                                        [ 46%]
tests/test_all_rules.py::TestLicense::test_elastic_license_only_v2 PASSED                                                                                        [ 46%]
tests/test_all_rules.py::TestNoteMarkdownPlugins::test_if_plugins_explicitly_defined PASSED                                                                      [ 47%]
tests/test_all_rules.py::TestNoteMarkdownPlugins::test_note_has_osquery_warning PASSED                                                                           [ 48%]
tests/test_all_rules.py::TestNoteMarkdownPlugins::test_plugin_placeholders_match_entries PASSED                                                                  [ 48%]
tests/test_all_rules.py::TestRiskScoreMismatch::test_rule_risk_score_severity_mismatch PASSED                                                                    [ 49%]
tests/test_all_rules.py::TestRuleFiles::test_bbr_in_correct_dir PASSED                                                                                           [ 50%]
tests/test_all_rules.py::TestRuleFiles::test_non_bbr_in_correct_dir PASSED                                                                                       [ 50%]
tests/test_all_rules.py::TestRuleFiles::test_rule_file_name_tactic PASSED                                                                                        [ 51%]
tests/test_all_rules.py::TestRuleMetadata::test_deprecated_rules PASSED                                                                                          [ 52%]
tests/test_all_rules.py::TestRuleMetadata::test_deprecated_rules_modified PASSED                                                                                 [ 52%]
tests/test_all_rules.py::TestRuleMetadata::test_event_dataset PASSED                                                                                             [ 53%]
tests/test_all_rules.py::TestRuleMetadata::test_integration_tag PASSED                                                                                           [ 54%]
tests/test_all_rules.py::TestRuleMetadata::test_invalid_queries PASSED                                                                                           [ 54%]
tests/test_all_rules.py::TestRuleMetadata::test_rule_change_has_updated_date PASSED                                                                              [ 55%]
tests/test_all_rules.py::TestRuleMetadata::test_updated_date_newer_than_creation PASSED                                                                          [ 56%]
tests/test_all_rules.py::TestRuleTags::test_casing_and_spacing PASSED                                                                                            [ 56%]
tests/test_all_rules.py::TestRuleTags::test_investigation_guide_tag SKIPPED (Skipping until all Investigation Guides follow the proper format.)                  [ 57%]
tests/test_all_rules.py::TestRuleTags::test_ml_rule_type_tags PASSED                                                                                             [ 58%]
tests/test_all_rules.py::TestRuleTags::test_no_duplicate_tags PASSED                                                                                             [ 58%]
tests/test_all_rules.py::TestRuleTags::test_os_tags PASSED                                                                                                       [ 59%]
tests/test_all_rules.py::TestRuleTags::test_primary_tactic_as_tag PASSED                                                                                         [ 60%]
tests/test_all_rules.py::TestRuleTags::test_required_tags PASSED                                                                                                 [ 60%]
tests/test_all_rules.py::TestRuleTags::test_tag_prefix PASSED                                                                                                    [ 61%]
tests/test_all_rules.py::TestRuleTimelines::test_timeline_has_title PASSED                                                                                       [ 62%]
tests/test_all_rules.py::TestRuleTiming::test_eql_interval_to_maxspan PASSED                                                                                     [ 62%]
tests/test_all_rules.py::TestRuleTiming::test_eql_lookback PASSED                                                                                                [ 63%]
tests/test_all_rules.py::TestRuleTiming::test_event_override PASSED                                                                                              [ 64%]
tests/test_all_rules.py::TestRuleTiming::test_required_lookback PASSED                                                                                           [ 64%]
tests/test_all_rules.py::TestThreatMappings::test_duplicated_tactics PASSED                                                                                      [ 65%]
tests/test_all_rules.py::TestThreatMappings::test_tactic_to_technique_correlations PASSED                                                                        [ 66%]
tests/test_all_rules.py::TestThreatMappings::test_technique_deprecations PASSED                                                                                  [ 66%]
tests/test_all_rules.py::TestValidRules::test_all_rule_queries_optimized PASSED                                                                                  [ 67%]
tests/test_all_rules.py::TestValidRules::test_bbr_validation PASSED                                                                                              [ 68%]
tests/test_all_rules.py::TestValidRules::test_duplicate_file_names PASSED                                                                                        [ 68%]
tests/test_all_rules.py::TestValidRules::test_file_names PASSED                                                                                                  [ 69%]
tests/test_all_rules.py::TestValidRules::test_from_filed_value PASSED                                                                                            [ 70%]
tests/test_all_rules.py::TestValidRules::test_index_or_data_view_id_present PASSED                                                                               [ 70%]
tests/test_all_rules.py::TestValidRules::test_max_signals_note PASSED                                                                                            [ 71%]
tests/test_all_rules.py::TestValidRules::test_production_rules_have_rta PASSED                                                                                   [ 72%]
tests/test_all_rules.py::TestValidRules::test_rule_type_changes PASSED                                                                                           [ 72%]
tests/test_all_rules.py::TestValidRules::test_schema_and_dupes PASSED                                                                                            [ 73%]
tests/test_gh_workflows.py::TestWorkflows::test_matrix_to_lock_version_defaults PASSED                                                                           [ 74%]
tests/test_hunt_data.py::TestHunt::test_load_toml_files PASSED                                                                                                   [ 74%]
tests/test_hunt_data.py::TestHunt::test_markdown_existence PASSED                                                                                                [ 75%]
tests/test_hunt_data.py::TestHunt::test_toml_loading PASSED                                                                                                      [ 76%]
tests/test_mappings.py::TestMappings::test_false_positives PASSED                                                                                                [ 76%]
tests/test_mappings.py::TestMappings::test_true_positives PASSED                                                                                                 [ 77%]
tests/test_mappings.py::TestRTAs::test_rtas_with_triggered_rules_have_uuid PASSED                                                                                [ 78%]
tests/test_packages.py::TestPackages::test_package_loader_default_configs PASSED                                                                                 [ 78%]
tests/test_packages.py::TestPackages::test_package_loader_production_config PASSED                                                                               [ 79%]
tests/test_packages.py::TestPackages::test_package_summary PASSED                                                                                                [ 80%]
tests/test_packages.py::TestPackages::test_rule_versioning PASSED                                                                                                [ 80%]
tests/test_packages.py::TestRegistryPackage::test_registry_package_config PASSED                                                                                 [ 81%]
tests/test_python_library.py::TestEQLInSet::test_eql_in_set PASSED                                                                                               [ 82%]
tests/test_schemas.py::TestSchemas::test_eql_validation PASSED                                                                                                   [ 82%]
tests/test_schemas.py::TestSchemas::test_query_downgrade_7_x PASSED                                                                                              [ 83%]
tests/test_schemas.py::TestSchemas::test_query_downgrade_8_x PASSED                                                                                              [ 84%]
tests/test_schemas.py::TestSchemas::test_threshold_downgrade_7_x PASSED                                                                                          [ 84%]
tests/test_schemas.py::TestSchemas::test_threshold_downgrade_8_x PASSED                                                                                          [ 85%]
tests/test_schemas.py::TestSchemas::test_versioned_downgrade_7_x PASSED                                                                                          [ 86%]
tests/test_schemas.py::TestSchemas::test_versioned_downgrade_8_x PASSED                                                                                          [ 86%]
tests/test_schemas.py::TestVersionLockSchema::test_version_lock_has_nested_previous PASSED                                                                       [ 87%]
tests/test_schemas.py::TestVersionLockSchema::test_version_lock_no_previous PASSED                                                                               [ 88%]
tests/test_schemas.py::TestVersions::test_stack_schema_map PASSED                                                                                                [ 88%]
tests/test_specific_rules.py::TestESQLRules::test_esql_queries PASSED                                                                                            [ 89%]
tests/test_specific_rules.py::TestEndpointQuery::test_os_and_platform_in_query PASSED                                                                            [ 90%]
tests/test_specific_rules.py::TestNewTerms::test_history_window_start PASSED                                                                                     [ 90%]
tests/test_specific_rules.py::TestNewTerms::test_new_terms_field_exists PASSED                                                                                   [ 91%]
tests/test_specific_rules.py::TestNewTerms::test_new_terms_fields PASSED                                                                                         [ 92%]
tests/test_specific_rules.py::TestNewTerms::test_new_terms_fields_unique PASSED                                                                                  [ 92%]
tests/test_specific_rules.py::TestNewTerms::test_new_terms_max_limit PASSED                                                                                      [ 93%]
tests/test_toml_formatter.py::TestRuleTomlFormatter::test_formatter_deep PASSED                                                                                  [ 94%]
tests/test_toml_formatter.py::TestRuleTomlFormatter::test_formatter_rule PASSED                                                                                  [ 94%]
tests/test_toml_formatter.py::TestRuleTomlFormatter::test_normalization PASSED                                                                                   [ 95%]
tests/test_transform_fields.py::TestGuideMarkdownPlugins::test_plugin_conversion PASSED                                                                          [ 96%]
tests/test_transform_fields.py::TestGuideMarkdownPlugins::test_transform_guide_markdown_plugins PASSED                                                           [ 96%]
tests/test_utils.py::TestTimeUtils::test_caching PASSED                                                                                                          [ 97%]
tests/test_utils.py::TestTimeUtils::test_event_class_normalization PASSED                                                                                        [ 98%]
tests/test_utils.py::TestTimeUtils::test_schema_multifields PASSED                                                                                               [ 98%]
tests/test_utils.py::TestTimeUtils::test_time_normalize PASSED                                                                                                   [ 99%]
tests/test_version_locking.py::TestVersionLock::test_previous_entries_gte_current_min_stack PASSED                                                               [100%]

=========================================================================== warnings summary ===========================================================================
env/detection-rules-build/lib/python3.12/site-packages/_pytest/config/__init__.py:1285
  /Users/stryker/workspace/ElasticGitHub/detection-rules/env/detection-rules-build/lib/python3.12/site-packages/_pytest/config/__init__.py:1285: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: typeguard
    self._mark_plugins_for_rewrite(hook)

tests/test_all_rules.py::TestValidRules::test_production_rules_have_rta
  /Users/stryker/workspace/ElasticGitHub/detection-rules/rta/uac_sysprep.py:31: SyntaxWarning: invalid escape sequence '\s'
    "C:\\Windows\\system32\sysprep\\CRYPTBASE.DLL",

tests/test_all_rules.py::TestValidRules::test_production_rules_have_rta
  /Users/stryker/workspace/ElasticGitHub/detection-rules/rta/uac_sysprep.py:33: SyntaxWarning: invalid escape sequence '\s'
    common.execute(["C:\\Windows\\system32\sysprep\\sysprep.exe"], timeout=5, kill=True)

tests/test_all_rules.py::TestValidRules::test_production_rules_have_rta
  /Users/stryker/workspace/ElasticGitHub/detection-rules/rta/uac_sysprep.py:34: SyntaxWarning: invalid escape sequence '\s'
    common.remove_file("C:\\Windows\\system32\sysprep\\CRYPTBASE.DLL")

tests/test_all_rules.py::TestValidRules::test_production_rules_have_rta
  /Users/stryker/workspace/ElasticGitHub/detection-rules/rta/credaccess_sam_from_vss.py:22: SyntaxWarning: invalid escape sequence '\c'
    wmi = wcd.ConnectServer(".","root\cimv2")

tests/test_all_rules.py::TestValidRules::test_production_rules_have_rta
  /Users/stryker/workspace/ElasticGitHub/detection-rules/rta/shellcode_load_ws2_32_unbacked.py:11: SyntaxWarning: invalid escape sequence '\9'
    SHELLCODE = b"\x33\xC9\x64\x8B\x41\x30\x8B\x40\x0C\x8B\x70\x14\xAD\x96\xAD\x8B\x58\x10\x8B\x53\x3C\x03\xD3\x8B\x52\x78\x03\xD3\x8B\x72\x20\x03\xF3\x33\xC9\x41\xAD\x03\xC3\x81\x38\x47\x65\x74\x50\x75\xF4\x81\x78\x04\x72\x6F\x63\x41\x75\xEB\x81\x78\x08\x64\x64\x72\x65\x75\xE2\x8B\x72\x24\x03\xF3\x66\x8B\x0C\x4E\x49\x8B\x72\x1C\x03\xF3\x8B\x14\x8E\x03\xD3\x33\xC9\x53\x52\x51\x68\x61\x72\x79\x41\x68\x4C\x69\x62\x72\x68\x4C\x6F\x61\x64\x54\x53\xFF\xD2\x83\xC4\x0C\x59\x50\x51\x66\xB9\x6C\x6C\x51\x68\x33\x32\x2E\x64\x68\x77\x73\x32\x5F\x54\xFF\xD0\x83\xC4\x10\x8B\x54\x24\x04\x33\xC9\x51\xB9\x74\x6F\x6E\x61\x51\x83\x6C\x24\x03\x61\x68\x65\x42\x75\x74\x68\x4D\x6F\x75\x73\x68\x53\x77\x61\x70\x54\x50\xFF\xD2\x83\xC4\x14\x33\xC9\x41\x51\xFF\xD0\x83\xC4\x04\x5A\x5B\xB9\x65\x73\x73\x61\x51\x83\x6C\x24\x03\x61\x68\x50\x72\x6F\x63\x68\x45\x78\x69\x74\x54\x53\xFF\xD2\x33\xC9\x51\xFF\xD0\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90\90"

tests/test_all_rules.py::TestValidRules::test_production_rules_have_rta
  /Users/stryker/workspace/ElasticGitHub/detection-rules/rta/exec_persistence_from_iso.py:33: SyntaxWarning: invalid escape sequence '\S'
    for arg in ["'/c reg.exe add hkcu\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v FromISO /d test.exe /f'", "'/c SCHTASKS.exe /Create /TN FromISO /TR test.exe /sc hourly /F'"] :

tests/test_all_rules.py::TestValidRules::test_production_rules_have_rta
  /Users/stryker/workspace/ElasticGitHub/detection-rules/rta/exec_persistence_from_iso.py:39: SyntaxWarning: invalid escape sequence '\S'
    rem_cmd = "reg.exe delete 'HKCU\Software\Microsoft\Windows\CurrentVersion\Run' /v FromISO"

tests/test_all_rules.py::TestValidRules::test_production_rules_have_rta
  /Users/stryker/workspace/ElasticGitHub/detection-rules/rta/at_command.py:67: SyntaxWarning: invalid escape sequence '\d'
    job_id = re.search("ID = (\d+)", output).group(1)

tests/test_all_rules.py::TestValidRules::test_production_rules_have_rta
  /Users/stryker/workspace/ElasticGitHub/detection-rules/rta/obfuscated_cmd_commands.py:28: SyntaxWarning: invalid escape sequence '\#'
    commands = """

tests/test_all_rules.py::TestValidRules::test_production_rules_have_rta
  /Users/stryker/workspace/ElasticGitHub/detection-rules/rta/rundll32_javascript_callback.py:34: SyntaxWarning: invalid escape sequence '\.'
    js = """

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================= 148 passed, 2 skipped, 11 warnings in 113.74s (0:01:53) ========================================================
(detection-rules-build) ➜  detection-rules git:(3640-fr-new-terms-suppression-schema-updates) ✗ 

Checklist

  • Added a label for the type of pr: bug, enhancement, schema, Rule: New, Rule: Deprecation, Rule: Tuning, Hunt: New, or Hunt: Tuning so guidelines can be generated
  • Added the meta:rapid-merge label if planning to merge within 24 hours
  • Secret and sensitive material has been managed correctly
  • Automated testing was updated or added to match the most common scenarios
  • Documentation and comments were added for features that require explanation

@Mikaayenson Mikaayenson added enhancement New feature or request schema labels Aug 14, 2024
@Mikaayenson Mikaayenson self-assigned this Aug 14, 2024
@Mikaayenson Mikaayenson linked an issue Aug 14, 2024 that may be closed by this pull request
@botelastic botelastic bot added the python Internal python for the repository label Aug 14, 2024
@protectionsmachine
Copy link
Collaborator

Enhancement - Guidelines

These guidelines serve as a reminder set of considerations when addressing adding a feature to the code.

Documentation and Context

  • Describe the feature enhancement in detail (alternative solutions, description of the solution, etc.) if not already documented in an issue.
  • Include additional context or screenshots.
  • Ensure the enhancement includes necessary updates to the documentation and versioning.

Code Standards and Practices

  • Code follows established design patterns within the repo and avoids duplication.
  • Code changes do not introduce new warnings or errors.
  • Variables and functions are well-named and descriptive.
  • Any unnecessary / commented-out code is removed.
  • Ensure that the code is modular and reusable where applicable.
  • Check for proper exception handling and messaging.

Testing

  • New unit tests have been added to cover the enhancement.
  • Existing unit tests have been updated to reflect the changes.
  • Provide evidence of testing and validating the enhancement (e.g., test logs, screenshots).
  • Validate that any rules affected by the enhancement are correctly updated.
  • Ensure that performance is not negatively impacted by the changes.
  • Verify that any release artifacts are properly generated and tested.

Additional Checks

  • Ensure that the enhancement does not break existing functionality.
  • Review the enhancement with a peer or team member for additional insights.
  • Verify that the enhancement works across all relevant environments (e.g., different OS versions).
  • Confirm that all dependencies are up-to-date and compatible with the changes.

@eric-forte-elastic
Copy link
Contributor

🟢 Local Testing LGTM 👍

As a note in my output, since I am bypassing the version lock my test results are slightly different in number but the same as it relates to the desired output for the PR.

Output

detection-rules on  3640-fr-new-terms-suppression-schema-updates [$!?] is  v0.1.0 via  v3.12.4 (detection-rules-build) on  eric.forte 
❯ python -m detection_rules import-rules-to-repo ~/Downloads/rules_export_supression.ndjson --required-only
Loaded config file: /home/forteea1/Code/clean_mains/detection-rules/.detection-rules-cfg.json

█▀▀▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄   ▄      █▀▀▄ ▄  ▄ ▄   ▄▄▄ ▄▄▄
█  █ █▄▄  █  █▄▄ █    █   █  █ █ █▀▄ █      █▄▄▀ █  █ █   █▄▄ █▄▄
█▄▄▀ █▄▄  █  █▄▄ █▄▄  █  ▄█▄ █▄█ █ ▀▄█      █ ▀▄ █▄▄█ █▄▄ █▄▄ ▄▄█

[+] Building rule for /home/forteea1/Code/clean_mains/detection-rules/custom_test/rules/test_new_terms_suppress_rule.toml
[+] Building rule for /home/forteea1/Code/clean_mains/detection-rules/custom_test/rules/test_esql_suppress_rule.toml
[+] Building rule for /home/forteea1/Code/clean_mains/detection-rules/custom_test/rules/test_eql_suppress_rule.toml
[+] Building rule for /home/forteea1/Code/clean_mains/detection-rules/custom_test/rules/test_ml_suppress_rule_per_execution.toml
[+] Building rule for /home/forteea1/Code/clean_mains/detection-rules/custom_test/rules/test_threat_indicator_match_suppress_rule.toml
[+] Building rule for /home/forteea1/Code/clean_mains/detection-rules/custom_test/rules/test_ml_suppress_rule.toml
6 results exported
6 rules converted
0 exceptions exported
0 actions connectors exported

detection-rules on  3640-fr-new-terms-suppression-schema-updates [$!?] is  v0.1.0 via  v3.12.4 (detection-rules-build) on  eric.forte took 2s 
❯ python -m detection_rules kibana --space test import-rules
Loaded config file: /home/forteea1/Code/clean_mains/detection-rules/.detection-rules-cfg.json

█▀▀▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄   ▄      █▀▀▄ ▄  ▄ ▄   ▄▄▄ ▄▄▄
█  █ █▄▄  █  █▄▄ █    █   █  █ █ █▀▄ █      █▄▄▀ █  █ █   █▄▄ █▄▄
█▄▄▀ █▄▄  █  █▄▄ █▄▄  █  ▄█▄ █▄█ █ ▀▄█      █ ▀▄ █▄▄█ █▄▄ █▄▄ ▄▄█

6 rule(s) successfully imported
 - 3ea1fa0a-0a25-4043-b23e-450e1e9c5730
 - 058a8221-5b41-49ad-9e68-5a60fdf977e8
 - 749ac911-16fd-406c-b1d1-d16b69322cbb
 - 804d56c3-18bd-4e92-81f4-0c4f08af6e24
 - c5904049-0d3a-4416-ad23-e1cceaf9f9f2
 - fbdbcb5f-1e75-4931-92b2-aedc830c9b8e
 
 
 detection-rules on  3640-fr-new-terms-suppression-schema-updates [$!?] is  v0.1.0 via  v3.12.4 (detection-rules-build) on  eric.forte 
❯ python -m detection_rules kibana --space "test" export-rules -s -d tmp-export/
Loaded config file: /home/forteea1/Code/clean_mains/detection-rules/.detection-rules-cfg.json

█▀▀▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄   ▄      █▀▀▄ ▄  ▄ ▄   ▄▄▄ ▄▄▄
█  █ █▄▄  █  █▄▄ █    █   █  █ █ █▀▄ █      █▄▄▀ █  █ █   █▄▄ █▄▄
█▄▄▀ █▄▄  █  █▄▄ █▄▄  █  ▄█▄ █▄█ █ ▀▄█      █ ▀▄ █▄▄█ █▄▄ █▄▄ ▄▄█

6 results exported
6 rules converted
0 exceptions exported
0 action connectors exported
6 rules saved to tmp-export
0 exception lists saved to /home/forteea1/Code/clean_mains/detection-rules/custom_test/exceptions
0 action connectors saved to /home/forteea1/Code/clean_mains/detection-rules/custom_test/action_connectors

./env/detection-rules-build/bin/python -m detection_rules test
Loaded config file: /home/forteea1/Code/clean_mains/detection-rules/.detection-rules-cfg.json

█▀▀▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄   ▄      █▀▀▄ ▄  ▄ ▄   ▄▄▄ ▄▄▄
█  █ █▄▄  █  █▄▄ █    █   █  █ █ █▀▄ █      █▄▄▀ █  █ █   █▄▄ █▄▄
█▄▄▀ █▄▄  █  █▄▄ █▄▄  █  ▄█▄ █▄█ █ ▀▄█      █ ▀▄ █▄▄█ █▄▄ █▄▄ ▄▄█

Tests skipped per config (8):
tests/test_all_rules.py::TestRuleMetadata::test_invalid_queries
tests/test_all_rules.py::TestValidRules::test_bbr_validation
tests/test_all_rules.py::TestValidRules::test_rule_type_changes
tests/test_all_rules.py::TestValidRules::test_schema_and_dupes
tests/test_gh_workflows.py::TestWorkflows::test_matrix_to_lock_version_defaults
tests/test_packages.py::TestRegistryPackage::test_registry_package_config
tests/test_schemas.py::TestSchemas::test_eql_validation
tests/test_schemas.py::TestVersionLockSchema::test_version_lock_has_nested_previous
======================================================================================================================= test session starts ========================================================================================================================
platform linux -- Python 3.12.4, pytest-8.2.1, pluggy-1.5.0 -- /home/forteea1/Code/clean_mains/detection-rules/env/detection-rules-build/bin/python
cachedir: .pytest_cache
rootdir: /home/forteea1/Code/clean_mains/detection-rules
configfile: pyproject.toml
plugins: typeguard-3.0.2
collected 142 items                                                                                                                                                                                                                                                

tests/kuery/test_dsl.py::TestKQLtoDSL::test_and_query PASSED                                                                                                                                                                                                 [  0%]
tests/kuery/test_dsl.py::TestKQLtoDSL::test_field_exists PASSED                                                                                                                                                                                              [  1%]
tests/kuery/test_dsl.py::TestKQLtoDSL::test_field_inequality PASSED                                                                                                                                                                                          [  2%]
tests/kuery/test_dsl.py::TestKQLtoDSL::test_field_match PASSED                                                                                                                                                                                               [  2%]
tests/kuery/test_dsl.py::TestKQLtoDSL::test_not_query PASSED                                                                                                                                                                                                 [  3%]
tests/kuery/test_dsl.py::TestKQLtoDSL::test_optimizations PASSED                                                                                                                                                                                             [  4%]
tests/kuery/test_dsl.py::TestKQLtoDSL::test_or_query PASSED                                                                                                                                                                                                  [  4%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_and_query PASSED                                                                                                                                                                                              [  5%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_boolean_precedence PASSED                                                                                                                                                                                     [  6%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_field_equals PASSED                                                                                                                                                                                           [  7%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_field_inequality PASSED                                                                                                                                                                                       [  7%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_ip_checks PASSED                                                                                                                                                                                              [  8%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_list_of_values PASSED                                                                                                                                                                                         [  9%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_not_query PASSED                                                                                                                                                                                              [  9%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_or_query PASSED                                                                                                                                                                                               [ 10%]
tests/kuery/test_eql2kql.py::TestEql2Kql::test_wildcard_field PASSED                                                                                                                                                                                         [ 11%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_and_expr PASSED                                                                                                                                                                                          [ 11%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_and_values PASSED                                                                                                                                                                                        [ 12%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_cidr_match PASSED                                                                                                                                                                                        [ 13%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_field_exists PASSED                                                                                                                                                                                      [ 14%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_flattening PASSED                                                                                                                                                                                        [ 14%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_list_value PASSED                                                                                                                                                                                        [ 15%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_not_value PASSED                                                                                                                                                                                         [ 16%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_or_expr PASSED                                                                                                                                                                                           [ 16%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_or_values PASSED                                                                                                                                                                                         [ 17%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_quoted_wildcard PASSED                                                                                                                                                                                   [ 18%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_range PASSED                                                                                                                                                                                             [ 19%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_single_value PASSED                                                                                                                                                                                      [ 19%]
tests/kuery/test_evaluator.py::EvaluatorTests::test_wildcard PASSED                                                                                                                                                                                          [ 20%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_and_query PASSED                                                                                                                                                                                              [ 21%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_boolean_precedence PASSED                                                                                                                                                                                     [ 21%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_field_equals PASSED                                                                                                                                                                                           [ 22%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_field_inequality PASSED                                                                                                                                                                                       [ 23%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_list_of_values PASSED                                                                                                                                                                                         [ 23%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_lone_value PASSED                                                                                                                                                                                             [ 24%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_nested_query PASSED                                                                                                                                                                                           [ 25%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_not_query PASSED                                                                                                                                                                                              [ 26%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_or_query PASSED                                                                                                                                                                                               [ 26%]
tests/kuery/test_kql2eql.py::TestKql2Eql::test_schema PASSED                                                                                                                                                                                                 [ 27%]
tests/kuery/test_lint.py::LintTests::test_and_not PASSED                                                                                                                                                                                                     [ 28%]
tests/kuery/test_lint.py::LintTests::test_compound PASSED                                                                                                                                                                                                    [ 28%]
tests/kuery/test_lint.py::LintTests::test_double_negate PASSED                                                                                                                                                                                               [ 29%]
tests/kuery/test_lint.py::LintTests::test_extract_not PASSED                                                                                                                                                                                                 [ 30%]
tests/kuery/test_lint.py::LintTests::test_ip PASSED                                                                                                                                                                                                          [ 30%]
tests/kuery/test_lint.py::LintTests::test_lint_field PASSED                                                                                                                                                                                                  [ 31%]
tests/kuery/test_lint.py::LintTests::test_lint_precedence PASSED                                                                                                                                                                                             [ 32%]
tests/kuery/test_lint.py::LintTests::test_merge_fields PASSED                                                                                                                                                                                                [ 33%]
tests/kuery/test_lint.py::LintTests::test_mixed_demorgans PASSED                                                                                                                                                                                             [ 33%]
tests/kuery/test_lint.py::LintTests::test_not_demorgans PASSED                                                                                                                                                                                               [ 34%]
tests/kuery/test_lint.py::LintTests::test_not_or PASSED                                                                                                                                                                                                      [ 35%]
tests/kuery/test_lint.py::LintTests::test_upper_tokens PASSED                                                                                                                                                                                                [ 35%]
tests/kuery/test_parser.py::ParserTests::test_conversion PASSED                                                                                                                                                                                              [ 36%]
tests/kuery/test_parser.py::ParserTests::test_date PASSED                                                                                                                                                                                                    [ 37%]
tests/kuery/test_parser.py::ParserTests::test_keyword PASSED                                                                                                                                                                                                 [ 38%]
tests/kuery/test_parser.py::ParserTests::test_list_equals PASSED                                                                                                                                                                                             [ 38%]
tests/kuery/test_parser.py::ParserTests::test_multiple_types_fail PASSED                                                                                                                                                                                     [ 39%]
tests/kuery/test_parser.py::ParserTests::test_multiple_types_success PASSED                                                                                                                                                                                  [ 40%]
tests/kuery/test_parser.py::ParserTests::test_number_exists PASSED                                                                                                                                                                                           [ 40%]
tests/kuery/test_parser.py::ParserTests::test_number_wildcard_fail PASSED                                                                                                                                                                                    [ 41%]
tests/kuery/test_parser.py::ParserTests::test_type_family_fail PASSED                                                                                                                                                                                        [ 42%]
tests/kuery/test_parser.py::ParserTests::test_type_family_success PASSED                                                                                                                                                                                     [ 42%]
tests/test_all_rules.py::TestAlertSuppression::test_eql_non_sequence_support_only PASSED                                                                                                                                                                     [ 43%]
tests/test_all_rules.py::TestAlertSuppression::test_group_field_in_schemas PASSED                                                                                                                                                                            [ 44%]
tests/test_all_rules.py::TestBuildTimeFields::test_build_fields_min_stack PASSED                                                                                                                                                                             [ 45%]
tests/test_all_rules.py::TestIncompatibleFields::test_rule_backports_for_restricted_fields PASSED                                                                                                                                                            [ 45%]
tests/test_all_rules.py::TestIntegrationRules::test_all_min_stack_rules_have_comment PASSED                                                                                                                                                                  [ 46%]
tests/test_all_rules.py::TestIntegrationRules::test_integration_guide SKIPPED (8.3+ Stacks Have Related Integrations Feature)                                                                                                                                [ 47%]
tests/test_all_rules.py::TestIntegrationRules::test_ml_integration_jobs_exist PASSED                                                                                                                                                                         [ 47%]
tests/test_all_rules.py::TestIntegrationRules::test_rule_demotions PASSED                                                                                                                                                                                    [ 48%]
tests/test_all_rules.py::TestLicense::test_elastic_license_only_v2 PASSED                                                                                                                                                                                    [ 49%]
tests/test_all_rules.py::TestNoteMarkdownPlugins::test_if_plugins_explicitly_defined PASSED                                                                                                                                                                  [ 50%]
tests/test_all_rules.py::TestNoteMarkdownPlugins::test_note_has_osquery_warning PASSED                                                                                                                                                                       [ 50%]
tests/test_all_rules.py::TestNoteMarkdownPlugins::test_plugin_placeholders_match_entries PASSED                                                                                                                                                              [ 51%]
tests/test_all_rules.py::TestRiskScoreMismatch::test_rule_risk_score_severity_mismatch PASSED                                                                                                                                                                [ 52%]
tests/test_all_rules.py::TestRuleFiles::test_bbr_in_correct_dir PASSED                                                                                                                                                                                       [ 52%]
tests/test_all_rules.py::TestRuleFiles::test_non_bbr_in_correct_dir PASSED                                                                                                                                                                                   [ 53%]
tests/test_all_rules.py::TestRuleFiles::test_rule_file_name_tactic PASSED                                                                                                                                                                                    [ 54%]
tests/test_all_rules.py::TestRuleMetadata::test_deprecated_rules SKIPPED (Skipping deprecated version lock check)                                                                                                                                            [ 54%]
tests/test_all_rules.py::TestRuleMetadata::test_deprecated_rules_modified PASSED                                                                                                                                                                             [ 55%]
tests/test_all_rules.py::TestRuleMetadata::test_event_dataset PASSED                                                                                                                                                                                         [ 56%]
tests/test_all_rules.py::TestRuleMetadata::test_integration_tag PASSED                                                                                                                                                                                       [ 57%]
tests/test_all_rules.py::TestRuleMetadata::test_rule_change_has_updated_date PASSED                                                                                                                                                                          [ 57%]
tests/test_all_rules.py::TestRuleMetadata::test_updated_date_newer_than_creation PASSED                                                                                                                                                                      [ 58%]
tests/test_all_rules.py::TestRuleTags::test_casing_and_spacing SKIPPED (Skipping tag validation)                                                                                                                                                             [ 59%]
tests/test_all_rules.py::TestRuleTags::test_investigation_guide_tag SKIPPED (Skipping tag validation)                                                                                                                                                        [ 59%]
tests/test_all_rules.py::TestRuleTags::test_ml_rule_type_tags SKIPPED (Skipping tag validation)                                                                                                                                                              [ 60%]
tests/test_all_rules.py::TestRuleTags::test_no_duplicate_tags SKIPPED (Skipping tag validation)                                                                                                                                                              [ 61%]
tests/test_all_rules.py::TestRuleTags::test_os_tags SKIPPED (Skipping tag validation)                                                                                                                                                                        [ 61%]
tests/test_all_rules.py::TestRuleTags::test_primary_tactic_as_tag SKIPPED (Skipping tag validation)                                                                                                                                                          [ 62%]
tests/test_all_rules.py::TestRuleTags::test_required_tags SKIPPED (Skipping tag validation)                                                                                                                                                                  [ 63%]
tests/test_all_rules.py::TestRuleTags::test_tag_prefix SKIPPED (Skipping tag validation)                                                                                                                                                                     [ 64%]
tests/test_all_rules.py::TestRuleTimelines::test_timeline_has_title PASSED                                                                                                                                                                                   [ 64%]
tests/test_all_rules.py::TestRuleTiming::test_eql_interval_to_maxspan PASSED                                                                                                                                                                                 [ 65%]
tests/test_all_rules.py::TestRuleTiming::test_eql_lookback PASSED                                                                                                                                                                                            [ 66%]
tests/test_all_rules.py::TestRuleTiming::test_event_override PASSED                                                                                                                                                                                          [ 66%]
tests/test_all_rules.py::TestRuleTiming::test_required_lookback PASSED                                                                                                                                                                                       [ 67%]
tests/test_all_rules.py::TestThreatMappings::test_duplicated_tactics PASSED                                                                                                                                                                                  [ 68%]
tests/test_all_rules.py::TestThreatMappings::test_tactic_to_technique_correlations PASSED                                                                                                                                                                    [ 69%]
tests/test_all_rules.py::TestThreatMappings::test_technique_deprecations PASSED                                                                                                                                                                              [ 69%]
tests/test_all_rules.py::TestValidRules::test_all_rule_queries_optimized PASSED                                                                                                                                                                              [ 70%]
tests/test_all_rules.py::TestValidRules::test_duplicate_file_names PASSED                                                                                                                                                                                    [ 71%]
tests/test_all_rules.py::TestValidRules::test_file_names PASSED                                                                                                                                                                                              [ 71%]
tests/test_all_rules.py::TestValidRules::test_from_filed_value PASSED                                                                                                                                                                                        [ 72%]
tests/test_all_rules.py::TestValidRules::test_index_or_data_view_id_present PASSED                                                                                                                                                                           [ 73%]
tests/test_all_rules.py::TestValidRules::test_max_signals_note PASSED                                                                                                                                                                                        [ 73%]
tests/test_all_rules.py::TestValidRules::test_production_rules_have_rta PASSED                                                                                                                                                                               [ 74%]
tests/test_hunt_data.py::TestHunt::test_load_toml_files PASSED                                                                                                                                                                                               [ 75%]
tests/test_hunt_data.py::TestHunt::test_markdown_existence PASSED                                                                                                                                                                                            [ 76%]
tests/test_hunt_data.py::TestHunt::test_toml_loading PASSED                                                                                                                                                                                                  [ 76%]
tests/test_mappings.py::TestMappings::test_false_positives PASSED                                                                                                                                                                                            [ 77%]
tests/test_mappings.py::TestMappings::test_true_positives PASSED                                                                                                                                                                                             [ 78%]
tests/test_mappings.py::TestRTAs::test_rtas_with_triggered_rules_have_uuid PASSED                                                                                                                                                                            [ 78%]
tests/test_packages.py::TestPackages::test_package_loader_default_configs SKIPPED (Version lock bypassed)                                                                                                                                                    [ 79%]
tests/test_packages.py::TestPackages::test_package_loader_production_config PASSED                                                                                                                                                                           [ 80%]
tests/test_packages.py::TestPackages::test_package_summary SKIPPED (Version lock bypassed)                                                                                                                                                                   [ 80%]
tests/test_packages.py::TestPackages::test_rule_versioning SKIPPED (Version lock bypassed)                                                                                                                                                                   [ 81%]
tests/test_python_library.py::TestEQLInSet::test_eql_in_set PASSED                                                                                                                                                                                           [ 82%]
tests/test_schemas.py::TestSchemas::test_query_downgrade_7_x PASSED                                                                                                                                                                                          [ 83%]
tests/test_schemas.py::TestSchemas::test_query_downgrade_8_x PASSED                                                                                                                                                                                          [ 83%]
tests/test_schemas.py::TestSchemas::test_threshold_downgrade_7_x PASSED                                                                                                                                                                                      [ 84%]
tests/test_schemas.py::TestSchemas::test_threshold_downgrade_8_x PASSED                                                                                                                                                                                      [ 85%]
tests/test_schemas.py::TestSchemas::test_versioned_downgrade_7_x PASSED                                                                                                                                                                                      [ 85%]
tests/test_schemas.py::TestSchemas::test_versioned_downgrade_8_x PASSED                                                                                                                                                                                      [ 86%]
tests/test_schemas.py::TestVersionLockSchema::test_version_lock_no_previous PASSED                                                                                                                                                                           [ 87%]
tests/test_schemas.py::TestVersions::test_stack_schema_map PASSED                                                                                                                                                                                            [ 88%]
tests/test_specific_rules.py::TestESQLRules::test_esql_queries PASSED                                                                                                                                                                                        [ 88%]
tests/test_specific_rules.py::TestEndpointQuery::test_os_and_platform_in_query PASSED                                                                                                                                                                        [ 89%]
tests/test_specific_rules.py::TestNewTerms::test_history_window_start PASSED                                                                                                                                                                                 [ 90%]
tests/test_specific_rules.py::TestNewTerms::test_new_terms_field_exists PASSED                                                                                                                                                                               [ 90%]
tests/test_specific_rules.py::TestNewTerms::test_new_terms_fields PASSED                                                                                                                                                                                     [ 91%]
tests/test_specific_rules.py::TestNewTerms::test_new_terms_fields_unique PASSED                                                                                                                                                                              [ 92%]
tests/test_specific_rules.py::TestNewTerms::test_new_terms_max_limit PASSED                                                                                                                                                                                  [ 92%]
tests/test_toml_formatter.py::TestRuleTomlFormatter::test_formatter_deep PASSED                                                                                                                                                                              [ 93%]
tests/test_toml_formatter.py::TestRuleTomlFormatter::test_formatter_rule PASSED                                                                                                                                                                              [ 94%]
tests/test_toml_formatter.py::TestRuleTomlFormatter::test_normalization PASSED                                                                                                                                                                               [ 95%]
tests/test_transform_fields.py::TestGuideMarkdownPlugins::test_plugin_conversion PASSED                                                                                                                                                                      [ 95%]
tests/test_transform_fields.py::TestGuideMarkdownPlugins::test_transform_guide_markdown_plugins PASSED                                                                                                                                                       [ 96%]
tests/test_utils.py::TestTimeUtils::test_caching PASSED                                                                                                                                                                                                      [ 97%]
tests/test_utils.py::TestTimeUtils::test_event_class_normalization PASSED                                                                                                                                                                                    [ 97%]
tests/test_utils.py::TestTimeUtils::test_schema_multifields PASSED                                                                                                                                                                                           [ 98%]
tests/test_utils.py::TestTimeUtils::test_time_normalize PASSED                                                                                                                                                                                               [ 99%]
tests/test_version_locking.py::TestVersionLock::test_previous_entries_gte_current_min_stack SKIPPED (Version lock bypassed)                                                                                                                                  [100%]

========================================================================================================================= warnings summary =========================================================================================================================
env/detection-rules-build/lib/python3.12/site-packages/_pytest/config/__init__.py:1285
  /home/forteea1/Code/clean_mains/detection-rules/env/detection-rules-build/lib/python3.12/site-packages/_pytest/config/__init__.py:1285: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: typeguard
    self._mark_plugins_for_rewrite(hook)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================================================ 128 passed, 14 skipped, 1 warning in 6.11s ============================================================================================================

….com:elastic/detection-rules into 3640-fr-new-terms-suppression-schema-updates
@Mikaayenson Mikaayenson merged commit 10ba6ad into main Aug 15, 2024
9 checks passed
@Mikaayenson Mikaayenson deleted the 3640-fr-new-terms-suppression-schema-updates branch August 15, 2024 20:03
protectionsmachine pushed a commit that referenced this pull request Aug 15, 2024
protectionsmachine pushed a commit that referenced this pull request Aug 15, 2024
protectionsmachine pushed a commit that referenced this pull request Aug 15, 2024
protectionsmachine pushed a commit that referenced this pull request Aug 15, 2024
protectionsmachine pushed a commit that referenced this pull request Aug 15, 2024
protectionsmachine pushed a commit that referenced this pull request Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport: auto enhancement New feature or request python Internal python for the repository schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] New Terms Suppression Schema Updates
5 participants