da667 / Autosnort

Repo for autosnort scripts.
MIT License
157 stars 89 forks source link

Docker? #40

Open mgaulton opened 8 years ago

mgaulton commented 8 years ago

Any chance this would work inside docker? I've been looking for something exactly like this.

mgaulton commented 8 years ago

I took a stab at it, work in progress.

This is a comment

FROM ubuntu:14.04 MAINTAINER Kate Smith ksmith@example.com RUN apt-get update && apt-get -y install git openssh-server grep ssh-client RUN rm /bin/sh && ln -s /bin/bash /bin/sh RUN start ssh

RUN git clone https://github.com/mgaulton/Autosnort.git RUN rm -rf CentOS Debian Kali BT Offline .txt .pdf RUN chmod a+x 'Autosnort/Autosnort - Ubuntu/autosnort-ubuntu-10-30-2015.sh'

RUN sed -i "s/^root_mysql_pass=''/root_mysql_pass=''/" 'Autosnort/Autosnort - Ubuntu/full_autosnort.conf' RUN sed -i 's/^o_code=/o_code=/' 'Autosnort/Autosnort - Ubuntu/full_autosnort.conf' RUN sed -i 's/^snort_mysql_pass=/snort_mysql_pass=/' 'Autosnort/Autosnort - Ubuntu/full_autosnort.conf' RUN sed -i 's/^reboot_choice=1/reboot_choice=2/' 'Autosnort/Autosnort - Ubuntu/full_autosnort.conf' RUN sed -i 's/^snort_iface=eth1/snort_iface=enp5s0/' 'Autosnort/Autosnort - Ubuntu/full_autosnort.conf'

WORKDIR 'Autosnort/Autosnort - Ubuntu/'

RUN './autosnort-ubuntu-10-30-2015.sh'

Remove build dependencies.

RUN cd /tmp && \ yum -y remove $(diff prebuild-rpms postbuild-rpms | awk '/^>/ { print $2 }')

Cleanup.

RUN yum clean all && \ rm -rf /var/log/* || true \ rm -rf /var/tmp/* \ rm -rf /tmp/*