mirror of
https://github.com/splunk/security_content
synced 2026-06-08 17:32:49 +00:00
Branch was auto-updated.
This commit is contained in:
+1
-15
@@ -24,23 +24,11 @@ apt-run: &apt-install
|
||||
command: |
|
||||
sudo apt update -qq
|
||||
sudo apt install -y python-dev python3-dev jq -qq
|
||||
# install go for other testing tools
|
||||
# but first lets clean up the env
|
||||
if [ -f goinstall.sh ]; then
|
||||
rm goinstall.sh
|
||||
fi
|
||||
if [ -d ~/.go ]; then
|
||||
rm -rf ~/.go
|
||||
fi
|
||||
wget https://raw.githubusercontent.com/canha/golang-tools-install-script/master/goinstall.sh
|
||||
sudo chown circleci goinstall.sh
|
||||
chmod +x goinstall.sh
|
||||
./goinstall.sh
|
||||
|
||||
executors:
|
||||
content-executor:
|
||||
docker:
|
||||
- image: circleci/python:latest
|
||||
- image: cimg/python:3.9.5-browsers
|
||||
working_directory: ~/repo
|
||||
|
||||
jobs:
|
||||
@@ -193,8 +181,6 @@ jobs:
|
||||
name: install splunk packaging toolkit (slim)
|
||||
command: |
|
||||
cd ~/slim-latest
|
||||
sudo pip install --upgrade pip setuptools
|
||||
sudo pip install virtualenv
|
||||
virtualenv --python=/usr/bin/python2.7 --clear venv
|
||||
source venv/bin/activate
|
||||
pip install semantic_version
|
||||
|
||||
@@ -47,7 +47,6 @@ def generate_doc_stories(REPO_PATH, OUTPUT_DIR, TEMPLATE_PATH, attack, sorted_de
|
||||
manifest_files = []
|
||||
for root, dirs, files in walk(REPO_PATH + '/stories'):
|
||||
for file in files:
|
||||
print(root)
|
||||
if file.endswith(".yml") and root == './stories':
|
||||
manifest_files.append((path.join(root, file)))
|
||||
|
||||
|
||||
+9
-4
@@ -30,6 +30,7 @@ def load_file(file_path):
|
||||
|
||||
|
||||
def main(args):
|
||||
print("generated reporting information for our detections")
|
||||
|
||||
# process all detections
|
||||
REPO_PATH = os.path.join(os.path.dirname(__file__), '../')
|
||||
@@ -42,13 +43,14 @@ def main(args):
|
||||
|
||||
detections_all = detections.copy()
|
||||
|
||||
#lets exclude all deprecated detections from our reporting
|
||||
#lets exclude all deprecated detections from our reporting and experimental
|
||||
# detections_all.extend(load_objects("detections/deprecated/*.yml", REPO_PATH))
|
||||
|
||||
detections_all.extend(load_objects("detections/experimental/*/*.yml", REPO_PATH))
|
||||
# detections_all.extend(load_objects("detections/experimental/*/*.yml", REPO_PATH))
|
||||
count_detections_all = len(detections_all)
|
||||
print("detection count: {}".format(count_detections_all))
|
||||
|
||||
tests = load_objects("tests/*/*.yml", REPO_PATH)
|
||||
print("test count: {}".format(len(tests)))
|
||||
|
||||
counter_tests=0
|
||||
counter_detection=0
|
||||
@@ -59,8 +61,9 @@ def main(args):
|
||||
for test in tests:
|
||||
counter_tests=counter_tests+1
|
||||
|
||||
detection_coverage = "{:.0%}".format(counter_detection/counter_tests)
|
||||
|
||||
detection_coverage = "{:.0%}".format(counter_tests/counter_detection)
|
||||
print("detection_coverage {}".format(detection_coverage))
|
||||
|
||||
TEMPLATE_PATH = os.path.join(os.path.dirname(__file__), 'jinja2_templates')
|
||||
OUTPUT_PATH = os.path.join(os.path.dirname(__file__), 'reporting')
|
||||
@@ -70,12 +73,14 @@ def main(args):
|
||||
output = template.render(detection_coverage=detection_coverage)
|
||||
with open(output_path, 'w', encoding="utf-8") as f:
|
||||
f.write(output)
|
||||
print("writting detection coverage report: {}".format(output_path))
|
||||
|
||||
template = j2_env.get_template('detection_count.j2')
|
||||
output_path = path.join(OUTPUT_PATH, 'detection_count.svg')
|
||||
output = template.render(detection_count=count_detections_all)
|
||||
with open(output_path, 'w', encoding="utf-8") as f:
|
||||
f.write(output)
|
||||
print("writting detection count report: {}".format(output_path))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
<rect rx="3" width="105" height="20" fill="url(#a)"/>
|
||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
||||
<text x="30" y="14">detections</text>
|
||||
<text x="83" y="14">440</text>
|
||||
<text x="83" y="14">368</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 654 B After Width: | Height: | Size: 654 B |
@@ -13,6 +13,6 @@
|
||||
<rect rx="3" width="100" height="20" fill="url(#a)"/>
|
||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
||||
<text x="30" y="14">coverage</text>
|
||||
<text x="80" y="14">100%</text>
|
||||
<text x="80" y="14">99%</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 653 B After Width: | Height: | Size: 652 B |
Reference in New Issue
Block a user