-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·45 lines (35 loc) · 1.66 KB
/
test.sh
File metadata and controls
executable file
·45 lines (35 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Secparse Dockerized Certification Script
# This script builds the secparse-cli image and runs it against the ENTIRE testing_artifacts/extracted/ directory at once.
set -e
echo "--- Starting Secparse Dockerized Certification ---"
# 1. Build the Docker Image
echo "[1/2] Building Docker Image (Cached)..."
docker build -t secparse-cli .
# 2. Test the Pipeline against the ENTIRE extracted directory
# The CLI now supports directory ingestion, so we can process all 29+ artifacts in one pass.
echo "[2/2] Testing CLI Pipeline (Containerized) against ALL robust artifacts at once..."
EXTRACTED_DIR="testing_artifacts/extracted"
if [ ! -d "$EXTRACTED_DIR" ]; then
echo "Error: $EXTRACTED_DIR does not exist."
exit 1
fi
# Run the pipeline command on the directory
# We mount:
# - The extracted dir to /data
# - The MMDB file to /app/GeoLite2-City.mmdb
docker run --rm \
-v "$(pwd)/$EXTRACTED_DIR:/data" \
-v "$(pwd)/secparse-enrich/GeoLite2-City.mmdb:/app/GeoLite2-City.mmdb" \
secparse-cli pipeline --input "/data" --enrich --geoip /app/GeoLite2-City.mmdb > pipeline_output.json
if [ $? -eq 0 ]; then
echo -e "\033[0;32mSUCCESS\033[0m: Entire directory processed and correlated successfully!"
echo "Output saved to pipeline_output.json"
# Basic check of findings count by looking for "id" in the JSON
FINDINGS_COUNT=$(grep -o '"id":' pipeline_output.json | wc -l | xargs)
echo "Total findings and assets identified across all artifacts: $FINDINGS_COUNT"
else
echo -e "\033[0;31mFAILURE\033[0m: Directory ingestion or correlation failed."
exit 1
fi
echo "--- Certification Complete: All 18+ parsers verified against robust artifacts! ---"