forked from log2timeline/plaso
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6ce8fa
commit a6b4e21
Showing
5 changed files
with
76 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Script to run nsrlsvr on an Ubuntu Jenkins instance with Docker. | ||
|
||
AUXILIARY_DATA_PATH="/media/auxiliary"; | ||
|
||
# Exit on error. | ||
set -e | ||
|
||
sudo apt-get install -y curl unzip | ||
|
||
if [ -f "${AUXILIARY_DATA_PATH}/nsrlsvr/NSRLFile.txt" ]; | ||
then | ||
# Note that NSRLFile.txt is approximate 4 GiB in size. | ||
cp -f "${AUXILIARY_DATA_PATH}/nsrlsvr/NSRLFile.txt" . | ||
fi | ||
|
||
if [ ! -f NSRLFile.txt ]; | ||
then | ||
if [ -f "${AUXILIARY_DATA_PATH}/nsrlsvr/rds_modernm.zip" ]; | ||
then | ||
# Note that this is an older rds_modernm.zip that is approximate 2 GiB in size. | ||
cp -f "${AUXILIARY_DATA_PATH}/nsrlsvr/rds_modernm.zip" . | ||
fi | ||
|
||
if [ ! -f rds_modernm.zip ]; | ||
then | ||
# Download the minimum modern RDS hash set. | ||
# Note that rds_modernm.zip is approximate 18 GiB in size. | ||
curl -o rds_modernm.zip https://s3.amazonaws.com/rds.nsrl.nist.gov/RDS/rds_2024.03.1/RDS_2024.03.1_modern_minimal.zip | ||
fi | ||
|
||
if [ ! -f rds_modernm.zip ]; | ||
then | ||
echo "Missing: rds_modernm.zip"; | ||
|
||
exit 1 | ||
fi | ||
|
||
unzip -x rds_modernm.zip rds_modernm/NSRLFile.txt | ||
|
||
mv rds_modernm/NSRLFile.txt . | ||
fi | ||
|
||
if [ ! -f NSRLFile.txt ]; | ||
then | ||
echo "Missing: NSRLFile.txt"; | ||
|
||
exit 1 | ||
fi | ||
|
||
docker build -f nsrlsvr.Dockerfile --force-rm --no-cache -t log2timeline/nsrlsvr . ; | ||
|
||
# Update the nsrlsvr hashes.txt file from NSRLFile.txt | ||
docker run -v "${AUXILIARY_DATA_PATH}:/data:z" log2timeline/nsrlsvr /bin/bash -c "/usr/bin/python3 /usr/bin/nsrlupdate /data/NSRLFile.txt"; | ||
|
||
# Preserver the intermediate container so we don't have to rebuild hashes.txt | ||
docker commit `docker ps -lq` | cut -c8- > nsrlsvr-container | ||
|
||
# Run nsrlsvr self tests | ||
docker run `cat nsrlsvr-container` /bin/bash -c "time /usr/bin/nsrlsvr --dry-run"; | ||
|
||
# Run nsrlsvr listening on port 9120 | ||
docker run -d --name=nsrlsvr --network=nsrlsvr-network -p 127.0.0.1:9120:9120 `cat nsrlsvr-container` /bin/bash -c "/usr/bin/nsrlsvr -p 9120"; | ||
|
||
# Give nsrlsvr 1 minute to load the hashes and be ready for action | ||
# `time nsrlsvr --dry-run' indicates this takes about 30 seconds | ||
sleep 60 | ||
|
This file was deleted.
Oops, something went wrong.