From 8dc03f543e26ee54fffe554458f7680f6c7e604f Mon Sep 17 00:00:00 2001 From: ismisepaul Date: Tue, 24 Nov 2015 22:56:53 +0000 Subject: [PATCH 1/3] Update Dockerfile Updating Dockerfile for v3 --- Dockerfile | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index f87e34f79..dd054fca0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # Dockerfile to build Security Sherpherd # # Based on Ubuntu -# Version 0.8 +# Version 3.0 ################################################################### @@ -18,13 +18,16 @@ ENV keystorePwd=CowSaysMoo mysqlRootPwd=CowSaysMoo ENV homeDirectory="/home/shepherd/" keyStoreFileName="shepherdKeystore.jks" #Download locations -ENV serverXml="https://raw.githubusercontent.com/OWASP/SecurityShepherd/master/SecurityShepherdCore/setupFiles/tomcatShepherdSampleServer.xml" webXml="https://raw.githubusercontent.com/OWASP/SecurityShepherd/master/SecurityShepherdCore/setupFiles/tomcatShepherdSampleWeb.xml" shepherdManualPackLocation="http://sourceforge.net/projects/owaspshepherd/files/owaspSecurityShepherd_V2.4%20Manual%20Pack.zip/download" +ENV serverXml="https://raw.githubusercontent.com/OWASP/SecurityShepherd/master/SecurityShepherdCore/setupFiles/tomcatShepherdSampleServer.xml" webXml="https://raw.githubusercontent.com/OWASP/SecurityShepherd/master/SecurityShepherdCore/setupFiles/tomcatShepherdSampleWeb.xml" shepherdManualPackLocation="https://sourceforge.net/projects/owaspshepherd/files/owaspSecurityShepherd_V3.0%20Manual%20Pack.zip/download" # Install Pre-Requisite Stuff RUN apt-get update -y &&\ apt-get install -y software-properties-common python-software-properties &&\ add-apt-repository -y ppa:webupd8team/java &&\ + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 &&\ + echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/mongodb.list &&\ apt-get update -y &&\ + apt-get install -y mongodb-org=2.6.9 mongodb-org-server=2.6.9 mongodb-org-shell=2.6.9 mongodb-org-mongos=2.6.9 mongodb-org-tools=2.6.9 &&\ echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections &&\ apt-get install -y oracle-java7-installer --force-yes &&\ echo "mysql-server mysql-server/root_password password $mysqlRootPwd" | debconf-set-selections &&\ @@ -43,13 +46,19 @@ RUN wget --quiet $shepherdManualPackLocation -O manualPack.zip &&\ mv manualPack/ROOT.war /var/lib/tomcat7/webapps/ &&\ chown -R mysql /var/lib/mysql -#Configuring MySQL +#Configuring MySQL & Mongodb WORKDIR /home/shepherd/manualPack -RUN /bin/bash -c "/usr/bin/mysqld_safe &" && \ +RUN /bin/bash -c "/usr/bin/mysqld_safe &" &&\ sleep 5 &&\ mysql -u root -e "source coreSchema.sql" --force -p$mysqlRootPwd &&\ mysql -u root -e "source moduleSchemas.sql" --force -p$mysqlRootPwd +#Configuring Mongodb + RUN mkdir -p /data/db/; \ + chown `id -u` /data/db; \ + /bin/bash -c "/usr/bin/mongod &" &&\ + mongo /home/shepherd/manualPack/mongoSchema.js + #Configuring Tomcat WORKDIR /home/shepherd RUN echo "JAVA_HOME=/usr/lib/jvm/java-7-oracle" >> /etc/default/tomcat7 && \ @@ -70,10 +79,8 @@ RUN echo "JAVA_HOME=/usr/lib/jvm/java-7-oracle" >> /etc/default/tomcat7 && \ chown tomcat7 /etc/authbind/byport/80 && \ chown tomcat7 /etc/authbind/byport/443 -EXPOSE 80 443 3306 - -#service mysql start not working... - -CMD /usr/bin/mysqld_safe & && \ - service tomcat7 start && tail -f /var/lib/tomcat7/logs/catalina.out +EXPOSE 80 443 3306 27017 +CMD /usr/bin/mysqld_safe & \ + /usr/bin/mongod & \ + service tomcat7 start; From 1f51c6ae89350a65e2a5c51398536e6210a23bd0 Mon Sep 17 00:00:00 2001 From: ismisepaul Date: Tue, 24 Nov 2015 22:58:48 +0000 Subject: [PATCH 2/3] Update README.md updating to point to working dockerhub build --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0a863fd48..c5f722db9 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,15 @@ The [OWASP Security Shepherd Project](http://bit.ly/owaspSecurityShepherd) is a # Where can I download Security Shepherd? ### Virtual Machine or Manual Setup -You can download Security Shepherd VM's or Manual Installation Packs from [SourceForge](http://bit.ly/1JbtQtP) +You can download Security Shepherd VM's or Manual Installation Packs from [GitHub](https://github.com/OWASP/SecurityShepherd/releases/tag/v3.0) ### Docker -There is also a docker image available from [Dockerhub](https://hub.docker.com/r/owasp/security-shepherd/) you can pull it down with -`docker pull owasp/security-shepherd` +There is also a docker image available from [Dockerhub](https://hub.docker.com/r/ismisepaul/securityshepherd/) you can pull it down with +`docker pull ismisepaul/securityshepherd` Note: You'll need to get a shell on your docker container and run mysql and tomcat manually; ```BASH -docker run -i -p 80:80 -p 443:443 -t owasp/security-shepherd /bin/bash +docker run -i -p 80:80 -p 443:443 -t ismisepaul/securityshepherd /bin/bash ``` ```BASH /usr/bin/mysqld_safe & From e8273a2b47f433127e2428ca053168013947a766 Mon Sep 17 00:00:00 2001 From: ismisepaul Date: Tue, 24 Nov 2015 23:10:54 +0000 Subject: [PATCH 3/3] Update Dockerfile reverting back --- Dockerfile | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index dd054fca0..3a75303e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # Dockerfile to build Security Sherpherd # # Based on Ubuntu -# Version 3.0 +# Version 0.8 ################################################################### @@ -18,16 +18,13 @@ ENV keystorePwd=CowSaysMoo mysqlRootPwd=CowSaysMoo ENV homeDirectory="/home/shepherd/" keyStoreFileName="shepherdKeystore.jks" #Download locations -ENV serverXml="https://raw.githubusercontent.com/OWASP/SecurityShepherd/master/SecurityShepherdCore/setupFiles/tomcatShepherdSampleServer.xml" webXml="https://raw.githubusercontent.com/OWASP/SecurityShepherd/master/SecurityShepherdCore/setupFiles/tomcatShepherdSampleWeb.xml" shepherdManualPackLocation="https://sourceforge.net/projects/owaspshepherd/files/owaspSecurityShepherd_V3.0%20Manual%20Pack.zip/download" +ENV serverXml="https://raw.githubusercontent.com/OWASP/SecurityShepherd/master/SecurityShepherdCore/setupFiles/tomcatShepherdSampleServer.xml" webXml="https://raw.githubusercontent.com/OWASP/SecurityShepherd/master/SecurityShepherdCore/setupFiles/tomcatShepherdSampleWeb.xml" shepherdManualPackLocation="http://sourceforge.net/projects/owaspshepherd/files/owaspSecurityShepherd_V2.4%20Manual%20Pack.zip/download" # Install Pre-Requisite Stuff RUN apt-get update -y &&\ apt-get install -y software-properties-common python-software-properties &&\ add-apt-repository -y ppa:webupd8team/java &&\ - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 &&\ - echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/mongodb.list &&\ apt-get update -y &&\ - apt-get install -y mongodb-org=2.6.9 mongodb-org-server=2.6.9 mongodb-org-shell=2.6.9 mongodb-org-mongos=2.6.9 mongodb-org-tools=2.6.9 &&\ echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections &&\ apt-get install -y oracle-java7-installer --force-yes &&\ echo "mysql-server mysql-server/root_password password $mysqlRootPwd" | debconf-set-selections &&\ @@ -46,19 +43,13 @@ RUN wget --quiet $shepherdManualPackLocation -O manualPack.zip &&\ mv manualPack/ROOT.war /var/lib/tomcat7/webapps/ &&\ chown -R mysql /var/lib/mysql -#Configuring MySQL & Mongodb +#Configuring MySQL WORKDIR /home/shepherd/manualPack -RUN /bin/bash -c "/usr/bin/mysqld_safe &" &&\ +RUN /bin/bash -c "/usr/bin/mysqld_safe &" && \ sleep 5 &&\ mysql -u root -e "source coreSchema.sql" --force -p$mysqlRootPwd &&\ mysql -u root -e "source moduleSchemas.sql" --force -p$mysqlRootPwd -#Configuring Mongodb - RUN mkdir -p /data/db/; \ - chown `id -u` /data/db; \ - /bin/bash -c "/usr/bin/mongod &" &&\ - mongo /home/shepherd/manualPack/mongoSchema.js - #Configuring Tomcat WORKDIR /home/shepherd RUN echo "JAVA_HOME=/usr/lib/jvm/java-7-oracle" >> /etc/default/tomcat7 && \ @@ -79,8 +70,9 @@ RUN echo "JAVA_HOME=/usr/lib/jvm/java-7-oracle" >> /etc/default/tomcat7 && \ chown tomcat7 /etc/authbind/byport/80 && \ chown tomcat7 /etc/authbind/byport/443 -EXPOSE 80 443 3306 27017 +EXPOSE 80 443 3306 + +#service mysql start not working... -CMD /usr/bin/mysqld_safe & \ - /usr/bin/mongod & \ - service tomcat7 start; +CMD /usr/bin/mysqld_safe & && \ + service tomcat7 start && tail -f /var/lib/tomcat7/logs/catalina.out