diff --git a/dockerfiles/sep/build.sh b/dockerfiles/sep/build.sh index 9538621..fcfea14 100755 --- a/dockerfiles/sep/build.sh +++ b/dockerfiles/sep/build.sh @@ -1,5 +1,5 @@ #!/bin/bash -docker build -t tabledevil/sep:latest -f sep_dev.dockerfile . +docker build --no-cache -t tabledevil/sep:latest -f sep_dev.dockerfile . tag=$(docker run -it tabledevil/sep:latest version | grep -Pio "(?<=Dockertag: )[\d._]+" ) echo "NEW TAG : ${tag}" docker tag tabledevil/sep tabledevil/sep:${tag} diff --git a/dockerfiles/sep/config.sh b/dockerfiles/sep/config.sh new file mode 100644 index 0000000..d86c20d --- /dev/null +++ b/dockerfiles/sep/config.sh @@ -0,0 +1,20 @@ +service rtvscand start +echo "Starting Liveupdate" +sav liveupdate -u +echo "Done with Liveupdate" +echo "Changing Config for Manualscan" +key='\Symantec Endpoint Protection\AV\LocalScans\ManualScan' +cmd='/opt/Symantec/symantec_antivirus/symcfg' +#Setting AntivirusAction to just +${cmd} add -k "${key}" -v FirstAction -d 0 -t 'REG_DWORD' +${cmd} add -k "${key}" -v FirstMacroAction -d 0 -t 'REG_DWORD' +${cmd} add -k "${key}" -v Checksum -d 1 -t 'REG_DWORD' + +while ! (sav info -d | grep -Pq '^\d') ; do + sleep 1 +done + +#writing DefinitionVersion to file in TAGFORMAT +sav info -d | tr -d '\r\n' | sed -e 's/rev./_/' -e 's/ //g' -e 's|/|.|g' -e 's/\([0-9]\{2\}\).\([0-9]\{2\}\).\([0-9]\{2\}\)/\2.\1.\3/g' | tee /root/tag +service rtvscand stop +sleep 5 diff --git a/dockerfiles/sep/sep_base.dockerfile b/dockerfiles/sep/sep_base.dockerfile deleted file mode 100644 index edbc513..0000000 --- a/dockerfiles/sep/sep_base.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM ubuntu:16.04 - -LABEL maintainer="tabledevil" -LABEL docker.cmd="docker run -it --rm -v /mnt/sdc1:/data sep" - -RUN apt-get update && apt-get install -y wget default-jre lib32ncurses5 lib32z1 sharutils ; rm -rf /var/lib/apt/lists/* -ADD sep.tar.gz /root/ -WORKDIR /root -RUN chmod +x /root/sep/install.sh -RUN /root/sep/install.sh -i && rm -rf /root/sep -RUN ln -s /opt/Symantec/symantec_antivirus/sav /usr/local/bin/sav -WORKDIR /data diff --git a/dockerfiles/sep/sep_dev.dockerfile b/dockerfiles/sep/sep_dev.dockerfile index 7f67362..843e8d0 100644 --- a/dockerfiles/sep/sep_dev.dockerfile +++ b/dockerfiles/sep/sep_dev.dockerfile @@ -8,4 +8,5 @@ RUN chmod +x /root/start.sh ENTRYPOINT ["/root/start.sh"] CMD ["shell"] #RUN wget ftp://ftp.symantec.com/AVDEFS/symantec_antivirus_corp/static/symcdefs-core15unix.sh && chmod +x symcdefs-core15unix.sh && ./symcdefs-core15unix.sh && rm ./symcdefs-core15unix.sh -RUN service rtvscand start ; sleep 10 ; sav liveupdate -u ; sleep 10 ; while ! (sav info -d | grep -Pq '^\d') ; do sleep 1 ; done ; sav info -d | tee /root/tag ; service rtvscand stop ; sleep 10 +ADD config.sh /root/config.sh +RUN chmod +x /root/config.sh ; /root/config.sh diff --git a/dockerfiles/sep/start.sh b/dockerfiles/sep/start.sh index df277d2..0e00483 100644 --- a/dockerfiles/sep/start.sh +++ b/dockerfiles/sep/start.sh @@ -1,13 +1,14 @@ #!/bin/bash -echo "stage: ${1}" case "${1}" in shell ) + echo "stage: ${1}" service rtvscand start echo "Usage:" echo "sav manualscan -c " /bin/bash ;; version ) + echo "stage: ${1}" service rtvscand start sleep 5 sep_dev=$(sav info -d | tr -d '\r\n') @@ -25,6 +26,7 @@ case "${1}" in ;; scan ) + echo "stage: ${1}" service rtvscand start sleep 5 sav manualscan -c /data @@ -33,6 +35,7 @@ case "${1}" in cat /root/tag ;; debug ) + echo "stage: ${1}" /bin/bash ;; esac