Commit Graph

51 Commits

Author SHA1 Message Date
pyth0n1c 9fc009a44d Removed:
SPLUNK_SECURITY_ESSENTIALS
SPLUNK_APP_FOR_AWS
from default app baseline.
They are not required
for testing as they just
provide some dashboards.
2022-02-18 11:17:21 -08:00
pyth0n1c ba05264c80 Branch was auto-updated. 2022-02-17 11:42:02 -08:00
pyth0n1c 05898d1c72 Updated the test config used for github actions and the workflow to remove the use of the splunkbase username and password secrets. After this is merged, we can remove them from the repository. We will simply use the versions that we update in S3. 2022-02-15 15:43:36 -08:00
pyth0n1c 580dba242f Added ability to Ctrl-C/SIGINT the testing process and have it gracefully finish. This stops the containers and writes out partial progress to the output file. 2022-02-15 15:37:17 -08:00
pyth0n1c 4f0622a5aa Update to latest Splunkbase Windows Sysmon 2022-02-10 16:24:17 -08:00
pyth0n1c 889f27064c Downloaded apps are now cached by default. This can save a huge amount of time on startup, especially for a large number of containers or for slower connections. Otherwise, each container that is set up needs over 600MB of throughput. 2022-02-10 15:50:25 -08:00
pyth0n1c ec90ee19d5 Now, when one or more detection tests fail in the CI/CD,
it will cause the workflow to fail. In turn, this would
prevent a PR from being merged. However, this
lets a developer know more easily (without needing
to dive into the GitHub Actions logs) whether or
not their detections passed successfully.  It also
upload an extra file called DetectionFailureManifest
which is a test file for ONLY the failed tests.
You can run this locally on your machine to 
quickly, interactively debug the failures only.
2022-02-10 09:17:23 -08:00
pyth0n1c 428785a15f Revert "Now, failing one or more CI/CD Tests causes"
This reverts commit 55e94c3eab.
2022-02-10 09:07:02 -08:00
pyth0n1c 55e94c3eab Now, failing one or more CI/CD Tests causes
the workflow to fail. An additional file is 
also uploaded called "replicate_failures"
which allows the user to easily retest
just the failed tests locally.
2022-02-10 09:04:04 -08:00
pyth0n1c d0afcb458d Check to ensure that Splunkbase username and password are passed in the config or command line when one or more apps is lacking http_path or local_path. Before, this would be caught later on and not in the beginning. Also, the previous commit added new http_paths for all of the default apps. 2022-02-09 15:37:34 -08:00
pyth0n1c c45c1335ae Two changes. First, removed the separate splunkbase_apps and local_apps sections of the config file. They are now unified under a single section called apps. If you don't provide a splunkbase username and password, it will simply use the HTTP target/local_paths. If you do provide those, then it will donwload from splunkbase. However, local_path will override both of these. 2022-02-09 15:23:04 -08:00
Michael Hart 39d7121dcd Updating mlmodel to 5.3.x specification as well as the test apparatus 2022-01-25 21:42:16 -05:00
pyth0n1c 5ecb9f5fbd Tests were failing on GH Actions that should not have been failing. This is likely due to not enough time waiting for indexing to fail. Doubled the time we wait between indexing complete check. Also moved from hourly tests of all detections to daily. 2022-01-13 15:50:07 -08:00
pyth0n1c 67ef36117b Fixed bad printout to console where, if a test failed but --interactive mode was declared, the test would print out as having succeeded. Improved error handling if there is an issue where an uploaded data file generates and exception. 2022-01-13 12:03:49 -08:00
pyth0n1c 6a7f917707 Fix to requirements to include psutil. Removed import of deleted modules/aws_service.py 2022-01-12 16:40:56 -08:00
pyth0n1c cdc902e052 Removed ansible from requirements and boto3 from requirements. Neither are used anymore 2022-01-12 16:35:11 -08:00
pyth0n1c 8d669b66f8 Removing previous file that was added accidentally in last commit. Updating the detection-testing.yml file to remove ls of non-existant directory as intended 2022-01-12 16:17:38 -08:00
pyth0n1c fc189e92ee Removed ls or directory that didn't exist anymore
in detection-testing.yml
2022-01-12 16:10:21 -08:00
pyth0n1c 73998ca5c1 Changed summarize_json.py to return success
(0) code even if there are failures or errors found
during testing during the initial testing of CI/CD.
This is because we don't want these to hold up
the build process. Eventually we will report actual
success/failure of all tests after we have the
opportunity to validate the new testing pipeline and
make updates to failing searches.
2022-01-12 14:57:17 -08:00
pyth0n1c b12ccf0cd2 Added a readme.md. Need to check that the
markdown renders appropriately
2022-01-12 10:54:45 -08:00
pyth0n1c 3afef5d559 Updated the error for providing both PR and
commit_hash to a warning.  This was causing
an error during PR triggered testing in github
actions as both of these are provided.  Perhaps
we actually can include both of these and can
get old PRs based on commit hash, but until
then we will just test using the PR number and
ignore the commit_hash if we find both.
2022-01-12 10:38:23 -08:00
pyth0n1c 7b3029b187 Removed splunkbase-only test_config file. Pushing to run a test on all. Will push again for changes only. 2022-01-11 16:35:19 -08:00
pyth0n1c 23da2f45d2 removing file that was accidentally added. 2022-01-11 16:06:47 -08:00
pyth0n1c e3ba9f0074 Finished removing dead code from DataManipulation.
Added the new_sysmon as an additional default application.
While it is not ideal to have the old and new sysmons installed
side by side, there are some detection that only work with one
and not the other.  We will run both until we have moved
all detections to the new sysmon.
2022-01-11 16:03:04 -08:00
pyth0n1c 6a6bd04819 Removing some dead code from
DataManipulation.py
2022-01-11 15:46:38 -08:00
pyth0n1c 79d13fccef Converted DataManipulation from using FileInput to with open, readline, etc. We needed to do this because FileInput with inplace=True remaps the print command, which may be called by several parallel threads running DataManipulation or to output status info, will cause a crash if multiple threads write to it. 2022-01-11 14:18:04 -08:00
pyth0n1c 81df4e0eec A bunch of changes to support parallel testing and waiting to ensure data has been properly ingested/indexed before running a test. Still double-checking edge cases for this. Also improved some error printouts and status printouts. When a test completes, it now includes its runtime in its pass/fail/error print. 2022-01-11 11:59:26 -08:00
pyth0n1c 1dea66d75c Added authorize.conf.tar to make it possible to delete data from completed searches properly. 2022-01-05 15:26:43 -08:00
pyth0n1c 64abbe4458 Significant changes. Most importantly, instead of a hard-coded wait time after uploading data, we poll to make sure that all the data has been indexed. When this is complete, we move ahead with the test. While this costs extra in terms of CPU and Disk access, it usually allows us to go much faster since wait time is usually just a few seconds. Better tracking of time per test and time estimation. 2022-01-05 14:39:13 -08:00
pyth0n1c eb48e000a8 Updated default app loadout for splunkbase.
Added splunk_ta_for_nginz,
splunk_security_essentials,
and ta_for_zeek.
2021-12-22 14:05:55 -08:00
pyth0n1c dc3fc8296d Added a config file to run tests against latest splunkbase apps.
Also, added slightly better error output for certain types
of test failures.  Finally updated splunkbase app defaults in
validate_args, but they are commented out for now while we
use the S3 versions.
2021-12-22 13:02:21 -08:00
pyth0n1c 05821f4303 Fixed some parts of the CI that don't give a descriptive error message
in the output files when a search generates certain types of errors.
For example, an error where it cannot reach the Splunk endpoint
server.  These are rare, but good to have.
2021-12-21 14:46:44 -08:00
pyth0n1c 47e155b747 Changed back to one container per
GH Action Machine config with the
mock option.  Also, shuffling detections after they are put into a
list to distribute runtime and load as
much as possible.
2021-12-21 14:22:33 -08:00
pyth0n1c 5f972f734f Re-push to test everything with 2 containers per GH Actions machine. 2021-12-21 11:00:11 -08:00
pyth0n1c 9ba7abd0e8 Fixed a small error. If you specified a PR number and a branch that did not exist, then it would create a branch and that would be bad. Now, when you specify a branch and a PR number, the branch MUST exist. If not, we fail and bail. 2021-12-21 10:44:50 -08:00
pyth0n1c 63555bc531 Added some more robust error handling to the high level test runner. It looks like we were getting errors pulling the image from docker hub - was it down... 2021-12-20 14:45:01 -08:00
pyth0n1c d4aae32b3d Removed Python 2 which was previously used for splunk packaging toolkit. Replaced with python3 2021-12-20 14:26:57 -08:00
pyth0n1c 264dbfb7f4 Fixed up and error that could occur where the environment is not properly set up if the users requested PERSIST_SECURITY_CONTENT, but the directory did not exist. Also fixed the default argument for this on GitHub Actions., 2021-12-20 13:58:58 -08:00
pyth0n1c d26032b912 Updated the github_actions config with S3 binary
paths.Updated the default args to include web and
experimental as possible folders with Web being a
default.
2021-12-20 13:38:51 -08:00
pyth0n1c 0e26dc76ff Changed so that we no longer start a container if
we know that we will not have a test for it. For example,
if we try to start 4 containers by have only 2 tests at
the beginning we will only start 2 containers. This saves
a lot of startup time and resources. There is a descriptive
printout for this as well.
Also, bumped the maximum startup time for 6 minutes to
10 minutes.  This, combined with the system info from
the previous commit should let us determine if we can
bump the number of containers per GitHub Actions
VM from 1 to 2 or more.
2021-12-20 13:17:46 -08:00
pyth0n1c 7230b5c63d Print out some system usage information on each update.
This will help users dianose if their systems are overburdend
and also helps us figure out what the appropriate number
of containers to run on cloud infrastructure, like GitHub
Actions, may be without logging directly into the machine
doing the testing.  In some cases, we can't log into those
machines by design.  If you're running tests at home, you
can also just listen to the volume of your computer's fans.
2021-12-20 12:02:11 -08:00
pyth0n1c cc8113ec86 Fixed output of manifest for detection_failure_manifest.json. Previously, it contained mostly default settings and most notably did not container the proper apps configuration. Also updated a few documentation strings. 2021-12-20 08:34:54 -08:00
pyth0n1c 76364bf1c0 Updated the default configuration to use attack_range
apps stored on S3.  Pointed at the PATCHED linux_sysmon.
Added a slight delay in between starts of containers for
performance reasons.  Enabled better handling and ability
to download http_path local apps to a folder instead of
passing them in as string for the container to download.
2021-12-17 20:06:42 -08:00
pyth0n1c c8082984f0 A large number of changes and fixes to make
everything smoother. The largest differences
are improving detection of containers that
take too long to start (or that crash while)
they are starting by adding a timeout. That
timeout is set to 360 seconds and might need
to be tuned in the future to a larger number
since this was tested on a fast machine with
fast network.  The other large change is an
initial pass at updating and committing
detections that have passed the test back
to the repo. This still needs a lot of testing and
refinement.
2021-12-17 10:13:49 -08:00
pyth0n1c 34cfcef5cb Fixed a bug where we were printing the wrong skipped tests due to folder names. Instead we were printing the tests we did not skip. 2021-12-14 13:14:31 -08:00
pyth0n1c a475df1cb0 Removed throwing error if experimental is
in the path of a test/detection.
2021-12-14 13:01:07 -08:00
pyth0n1c 49695ed2c5 Preparing fixes for properly allowing testing to include or exclude folders. For example, by default we will not include and test detections or tests in experimental. 2021-12-14 12:59:17 -08:00
pyth0n1c 04ba2b5ae6 Merge branch 'develop' into DetectionTestingDocker 2021-12-08 13:04:28 -08:00
pyth0n1c cc4f91d8c2 Moved everything into the bin directory. 2021-12-08 12:46:06 -08:00
dependabot[bot] 0838b26f2e Bump ansible in /bin/automated_detection_testing/ci/labeled_data
Bumps [ansible](https://github.com/ansible/ansible) from 2.9.20 to 4.2.0.
- [Release notes](https://github.com/ansible/ansible/releases)
- [Commits](https://github.com/ansible/ansible/commits)

---
updated-dependencies:
- dependency-name: ansible
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-04 02:08:58 +00:00