From 8bf0d101db8660fdfd9ede7ce95309e4569c9d38 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 28 Nov 2019 14:12:31 +0100 Subject: [PATCH 1/2] add tex to pdf convert --- Dockerfile | 2 +- run.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dd54baf..444dbb3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.5-alpine -RUN apk add --no-cache nmap nmap-scripts git +RUN apk add --no-cache nmap nmap-scripts git texlive-full RUN pip install --no-cache-dir xmltodict google-cloud-storage boto3 diff --git a/run.sh b/run.sh index 77ec6d0..c81a221 100755 --- a/run.sh +++ b/run.sh @@ -12,6 +12,7 @@ fi xml_dir=xml_files/$current_time report_file=reports/report_$current_time.tex +report_file_pdf=reports/report_$current_time.pdf function upload { if [[ -z $upload ]] @@ -44,4 +45,11 @@ sed -i 's/_/\\_/g' $root_dir$report_file sed -i 's/\$/\\\$/g' $root_dir$report_file sed -i 's/#/\\#/g' $root_dir$report_file sed -i 's/%/\\%/g' $root_dir$report_file +latexmk -pdf -outdir=$root_dir/reports $root_dir$report_file #make pdf +popdir=`pwd` #pushd +cd $root_dir/reports +latexmk -c -f $root_dir$report_file #cleanup tex aux files +cd $popdir #popd upload $report_file +upload $report_file_pdf + From 6b91c45a67365f8cc444d62ed43a813d9d79856a Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 28 Nov 2019 16:25:20 +0100 Subject: [PATCH 2/2] add `make pull` (pull image from dockerhub) Instead of building the container image locally it can get pulled from Dockerhub (from chko/flan). This saves build time on low spec systems. --- Makefile | 4 +++- README.md | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f207923..9537688 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ build : docker build -t flan_scan . - +pull : + docker pull chko/flan + docker image tag chko/flan flan_scan container_name = flan_$(shell date +'%s') start : docker run --name $(container_name) -v $(shell pwd)/shared:/shared flan_scan diff --git a/README.md b/README.md index 5943951..d79f2ae 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ $ docker --version ```bash $ make build ``` + (or alternatively, pull it from Dockerhub: `make pull`) 5. Start scanning! ```bash