Skip to content

Commit 7ea5903

Browse files
whotwagnerhoeldglandauermax4cti0nfi9ureWolfgang Hotwagner
authored
Development (#876)
* Main merge (#742) * Development (#595) * Added the variables min_values_cors_thres and new_vals_alarm_thres * Fixed DeepSource-issue * Implemented the chisquare test and added the parameters used_homogeneity_test and alpha_chisquare_test * Fixed DeepSource-issues * Add EventSequenceDetector * Fix deepsource issues * Fix deepsource issues * Add unit test for EventSequenceDetector * Fix deepsource issues. * Fix deepsource issues. * Remove print statement. * Removed the prints and fixed typos * Refactoring of the VTD-output * Fixed DeepSource-issues * Fixed DeepSource-issue * Add frequency detector * Fix deepsource issues * Fix deepsource issues * Fix deepsource issues * Fix deepsource issues * Fix confidence_factor * Fixed warnigs due to files in Persistency-Directory * fixed acl-problems in dockerfile and autocreate /var/lib/aminer/log * added simple test for dockercontainer * negate result of the timeout-command. 1 is okay. 0 must be an error * added bullseye-tests * make tmp-dir in debian-bullseye-test and debian-buster-test unique * fixed various deepsource-issues * added changes to changelog and modified version-string * modified openjdk to work with bullseye * Restructured some output and added a confidence value for messages related to anomalies * fixed debian-changelog and removed changelog from /usr/share/doc/aminer * Improve test documentation * Fix deepsource issues * Fix deepsource issues * updated kafka download link. * Fix deepsource issues * Fix deepsource issues * fixed kafka-version in coverage-tests * Disabled Coverage-Test Due to problems with kafka, the coverage-tests were temporarily disabled. * renamed AMiner to aminer or Aminer. * fixed issues. * removed link. * added testing manifest to Readme. * Refined the ouptut of the VCD * fixed variable names. * Fixed Deepsource-issues * Fixed Deepsource issues * Fixed Deepsource issue * renamed AMiner to aminer or Aminer. * fixed issues. * removed link. * fixed the warning in the VCD * fixed the warning in the VCD * Fixed the Warning in the VTD * Fixed the method pick_cor_match_disc_vals * added close function to LogStream. * Changed the unit-test for the function matchDiscVals * Add a query in the VCD to check if the ETD skipped the currently processed line * Changed the variable w_rel_bt_results into w_rel_ht_results * 007 yaml kafka event handler (#446) * added KafkaEventHandler to template_config.yml * added kafka client config. * added KafkaEventHandler to template_config.py and template_config.yml. * fixed kafka config path. * fixed deepsource issues. * fixed errors in template config. * fixed error in template_config. * added KafkaEventHandler to suppress_config.yml. * renamed kafka_client.conf to kafka-client.conf. * fixed error with KafkaEventHandler in YamlConfig. * fixed errors in kafka-client.conf * changed kafka topic for yaml tests. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * removed kafka-client.conf in unittest script. * removed kafka-client.conf in unittest script. (#447) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * make wiki-tests branch-dependent * fixed error in multiple detectors and added unittest. * fixed errors. * fixed error. * added flag to mute persistence_id warnings in tests. * fixed deepsource issues. * fixed error. * 009 specify yml remove imports (#451) * implemented first version of new yaml schema validation. Analysis validation and EventHandler Validation is still missing. * implemented EventHandler validation. * fixed error. * implemented AnalysisValidationSchema. * fixed AnalysisValidationSchema. * specified ParserValidationSchema. * specified EventHandlerValidationSchema. * fixed default values for EventHandler and Parser. * specified Analysis schemas. * specified Analysis Schemas. * fixed skipped deepsource issues. * removed imports from analysis/__init__.py. * fixed imports in AnalysisComponentsPerformanceTest. * removed analysis/__init__.py. * fixed typo. * fixed analysis import errors in configs. * fixed errors in AnalysisChild. * fixed error. * fixed up aminer.events imports in all classes. * fixed aminer.event imports. * fixed import error in aminer.py. * added __init__.py. * fixed deepsource issues. * removed imports from input/__init__.py. * removed util/__init__.py. * fixed typo. * fixed typo. * fixed import error. * removed parsing/__init__.py. * fixed error in yaml. * fixed yaml error. * fixed import error. * fixed deepsource issues. * specified integer values and added comments. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * Add documentation for params in ESD. (#455) * fixed pr template. (#457) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 013 multiline support (#459) * added eol_sep parameter to the ByteStreamLineAtomizer. * implemented json_format parameter. * added json_format for multiline json support. * fixed deepsource issues. * fixed deepsource issues. * fixed deepsource issues * added warning if invalid json is found. * added line number to warning. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * changed all shutil.chown to os.chown without using dir_fd. (#440) * changed all shutil.chown to os.chown without using dir_fd. * secured logging with dir_fd and follow_symlinks=False. * fixed logging code in TestBase. * fixed errors and moved imports to the top of the file. * fixed deepsource issues. * fixed error in TestBase. * changed os.makedirs to os.mkdir and used dir_fd. * fixed security issues. * opened persistence_dir in initialize loggers. * removed wrong import. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 010 add kafka event handler to integration test2 (#456) * added KafkaEventHandler to the integration test 2. * renamed hostname in integration test. * fixed indentation. * fixed indentation error. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * fixed mail tests. (#458) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 014 fix wiki tests (#465) * extended the Getting Started Tests. * extended try it out wiki tests. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 015 add tests for esd efd (#468) * added default value to target_path_list in EFD and ESD. * added EFD to the demo configs. * added the ESD to the aminer demo. * added ESD and EFD to AnalysisChild. * added performance tests for the ESD and EFD. * fixed unittests. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * fixed error in TryItOut test. (#469) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * fixed encoding errors. (#471) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * Fix: too many open directory-handles (#472) This patch fixes a problem with too many open file-handles. This problem occurs with open directory-handles of resource-files. Co-authored-by: Wolfgang Hotwagner <wolfgang.hotwagner@ait.ac.at> * fixed encoding error. (#473) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * added sync_wait_time parameter. (#484) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 020 create elasticsearch demo (#476) * added consume_data parameter to the DelimitedDataModelElement. * converted all tabs in Jenkinsfile to spaces. * added consume_delimiter to yaml. * fixed configs. * added unfinished version of JsonModelElement. * finished JsonModelElement. * renamed optional_key_identifier to optional_key_prefix. * fixed deepsource issues. * fixed error. * added first unittest for JsonModelElement. * created unittests for JsonModelElement. * fixed deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 027 fix dev tests (#491) * fixed testingwrapper. * extended usage string. * fixed runAminerElasticsearchDemo.sh. * renamed elasticsearch to jsoninput. * fixed error in test. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 028 fix dev (#495) * renamed config in aminerJsonInputDemo. * changed wrong path. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 022 check4updates (#482) * added check4updates parameter. * renamed check4updates to check. * added installation of urllib3 to all dockerfiles. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 031 json parsing (#502) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * fixed encoding error in ByteStreamLineAtomizer. * fixed json error when key does not exist. * added unittest to JsonModelElementTest. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * changed default value of verbose to True. (#485) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 030 improve error output yaml (#501) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * added filter to error output in yaml. * removed multiple outputs of yaml errors. * fixed unittest. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 035 fix suspend mode test (#507) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * fixed suspend mode tests. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 026 detection timestamp (#490) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed Kafka output of integration test. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 029 no args test (#496) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * removed args from apacheModel in template_config. * fixed kafka tests. * fixed kafka tests. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 032 test whitespace constant (#503) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * changed test to check WHITESPACE usage. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 034 empty validation schemas (#506) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * extended schemas to check if strings are empty. * fixed names in demo configs. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 036 New JSON Implementation + Tests (#511) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * implemented JsonStateMachine to validate json input. * extended json demo and added tests if they work properly. * fixed Deepsource issues. * fixed error in json parsing. * fixed deepsource issue. * fixed Deepsource issues. * fixed deepsource issues. * added more examples for json processing. * fixed error in JsonStateMachine. * added max_line_length to json_format. * added unittests for hex_machine. * added unittests for the ByteStreamLineAtomizer and JsonStateMachine. * added unittests for the hex_machine and utf8_machine. * added unittests for the constant_machine. * added tests for the numbers_machine. * added array_machine tests. * added tests for object_machine and json_machine. * fixed up JsonStateMachine. * removed duplicate tests from aminerJsonInputDemo. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 021 specify log resource list (#481) * specified types of LogResourceList. * fixed unittest. * fixed deepsource issues. * fixed regex. * added more examples. * added error messages for test24. * fixed deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> Co-authored-by: Max Landauer <landauermax@users.noreply.github.com> * 025 specify base schema (#489) * specified BaseSchema.py. * fixed testingwrapper. * undid changes in testingwrapper. * fixed Deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> Co-authored-by: Max Landauer <landauermax@users.noreply.github.com> * 040 howto tests (#524) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * implemented Tests for HowTo FrequencyDetector and SequenceDetector. * added tests for wiki HowTo MissingMatchPathValueDetector. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 045 hotfix tests (#536) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * fixed Test. * fixed suspendModeTest Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * Fix allow multiple values per id path * 046 hotfix2 (#537) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * fixed errors in HowTo tests. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 039 json me error output (#520) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * fixed JsonModelElement error and specified output in the VerboseUnparsedAtomHandler. * extended sleep time in Suspend mode test. * fixed JsonModelElement when key is missing. * fixed Deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 037 file permissions (#518) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * fixed permissions. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 041 rewrite any byte dme (#526) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * rewrote unittests for the AnyByteDME. * fixed Deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 033 rewrite FixedDME (#517) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * changed test to check WHITESPACE usage. * added new testcase design for FixedDME. * rewrote some unittests for the FixedDME. * finished rewriting unittests for the FixedDME. * fixed Deepsource issues. * added unittests for simple methods of FixedDME. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 042 rewrite base64 me tests (#530) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * changed test to check WHITESPACE usage. * added new testcase design for FixedDME. * rewrote some unittests for the FixedDME. * finished rewriting unittests for the FixedDME. * fixed Deepsource issues. * added unittests for simple methods of FixedDME. * added some unittests to the Base64 Model Element. * Rewrote unittests for the Base64StringModelElement. * fixed Deepsource issues. * fixed unittest without exact length. * added performance test and reimplemented the Base64StringModelElement. * fixed Deepsource issues. * fixed Deepsource issues. * fixed Deepsource issues. * fixed Deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 038 yaml duplicate ids (#519) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * added checks in YamlConfig if id was used multiple times for Analysis, Parser and EventHandlers. * fixed Deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 047 base64 (#550) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * added check in Base64StringModelElement if data is encoded utf-8. * commented changes. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 044 json demos (#535) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * fixed JsonModelElement error and specified output in the VerboseUnparsedAtomHandler. * extended sleep time in Suspend mode test. * fixed JsonModelElement when key is missing. * fixed Deepsource issues. * added special key ALLOW_ALL for JsonModelElement. * fixed zero start handling of the JsonStateMachine. * fixed errors in JSON input data handling and JsonStateMachine. * fixed data. * created first config for elastic.log and fixed more errors. * finished json-elastic-demo.yml. * added config for eve.json and fixed more JSON parsing errors. * fixed more errors. * added config for journal.log. * added wazuh config. * added logging to the JsonModelElement. * added unittest for JsonModelElement with different key orders. * fixed unittests. * fixed JsonModelElement. * fixed unittest. * fixed runAminerJsonInputDemo and added runJsonDemo script. * added Json Tests to Jenkinsfile and testingwrapper. * removed debug outputs. * fixed Deepsource issues. * fixed Deepsource issues. * fixed json demo configs. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * HOTFIX JENKINSFILE (#556) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * fixed JsonModelElement error and specified output in the VerboseUnparsedAtomHandler. * extended sleep time in Suspend mode test. * fixed JsonModelElement when key is missing. * fixed Deepsource issues. * added special key ALLOW_ALL for JsonModelElement. * fixed zero start handling of the JsonStateMachine. * fixed errors in JSON input data handling and JsonStateMachine. * fixed data. * created first config for elastic.log and fixed more errors. * finished json-elastic-demo.yml. * added config for eve.json and fixed more JSON parsing errors. * fixed more errors. * added config for journal.log. * added wazuh config. * added logging to the JsonModelElement. * added unittest for JsonModelElement with different key orders. * fixed unittests. * fixed JsonModelElement. * fixed unittest. * fixed runAminerJsonInputDemo and added runJsonDemo script. * added Json Tests to Jenkinsfile and testingwrapper. * removed debug outputs. * fixed Deepsource issues. * fixed Deepsource issues. * fixed json demo configs. * fixed jenkinsfile Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * HOTFIX 2 (#559) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * fixed JsonModelElement error and specified output in the VerboseUnparsedAtomHandler. * extended sleep time in Suspend mode test. * fixed JsonModelElement when key is missing. * fixed Deepsource issues. * added special key ALLOW_ALL for JsonModelElement. * fixed zero start handling of the JsonStateMachine. * fixed errors in JSON input data handling and JsonStateMachine. * fixed data. * created first config for elastic.log and fixed more errors. * finished json-elastic-demo.yml. * added config for eve.json and fixed more JSON parsing errors. * fixed more errors. * added config for journal.log. * added wazuh config. * added logging to the JsonModelElement. * added unittest for JsonModelElement with different key orders. * fixed unittests. * fixed JsonModelElement. * fixed unittest. * fixed runAminerJsonInputDemo and added runJsonDemo script. * added Json Tests to Jenkinsfile and testingwrapper. * removed debug outputs. * fixed Deepsource issues. * fixed Deepsource issues. * fixed json demo configs. * fixed jenkinsfile * fixed Jenkinsfile. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * HOTFIX 3 (#560) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * fixed JsonModelElement error and specified output in the VerboseUnparsedAtomHandler. * extended sleep time in Suspend mode test. * fixed JsonModelElement when key is missing. * fixed Deepsource issues. * added special key ALLOW_ALL for JsonModelElement. * fixed zero start handling of the JsonStateMachine. * fixed errors in JSON input data handling and JsonStateMachine. * fixed data. * created first config for elastic.log and fixed more errors. * finished json-elastic-demo.yml. * added config for eve.json and fixed more JSON parsing errors. * fixed more errors. * added config for journal.log. * added wazuh config. * added logging to the JsonModelElement. * added unittest for JsonModelElement with different key orders. * fixed unittests. * fixed JsonModelElement. * fixed unittest. * fixed runAminerJsonInputDemo and added runJsonDemo script. * added Json Tests to Jenkinsfile and testingwrapper. * removed debug outputs. * fixed Deepsource issues. * fixed Deepsource issues. * fixed json demo configs. * fixed jenkinsfile * fixed Jenkinsfile. * fixed Jenkinsfile. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 048 missing match path det (#555) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * changed MissingMAtchPathValueDetector to use a list of paths instead one single path. * fixed Deepsource issues. * added test with multiple lines. * fixed configs. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 043 rewrite date time me tests (#531) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * changed test to check WHITESPACE usage. * added new testcase design for FixedDME. * rewrote some unittests for the FixedDME. * finished rewriting unittests for the FixedDME. * fixed Deepsource issues. * added unittests for simple methods of FixedDME. * designed test cases for the DTME. * designed new test cases and extended existing ones from DateTimeModelElement. * added a new test case. * added unittests and changed initialization from None to 0 for DateTimeModelElement * added more unittests to DateTimeME. Rewrote DummyMatchContext and adapted all rewritten unittests. * added more unittests. * added more unittests. * added more unittests. * added the last unittests. * implemented missing tests and text_locale. * fixed DateTimeModelElement. * fixed Deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 049 log prefix (#558) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * added default value for log_line_prefix. * fixed Deepsource issues. * fixed deepsource issues. * fixed Deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 050 aminer demo fail on error (#562) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * changed runAminerDemo to fail if an error occurred. * fixed jsonConverterHandler demo config. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 051 remove sudo installed (#563) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * removed sudoInstalled from test scripts. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 052 suppress unparsed detector (#564) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * added suppress_unparsed config. * added suppress_unparsed to BaseSchema. * fixed error. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 053 reimplement dtme (#571) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * added handling of different timezones. * removed unneeded variable. * fixed deepsource issues. * fixed error with changed format specifier length. * removed comment. * added missing cases. * fixed MissingMatchPathValueDetector unittests. * changed datetime imports. * fixed Deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 055 esd path list optional (#575) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * made id_path_list in ESD optional. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 054 rewrite multi locale dtme (#572) * added DetectionTimestamp to json output. * fixed unittests. * fixed unittests. * fixed KafkaEventHandlerTest. * fixed testingwrapper. * fixed runAminerElasticsearchDemo.sh * undid changes in testingwrapper. * resolved conflicts * fixed kafka tests. * added handling of different timezones. * renamed function. * removed unneeded variable. * added some tests. * fixed deepsource issues. * added more unittests for MultiLocaleDTME. * added more unittests for the MultiLocaleDTME. * fixed error with changed format specifier length. * removed comment. * added more unittests. * added more tests. * added missing cases. * fixed MissingMatchPathValueDetector unittests. * added last unittests for MultiLocaleDTME. * fixed Deespource issues. * added MultiLocaleDTME to the DTME class. Fixed some unittests. * changed datetime imports. * fixed some issues. * changed tests. * implemented MultiLocaleDateTimeModelElement. * fixed YamlConfig for DateTimeModelElement and MultiLocaleDTME. * removed old MultiLocaleDateTimeModelElement. * fixed YamlConfig for MultiLocaleDateTimeModelElement. * fixed error in VTD. * fixed VTD. * fixed VTD. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * renamed schemas to .json. (#589) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * added null value handling in JsonModelElement. (#591) * added null value handling in JsonModelElement. * fixed order of ifs. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * Add floor and ceil in EFD check (#585) * Add floor and ceil in EFD check * Fix rounding and tests. * hotfix. (#593) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * Fix unparsed leap day in syslog parsing model (#582) * Release 2.3.0 (#594) * modified version of pyyaml in requirements.txt * New version v2.3.0 Co-authored-by: Wolfgang Hotwagner <wolfgang.hotwagner@ait.ac.at> * Update README.md * Update README.md * fix PYL-R1714 * removed orig-files from merge * fixed deepsource issues. (#599) * fixed deepsource issues. * fixed deepsource issues. * fixed deepsource issues for VCD. * fixed deepsource issues. * fixed deepsource issues. * fixed deepsource issues. * fixed deepsource issues. * fixed deepsource issues. * fixed deepsource issues. * fixed deepsource issues. * fixed deepsource issues. * fixed deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> Co-authored-by: hoeldg <georg.hoeld@ait.ac.at> Co-authored-by: root <max.landauer@ait.ac.at> Co-authored-by: 4cti0nfi9ure <16901151+4cti0nfi9ure@users.noreply.github.com> Co-authored-by: Max Landauer <landauermax@users.noreply.github.com> Co-authored-by: Wolfgang Hotwagner <wolfgang.hotwagner@ait.ac.at> Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> Co-authored-by: dITySoftware <56120276+dITySoftware@users.noreply.github.com> Co-authored-by: hoeldg <66625424+hoeldg@users.noreply.github.com> * aminer.py: resolved hardcoded username and gropname where user_id and… (#614) * aminer.py: resolved hardcoded username and gropname where user_id and group_id was expected * aminer.py: fixed bug in getgrnam(). username was taken instead of groupname Co-authored-by: Wolfgang Hotwagner <wolfgang.hotwagner@ait.ac.at> * Release 2.3.1 * removed merge-files * removed merge-files * fixed refactoring issues in AnalysisChild * removed old json-files from json-directory * fixed problems with merging Co-authored-by: hoeldg <georg.hoeld@ait.ac.at> Co-authored-by: root <max.landauer@ait.ac.at> Co-authored-by: 4cti0nfi9ure <16901151+4cti0nfi9ure@users.noreply.github.com> Co-authored-by: Max Landauer <landauermax@users.noreply.github.com> Co-authored-by: Wolfgang Hotwagner <wolfgang.hotwagner@ait.ac.at> Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> Co-authored-by: dITySoftware <56120276+dITySoftware@users.noreply.github.com> Co-authored-by: hoeldg <66625424+hoeldg@users.noreply.github.com> * prepared aminer for V2.4.0 (#745) Co-authored-by: Wolfgang Hotwagner <wolfgang.hotwagner@ait.ac.at> * Fixed a bug in JsonModelElement (#748) * 111 fixed handling of json objects. (#749) * fixed handling of json objects. * fixed error. * fixed error. * fixed deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * Fix ci and docs (#750) * removed unclean merge from docs/Configuration.rst * fix for race-condition in cleanup of ci-pipeline Co-authored-by: Wolfgang Hotwagner <wolfgang.hotwagner@ait.ac.at> * fixed deepsource issues. (#752) * fixed deepsource issues. * fixed deepsource issues. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 113 fixed unicode error in JsonME (#754) * added tests and fixed UnicodeDecodeError. * fixed config. * removed comment. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 114 fixed encoding errors when reading yaml configs. (#756) * fixed encoding errors when reading yaml configs. * fixed deepsource issue. * fixed config. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * Fix systemd script (#758) * set version-string to 2.4.1-dev * set absolut paths for binaries in systemd-script Co-authored-by: Wolfgang Hotwagner <wolfgang.hotwagner@ait.ac.at> * fixed encoding error. (#763) * fixed encoding error. * converted file to unix and added testline. * fixed encoding errors. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * added unittest for EMPTY_LIST and EMPTY_OBJECT. (#765) * added unittest for EMPTY_LIST and EMPTY_OBJECT. * added comment. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * TSA persistency_id (#767) * Added persistency_id * Added the variables acf_pause_area and num_periods_tsa_ini to the TSA * Added the variables in the docu and extended the persistency to load persistencies generated with build_sum_over_values * TSA: Removed the variables. * TSA: Added variables (#768) * Added the variables acf_pause_area and num_periods_tsa_ini. * Fixed Deepsource issues, adapted the docs * Fixed the bug (#762) * Feature valuerangedetector (#772) * Add id value to output * Add id value to output * Add value range detector * Fix deepsource issues * Fix deepsource issues * Fix deepsource issues * Fix test number in test * Feature charset detector (#773) * Add id value to output * Add id value to output * Add charset detector * Add test for charset detector * Add documentation for charset detector * Fix typo * Fix deepsource issues * Fix yaml unit test * Feature entropydetector (#776) * Add id value to output * Add id value to output * Add entropy detector * Add test for entropy detector * Add documentation * Fix deepsource issues * Fix deepsource issues * Fix yaml config test * Update EntropyDetectorTest.py Fix typos * fixed error where EMPTY_LIST and EMPTY_OBJECT could not be parsed from the yaml config. (#781) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * Renamed parameters of the ETD (#786) * Added the option to track on basis of the values of certain paths not only event types to the ETD (#790) * Added the functionality of id_path_list in the ETD and added the parameters id_path_list, allow_missing_id and allowed_id_tuples. * Fixed DeepSource Issues * Fixed Issues * Added counts, fixed merge issues * Fixed issue * Refined the ACF (#792) Co-authored-by: Max Landauer <landauermax@users.noreply.github.com> * 117 added solution for problem with output_event_handlers in JsonConverte… (#780) * added solution for problem with output_event_handlers in JsonConverterHandler. * fixed error. * fixed declarations with training mode. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 120 fixed error with \x encoded json data. (#784) * fixed error with \x encoded json data. * fixed error where \x was \\x. * fixed deepsource issue. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 121 fixed issue with paths in JsonModelElement. (#787) * fixed issue with paths in JsonModelElement. * implemented check to report unparsed atom if ALLOW_ALL is used with data with a type other than list or dict. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * added code to allow empty objects with optional data. (#788) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 119 fixed error with parsing floats in scientific notation with the JsonM… (#783) * fixed error with parsing floats in scientific notation with the JsonModelElement. * fixed json config. * moved format_float out of get_match_element. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 124 timezone format (#794) * added unittests for new timezone. * added allowed format in the DTME. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 123 added allow_all_fields parameter and unittests for it. (#793) * added allow_all_fields parameter and unittests for it. * fixed deepsource issues. * added input validation for allow_all_fields. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * added missing characters to the ApacheAccessModel. (#798) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * improved error message. (#799) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * added EMPTY_STRING option to the JsonModelElement. (#800) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * Fixed the falsely merged variable name (#810) * 129 add multiple analysis components to the demo configs (#803) * added DebugMatchRule to the Demo configs. * added ModuloTimeMatchRule to the demo configs. * fixed ValueDependentModuloTimeMatchRule and added it to the demo configs. * added IPv4InRFC1918MatchRule and ParallelMatchRule to the demo configs. added EventGenerationMatchAction to the schemas. * fixed typos. * added ValueDependentDelegatedMatchRule to the demo configs. * fixed unittest. * added ValueListMatchRule and ValueRangeMatchRule to the demo configs. * added StringRegexMatchRule and fixed outputs of demo configs. * added DebugHistoryMatchRule to the demo configs. * added SimpleMonotonicTimestampAdjust to the demo configs and fixed the Yaml for it. * added SimpleMonotonicTimestampAdjust to the demo configs. * fixed deepsource issues * fixed unittests. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * added simple tests for docker production images (#806) Co-authored-by: Wolfgang Hotwagner <wolfgang.hotwagner@ait.ac.at> * 130 added testingwrapper. (#813) * added testingwrapper. * added line in Jenkinsfile. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * fixed error. (#825) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * Documentation pca (#811) * Add id value to output * Add id value to output * Add PCA detector documentation * added slashes to some paths in the demo configs. (#839) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 131 added tests (#814) * added code to find all configs. * added config generation. * extended test of available configs. * added config files. * added logs for the ApacheAccessParsingModel and fixed the Model up. * added tests till AuditdParsingModel. * added tests for SuricataEventParsingModel. * added SuricataFastParsingModel tests. * added tests for SyslogParsingModel fixed ValueError in DTME. * added tests for ApacheAccessModel and AudispdParsingModel. * added more test of parsing models. * fixed test. * fixed dockerfile. * fixed dockerfiles. * fixed test. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 135 fix getting started (#838) * fixed getting started tests. * fixed SequenceDetector test. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * 133 Changed output of the JsonConverterHandler to be valid json data. (#836) * Changed output of the JsonConverterHandler to be valid json data. * fixed unittest. * fixed unittest. * fixed unittest. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * Feature docs (#822) * docs: added eventhandler * docs: added code-samples for eventhandlers * docs: added link to kafka page * docs: replaced analysis-pipeline image * docs: fixed requirements.txt * docs: removed requirements.txt from docs-path * documented some analyzing components * Update CONFIGURATION.rst Co-authored-by: Wolfgang Hotwagner <wolfgang.hotwagner@ait.ac.at> * 139 added possiblity to parse array of arrays. (#871) * added possiblity to parse array of arrays. * fixed deepsource issues. * fixed error. * fixed error. * fixed error. Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * renamed EMPTY_LIST to EMPTY_ARRAY (#872) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * Release 2.4.1 (#873) This commit updates changelog, debian/changelog and metadata for release 2.4.1 Co-authored-by: Wolfgang Hotwagner <wolfgang.hotwagner@ait.ac.at> * fixed jsonConverterHandler-demo-config. (#837) Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> * fixed FLK-D209 in JsonModelElementTest.py * fixed Blank line contains whitespace FLK-W293 in JsonModelElementTest.py * fixed Docstring missing in JsonModelElementTest.py * fixed Docstring missing in JsonModelElement.py Co-authored-by: hoeldg <georg.hoeld@ait.ac.at> Co-authored-by: root <max.landauer@ait.ac.at> Co-authored-by: 4cti0nfi9ure <16901151+4cti0nfi9ure@users.noreply.github.com> Co-authored-by: Max Landauer <landauermax@users.noreply.github.com> Co-authored-by: Wolfgang Hotwagner <wolfgang.hotwagner@ait.ac.at> Co-authored-by: Ernst Leierzopf <ernst.leierzopf.fl@ait.ac.at> Co-authored-by: dITySoftware <56120276+dITySoftware@users.noreply.github.com> Co-authored-by: hoeldg <66625424+hoeldg@users.noreply.github.com>
1 parent b04a779 commit 7ea5903

File tree

61 files changed

+4219
-1646
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+4219
-1646
lines changed

Jenkinsfile

+34-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def ubuntu18image = false
1212
def ubuntu20image = false
1313
def debianbusterimage = false
1414
def debianbullseyeimage = false
15+
def productionimage = false
1516
def docsimage = false
1617

1718
pipeline {
@@ -39,6 +40,11 @@ pipeline {
3940
}
4041
stage("Run Demo-Configs"){
4142
parallel {
43+
stage("available parsing models in conf-available") {
44+
steps {
45+
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runConfAvailableTest"
46+
}
47+
}
4248
stage("demo-config and jsonConverterHandler-demo-config") {
4349
steps {
4450
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runAminerDemo demo/aminer/demo-config.py"
@@ -77,6 +83,7 @@ pipeline {
7783
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runJsonDemo demo/aminerJsonInputDemo/json-eve-demo.yml"
7884
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runJsonDemo demo/aminerJsonInputDemo/json-journal-demo.yml"
7985
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runJsonDemo demo/aminerJsonInputDemo/json-wazuh-demo.yml"
86+
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runJsonDemo demo/aminerJsonInputDemo/windows.yml"
8087
}
8188
}
8289

@@ -95,20 +102,23 @@ pipeline {
95102
}
96103
steps {
97104
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runTryItOut development"
98-
// sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runGettingStarted development"
105+
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runGettingStarted development"
99106
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runHowToCreateYourOwnSequenceDetector development"
100107
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runHowToCreateYourOwnFrequencyDetector development"
101108
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runHowToMissingMatchPathValueDetector development"
102109
}
103110
}
104111

105-
stage("Wiki Tests - main"){
112+
stage("Wiki Tests - main"){
106113
when {
107114
branch "main"
108115
}
109116
steps {
110117
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runTryItOut main"
111-
// sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runGettingStarted main"
118+
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runGettingStarted main"
119+
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runHowToCreateYourOwnSequenceDetector main"
120+
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runHowToCreateYourOwnFrequencyDetector main"
121+
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runHowToMissingMatchPathValueDetector main"
112122
}
113123
}
114124

@@ -153,6 +163,23 @@ pipeline {
153163
}
154164
}
155165

166+
stage("Test Production Docker Image") {
167+
steps {
168+
script {
169+
productionimage = true
170+
}
171+
sh "docker build -f Dockerfile -t aecid/aminer-production:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID ."
172+
sh "mkdir -p /tmp/production-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID && mkdir /tmp/production-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID/persistency && mkdir /tmp/production-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID/logs"
173+
sh "cp aecid-testsuite/demo/aminer/access.log /tmp/production-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID/logs/"
174+
sh "cp -r source/root/etc/aminer /tmp/production-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID/aminercfg"
175+
sh "cp /tmp/production-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID/aminercfg/template_config.yml /tmp/production-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID/aminercfg/config.yml"
176+
sh "cp /tmp/production-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID/aminercfg/conf-available/generic/ApacheAccessModel.py /tmp/production-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID/aminercfg/conf-enabled"
177+
/* the result of timeout is negated with "!". This is because aminer returns 1 if timeout stops the process and otherwise 0. The way around is a valid result for a test */
178+
sh "cd /tmp/production-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID && ! timeout -s INT --preserve-status 5 docker run -v $PWD/aminercfg:/etc/aminer -v $PWD/persistency:/var/lib/aminer -v $PWD/logs:/logs --rm -it aecid/aminer-production:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID aminer"
179+
}
180+
}
181+
182+
156183
stage("Test Ubuntu 18.04") {
157184
when {
158185
expression {
@@ -217,6 +244,10 @@ pipeline {
217244
sh "docker rmi aecid/aminer-debian-buster:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID"
218245
sh "cd / && test -d /tmp/simplerun-buster-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID && rm -rf /tmp/simplerun-buster-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID"
219246
}
247+
if( productionimage == true ){
248+
sh "docker rmi aecid/aminer-production:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID"
249+
sh "cd / && test -d /tmp/production-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID && rm -rf /tmp/production-$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID"
250+
}
220251
if( ubuntu18image == true ){
221252
sh "docker rmi aecid/aminer-ubuntu-1804:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID"
222253
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This tool parses log data and allows to define analysis pipelines for anomaly de
88

99
In order to install logdata-anomaly-miner a **Linux system** with **python >= 3.6** is required. **Debian-based** distributions are currently recommended.
1010

11-
_See [requirements.txt](requirements.txt) for further module dependencies_
11+
_See [requirements.txt](https://github.com/ait-aecid/logdata-anomaly-miner/requirements.txt) for further module dependencies_
1212

1313

1414
## Installation

aecid-testsuite/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ ADD source/root/usr/lib/logdata-anomaly-miner /usr/lib/logdata-anomaly-miner
8080
# copy these files instead as symlinks would need absolute paths.
8181
ADD source/root/etc/aminer/conf-available/ait-lds/* /etc/aminer/conf-enabled/
8282
ADD source/root/etc/aminer/conf-available/generic/* /etc/aminer/conf-enabled/
83+
ADD source/root/etc/aminer/conf-available/ait-lds /etc/aminer/conf-available/ait-lds
84+
ADD source/root/etc/aminer/conf-available/generic /etc/aminer/conf-available/generic
8385

8486
# Entrypoint-wrapper
8587
ADD scripts/aminerwrapper.sh /aminerwrapper.sh

aecid-testsuite/demo/aminer/aminerDemo.sh

+15-4
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ sudo aminer --config "$FILE" &
2525

2626
#EventCorrelationDetector, NewMatchPathDetector
2727
#:<<Comment
28-
alphabet='abcdef'
28+
alphabet='ghijkl'
2929
alphabet_len=$(echo -n $alphabet | wc -m)
3030
for ((i=0; i<10000; i++)); do
3131
echo ${alphabet:$i % $alphabet_len:1} >> /tmp/syslog
3232
sleep 0.0001
3333
done
3434
#Comment
3535

36-
#EnhancedNewMatchPathValueComboDetector, NewMatchPathValueDetector
36+
#EnhancedNewMatchPathValueComboDetector, NewMatchPathValueDetector, ModuloTimeMatchRule
3737
#:<<Comment
3838
R=`shuf -i 1-3 -n 1`
3939
for ((i=0; i<R; i++)); do
@@ -161,6 +161,9 @@ echo 'type=SYSCALL msg=audit(1580367400.000:9): arch=c000003e syscall=2 success=
161161
echo 'type=PATH msg=audit(1580367401.000:9): item=0 name="three" inode=790106 dev=fe:01 mode=0100666 ouid=1000 ogid=1000 rdev=00:00 nametype=NORMAL' >> /tmp/syslog
162162
echo 'type=PATH msg=audit(1580367402.000:10): item=0 name="one" inode=790106 dev=fe:01 mode=0100666 ouid=1000 ogid=1000 rdev=00:00 nametype=NORMAL' >> /tmp/syslog
163163
echo 'type=SYSCALL msg=audit(1580367403.000:10): arch=c000003e syscall=3 success=yes exit=21 a0=7ffda5863060 a1=0 a2=1b6 a3=4f items=1 ppid=22913 pid=13187 auid=4294967295 uid=33 gid=33 euid=33 suid=33 fsuid=33 egid=33 sgid=33 fsgid=33 tty=(none) ses=4294967295 comm="apache2" exe="/usr/sbin/apache2" key=(null)' >> /tmp/syslog
164+
165+
# StringRegexMatchRule
166+
echo 'type=SYSCALL msg=audit(1580367403.000:10): arch=c000003e syscall=3 success=no exit=21 a0=7ffda5863060 a1=0 a2=1b6 a3=4f items=1 ppid=22913 pid=13187 auid=4294967295 uid=33 gid=33 euid=33 suid=33 fsuid=33 egid=33 sgid=33 fsgid=33 tty=(none) ses=4294967295 comm="apache2" exe="/usr/sbin/apache2" key=(null)' >> /tmp/syslog
164167
#Comment
165168

166169
#TimeCorrelationDetector
@@ -228,21 +231,29 @@ echo "match data: 25000" >> /tmp/syslog
228231
echo "b654686973206973206a7573742061206e6f726d616c2074657874" >> /tmp/syslog
229232
# IpAddressModelElement
230233
echo "Gateway IP-Address: 192.168.128.225" >> /tmp/syslog
234+
# IPv4InRFC1918MatchRule, ValueListMatchRule
235+
echo "Gateway IP-Address: 8.8.8.8" >> /tmp/syslog
236+
# IPv4InRFC1918MatchRule, ValueListMatchRule
237+
echo "Gateway IP-Address: 8.8.4.4" >> /tmp/syslog
238+
# IPv4InRFC1918MatchRule, ValueRangeMatchRule
239+
echo "Gateway IP-Address: 10.0.0.0" >> /tmp/syslog
240+
# IPv4InRFC1918MatchRule, ValueRangeMatchRule
241+
echo "Gateway IP-Address: 11.0.0.0" >> /tmp/syslog
231242
# MultiLocaleDateTimeModelElement
232243
echo "Feb 25 2019" >> /tmp/syslog
233244
# OptionalMatchModelElement
234245
echo "The-searched-element-was-found!" >> /tmp/syslog
235246
# RepeatedElementDataModelElement
236247
for i in {1..5}; do
237248
R=`shuf -i 1-45 -n 1`
238-
echo "drawn number: $R" | tr -d "\n" >> /tmp/syslog
249+
echo "[drawn number]: $R" | tr -d "\n" >> /tmp/syslog
239250
done
240251
echo "" >> /tmp/syslog
241252
# VariableByteDataModelElement
242253
echo "---------------------------------------------------------------------" >> /tmp/syslog
243254
# WhiteSpaceLimitedDataModelElement
244255
alphabet="abcdefghijklmnopqrstuvwxyz "
245-
text=""
256+
text="z"
246257
for i in {1..1000}; do
247258
R=`shuf -i 0-26 -n 1`
248259
text=$text${alphabet:R:1}

aecid-testsuite/demo/aminer/demo-config.py

+38-9
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def build_analysis_pipeline(analysis_context):
111111
DelimitedDataModelElement('Data', b'%'), AnyByteDataModelElement('Rest')]
112112

113113
service_children_login_details = [
114-
FixedDataModelElement('User', b'User '), DelimitedDataModelElement('Username', b' '),
114+
FixedDataModelElement('User/LoginDetails', b'User '), DelimitedDataModelElement('Username', b' '),
115115
FixedWordlistDataModelElement('Status', [b' logged in', b' logged out']), OptionalMatchModelElement(
116116
'PastTime', SequenceModelElement('Time', [
117117
FixedDataModelElement('Blank', b' '), DecimalIntegerValueModelElement('Minutes'),
@@ -134,7 +134,7 @@ def build_analysis_pipeline(analysis_context):
134134
DateTimeModelElement('DTM', date_format_string)]
135135

136136
service_children_user_ip_address = [
137-
FixedDataModelElement('User', b'User '), DelimitedDataModelElement('Username', b' '),
137+
FixedDataModelElement('User/UserIPAddress', b'User '), DelimitedDataModelElement('Username', b' '),
138138
FixedDataModelElement('Action', b' changed IP address to '), IpAddressDataModelElement('IP')]
139139

140140
service_children_cron_job_announcement = [
@@ -159,7 +159,8 @@ def build_analysis_pipeline(analysis_context):
159159
FixedDataModelElement('name_string', b' name="'), DelimitedDataModelElement('name', b'"'),
160160
FixedDataModelElement('inode_string', b'" inode='), DecimalIntegerValueModelElement('inode'),
161161
FixedDataModelElement('dev_string', b' dev='), DelimitedDataModelElement('dev', b' '),
162-
FixedDataModelElement('mode_string', b' mode='), DecimalIntegerValueModelElement('mode'),
162+
FixedDataModelElement('mode_string', b' mode='),
163+
DecimalIntegerValueModelElement('mode', value_pad_type=DecimalIntegerValueModelElement.PAD_TYPE_ZERO),
163164
FixedDataModelElement('ouid_string', b' ouid='), DecimalIntegerValueModelElement('ouid'),
164165
FixedDataModelElement('ogid_string', b' ogid='), DecimalIntegerValueModelElement('ogid'),
165166
FixedDataModelElement('rdev_string', b' rdev='), DelimitedDataModelElement('rdev', b' '),
@@ -202,7 +203,7 @@ def build_analysis_pipeline(analysis_context):
202203
MultiLocaleDateTimeModelElement('MultiLocaleDateTimeModelElement', [(b'%b %d %Y', None, '%s.%s' % loc)]))
203204
service_children_parsing_model_element.append(
204205
RepeatedElementDataModelElement('RepeatedElementDataModelElement', SequenceModelElement('SequenceModelElement', [
205-
FixedDataModelElement('FixedDataModelElement', b'drawn number: '),
206+
FixedDataModelElement('FixedDataModelElement', b'[drawn number]: '),
206207
DecimalIntegerValueModelElement('DecimalIntegerValueModelElement')]), 1))
207208
service_children_parsing_model_element.append(VariableByteDataModelElement('VariableByteDataModelElement', b'-@#'))
208209
service_children_parsing_model_element.append(
@@ -215,11 +216,11 @@ def build_analysis_pipeline(analysis_context):
215216
# The OptionalMatchModelElement must be paired with a FirstMatchModelElement because it accepts all data and thus no data gets to the
216217
# AnyByteDataModelElement. The AnyByteDataModelElement must be last, because all bytes are accepted.
217218
service_children_parsing_model_element.append(OptionalMatchModelElement(
218-
'OptionalMatchModelElement', FirstMatchModelElement('FirstMatchModelElement', [
219+
'/', FirstMatchModelElement('FirstMatchModelElement//optional', [
219220
FixedDataModelElement('FixedDataModelElement', b'The-searched-element-was-found!'), SequenceModelElement('se', [
220221
FixedDataModelElement('FixedDME', b'Any:'), AnyByteDataModelElement('AnyByteDataModelElement')])])))
221222

222-
alphabet = b'abcdef'
223+
alphabet = b'ghijkl'
223224
service_children_ecd = []
224225
for _, char in enumerate(alphabet):
225226
char = bytes([char])
@@ -280,10 +281,12 @@ def build_analysis_pipeline(analysis_context):
280281
Rules.OrMatchRule([
281282
Rules.AndMatchRule([
282283
Rules.PathExistsMatchRule('/model/LoginDetails/PastTime/Time/Minutes'),
283-
Rules.NegationMatchRule(Rules.ValueMatchRule('/model/LoginDetails/Username', b'root'))]),
284+
Rules.NegationMatchRule(Rules.ValueMatchRule('/model/LoginDetails/Username', b'root')),
285+
Rules.DebugMatchRule(debug_match_result=True)]),
284286
Rules.AndMatchRule([
285287
Rules.NegationMatchRule(Rules.PathExistsMatchRule('/model/LoginDetails/PastTime/Time/Minutes')),
286-
Rules.PathExistsMatchRule('/model/LoginDetails')]),
288+
Rules.PathExistsMatchRule('/model/LoginDetails'),
289+
Rules.DebugMatchRule(debug_match_result=True)]),
287290
Rules.NegationMatchRule(Rules.PathExistsMatchRule('/model/LoginDetails'))])]
288291

289292
allowlist_violation_detector = AllowlistViolationDetector(analysis_context.aminer_config, allowlist_rules, anomaly_event_handlers,
@@ -325,7 +328,7 @@ def build_analysis_pipeline(analysis_context):
325328

326329
from aminer.analysis.EventSequenceDetector import EventSequenceDetector
327330
esd = EventSequenceDetector(analysis_context.aminer_config, anomaly_event_handlers, ['/model/ParsingME'], ignore_list=[
328-
'/model/ECD/a', '/model/ECD/b', '/model/ECD/c', '/model/ECD/d', '/model/ECD/e', '/model/ECD/f', '/model/Random',
331+
'/model/ECD/g', '/model/ECD/h', '/model/ECD/i', '/model/ECD/j', '/model/ECD/k', '/model/ECD/l', '/model/Random',
329332
'/model/RandomTime', '/model/DailyCron'])
330333
analysis_context.register_component(esd, component_name="EventSequenceDetector")
331334
atom_filter.add_handler(esd)
@@ -360,6 +363,32 @@ def tuple_transformation_function(match_value_list):
360363
analysis_context.register_component(enhanced_new_match_path_value_combo_detector, component_name="EnhancedNewValueCombo")
361364
atom_filter.add_handler(enhanced_new_match_path_value_combo_detector)
362365

366+
import re
367+
ip_match_action = Rules.EventGenerationMatchAction(
368+
"Analysis.Rules.IPv4InRFC1918MatchRule", "Private IP address occurred!", anomaly_event_handlers)
369+
370+
vdmt = Rules.ValueDependentModuloTimeMatchRule(None, 3, ["/model/ECD/j", "/model/ECD/k", "/model/ECD/l"], {b"e": [0, 2.95]}, [0, 3])
371+
mt = Rules.ModuloTimeMatchRule(None, 3, 0, 3, None)
372+
time_allowlist_rules = [
373+
Rules.AndMatchRule([
374+
Rules.ParallelMatchRule([
375+
Rules.ValueDependentDelegatedMatchRule([
376+
'/model/ECD/g', '/model/ECD/h', '/model/ECD/i', '/model/ECD/j', '/model/ECD/k', '/model/ECD/l'], {
377+
(b"a",): mt, (b"b",): mt, (b"c",): mt, (b"d",): vdmt, (b"e",): vdmt, (b"f",): vdmt, None: mt}, mt),
378+
Rules.IPv4InRFC1918MatchRule("/model/ParsingME/se2/IpAddressDataModelElement", ip_match_action),
379+
Rules.DebugHistoryMatchRule(debug_match_result=True)
380+
]),
381+
# IP addresses 8.8.8.8, 8.8.4.4 and 10.0.0.0 - 10.255.255.255 are not allowed
382+
Rules.NegationMatchRule(Rules.ValueListMatchRule("/model/ParsingME/se2/IpAddressDataModelElement", [134744072, 134743044])),
383+
Rules.NegationMatchRule(Rules.ValueRangeMatchRule("/model/ParsingME/se2/IpAddressDataModelElement", 167772160, 184549375)),
384+
Rules.NegationMatchRule(Rules.StringRegexMatchRule("/model/type/syscall/success", re.compile(b"^no$")))
385+
])
386+
]
387+
time_allowlist_violation_detector = AllowlistViolationDetector(
388+
analysis_context.aminer_config, time_allowlist_rules, anomaly_event_handlers, output_log_line=True)
389+
analysis_context.register_component(time_allowlist_violation_detector, component_name="TimeAllowlist")
390+
atom_filter.add_handler(time_allowlist_violation_detector)
391+
363392
from aminer.analysis.HistogramAnalysis import HistogramAnalysis, LinearNumericBinDefinition, ModuloTimeBinDefinition, \
364393
PathDependentHistogramAnalysis
365394
modulo_time_bin_definition = ModuloTimeBinDefinition(86400, 3600, 0, 1, 24, True)

0 commit comments

Comments
 (0)