Skip to content

Commit 73fc526

Browse files
gabakermjcarson
authored andcommitted
feat(tools): Added more static analysis tools
This adds additional static analysis tools including sqlitedump, trufflehog, trivy, and a custom Rust Volatility tool. This also patches a tagging bug in detect-it-easy that left extra spaces in the value. And finally this enables the pharos pipelines within the Thorium toolbox.
1 parent 7622f27 commit 73fc526

File tree

68 files changed

+9456
-171
lines changed

Some content is hidden

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

68 files changed

+9456
-171
lines changed

tools/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The `build-actions-matrix.py` script is used by our gitlab actions pipeline to d
1313
To update the `toolbox.json` file before committing changes, run the `build-toolbox-manifest.py`:
1414

1515
```bash
16-
python3 scripts/build-toolbox-manifest.py config.toml
16+
python3 scripts/build-toolbox-manifest.py -c config.toml
1717
```
1818

1919
### Toolbox Config (`config.toml`)
@@ -53,4 +53,4 @@ config_from = "antivirus.json"
5353

5454
[images.clamav]
5555
version = "latest"
56-
```
56+
```

tools/images/exiftool.org/tools/exiftool/exiftool.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"commit": null,
2323
"output": "None"
2424
},
25-
"description": "",
25+
"description": null,
2626
"security_context": {
2727
"user": null,
2828
"group": null,

tools/images/github.com/H3xKatana/autoVolatility3/manifest.toml renamed to tools/images/github.com/H3xKatana/autoVolatility3/manifest.toml.exclude

File renamed without changes.

tools/images/github.com/ReFirmLabs/binwalk/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ FROM $IMAGE
33

44
WORKDIR /app
55

6+
RUN cargo version
7+
8+
RUN apt clean all && \
9+
apt update && \
10+
apt install -y p7zip-full && \
11+
apt clean && \
12+
rm -rf /var/lib/apt/lists/*
13+
614
RUN cargo install binwalk
715

816
COPY wrapper.bash /app/.

tools/images/github.com/ReFirmLabs/binwalk/wrapper.bash

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
mkdir -p /tmp/thorium/binwalk
44
binwalk -e $1 -C /tmp/thorium/binwalk > /tmp/thorium/results
5-
mv /tmp/thorium/binwalk/*.extracted /tmp/thorium/children/carved/unknown/ || true
5+
6+
if find "/tmp/results/binwalk" -maxdepth 1 -type f -name "*.extracted" -print -quit | grep -q .; then
7+
mv /tmp/thorium/binwalk/*.extracted /tmp/thorium/children/carved/unknown/
8+
else
9+
echo "INFO: No files extracted"
10+
exit 0
11+
fi
612

713
binHash=$(sha256sum $1)
814
binHashArr=($binHash)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ARG IMAGE="ubuntu:22.04"
2+
FROM $IMAGE
3+
4+
RUN apt update -y && \
5+
apt-get install -y wget gnupg && \
6+
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | gpg --dearmor | tee /usr/share/keyrings/trivy.gpg > /dev/null && \
7+
echo "deb [signed-by=/usr/share/keyrings/trivy.gpg] https://aquasecurity.github.io/trivy-repo/deb generic main" | tee -a /etc/apt/sources.list.d/trivy.list && \
8+
apt-get update -y && \
9+
apt-get install -y trivy
10+
11+
# prefetch and save our DB
12+
RUN trivy fs --scanners vuln,secret,misconfig,license /tmp && \
13+
mv /root/.cache/* /tmp/cache/ && \
14+
chmod -R 777 /tmp/cache
15+
16+
# Add our wrapper.sh script
17+
WORKDIR /app
18+
COPY wrapper.sh .
19+
20+
# setup our entrypoint
21+
ENTRYPOINT ["/app/wrapper.sh"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name = "trivy"
2+
type = "image"
3+
config_from = "trivy.json"
4+
build_path = "./"
5+
image_name = "tools/github.com/aquasecurity/trivy"
6+
version = "latest"
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"group": "static",
3+
"name": "trivy",
4+
"scaler": "K8s",
5+
"image": "",
6+
"timeout": 300,
7+
"resources": {
8+
"cpu": 4,
9+
"memory": "4Gi",
10+
"ephemeral_storage": "0Gi",
11+
"nvidia_gpu": 0,
12+
"amd_gpu": 0,
13+
"burstable": {
14+
"cpu": 0,
15+
"memory": "0Gi"
16+
}
17+
},
18+
"spawn_limit": "Unlimited",
19+
"volumes": [],
20+
"env": {},
21+
"args": {
22+
"entrypoint": null,
23+
"command": null,
24+
"reaction": null,
25+
"repo": null,
26+
"commit": null,
27+
"output": {
28+
"Kwarg": "-o"
29+
}
30+
},
31+
"description": "The all in one code scanner\n\nhttps://trivy.dev/",
32+
"security_context": {
33+
"user": null,
34+
"group": null,
35+
"allow_privilege_escalation": false
36+
},
37+
"collect_logs": true,
38+
"generator": false,
39+
"dependencies": {
40+
"samples": {
41+
"location": "/tmp/thorium/samples",
42+
"kwarg": null,
43+
"strategy": "Paths"
44+
},
45+
"ephemeral": {
46+
"location": "/tmp/thorium/ephemeral",
47+
"kwarg": null,
48+
"strategy": "Paths",
49+
"names": []
50+
},
51+
"results": {
52+
"images": [],
53+
"location": "/tmp/thorium/prior-results",
54+
"kwarg": "None",
55+
"strategy": "Paths",
56+
"names": []
57+
},
58+
"repos": {
59+
"location": "/tmp/thorium/repos",
60+
"kwarg": null,
61+
"strategy": "Paths"
62+
},
63+
"tags": {
64+
"enabled": false,
65+
"location": "/tmp/thorium/prior-tags",
66+
"kwarg": null,
67+
"strategy": "Paths"
68+
},
69+
"children": {
70+
"enabled": false,
71+
"images": [],
72+
"location": "/tmp/thorium/prior-children",
73+
"kwarg": null,
74+
"strategy": "Paths"
75+
},
76+
"cache": {
77+
"location": "/tmp/thorium/cache",
78+
"generic": {
79+
"kwarg": null,
80+
"strategy": "Disabled"
81+
},
82+
"use_parent_cache": false,
83+
"enabled": true
84+
}
85+
},
86+
"display_type": "String",
87+
"output_collection": {
88+
"handler": "Files",
89+
"files": {
90+
"results": "/tmp/thorium/results",
91+
"result_files": "/tmp/thorium/result-files",
92+
"tags": "/tmp/thorium/tags",
93+
"names": []
94+
},
95+
"children": "/tmp/thorium/children",
96+
"auto_tag": {},
97+
"groups": []
98+
},
99+
"child_filters": {
100+
"mime": [],
101+
"file_name": [],
102+
"file_extension": [],
103+
"submit_non_matches": false
104+
},
105+
"clean_up": null,
106+
"kvm": null,
107+
"network_policies": [
108+
"allow-all"
109+
]
110+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
# copy our trivy cache to our cache folder if it hasn't already been moved
4+
[ -d "/tmp/cache" ] && mv /tmp/cache/* /root/.cache/ && rm -rf /tmp/cache
5+
# run trivy and dump our table results
6+
trivy fs --scanners vuln,secret,misconfig,license --include-dev-deps -f table -o /tmp/thorium/results $1
7+
# run trivy and dump our json results
8+
trivy fs --scanners vuln,secret,misconfig,license --include-dev-deps -f json -o /tmp/thorium/result-files/trivy.json $1

tools/images/github.com/cmu-sei/pharos-fn2hash/pharos-fn2hash.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,12 @@
1515
"volumes": [],
1616
"env": {},
1717
"args": {
18-
"entrypoint": [
19-
"/usr/local/bin/fn2hash"
20-
],
18+
"entrypoint": null,
2119
"command": null,
2220
"reaction": null,
2321
"repo": null,
2422
"commit": null,
25-
"output": {
26-
"Kwarg": "--json"
27-
}
23+
"output": "None"
2824
},
2925
"description": null,
3026
"security_context": {

0 commit comments

Comments
 (0)