From 323efad595c88f4ea9a81b69b91aaf2bfdf4ede0 Mon Sep 17 00:00:00 2001 From: Hannah Ward Date: Wed, 24 Oct 2018 17:40:59 +0100 Subject: [PATCH] new: Add docker --- Dockerfile | 22 ++++++++++++++++++++++ README.md | 27 ++++++++++++++++++++++++--- docker-run.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-run.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c5b0ab9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM debian:buster-slim +EXPOSE 9000 + +RUN apt-get update && \ + apt-get -y install python3 python3-pip git build-essential default-libmysqlclient-dev + +RUN git clone --recursive https://github.com/MISP/MISP-Taxii-Server + +RUN pip3 install libtaxii==1.1.111 mysqlclient gunicorn + +WORKDIR /MISP-Taxii-Server/OpenTAXII +RUN python3 setup.py install + +WORKDIR /MISP-Taxii-Server +RUN python3 setup.py install + +RUN export OPENTAXII_CONFIG=/MISP-Taxii-Server/config.yaml && export PYTHONPATH=. +RUN opentaxii-create-services -c config/services.yaml && opentaxii-create-collections -c config/collections.yaml + +ADD ./docker-run.sh /run.sh + +CMD /bin/sh /run.sh diff --git a/README.md b/README.md index 2efb8f7..851a780 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,30 @@ along with a callback for when data is sent to the TAXII Server's inbox. ## Installation +### Docker install + +For a really simple sqlite-based installation (plug and play, no persistence) + +```bash +docker pull floatingghost/misp-taxii-server +docker run -it \ + -e PERSIST_CONNECTION_STRING="sqlite:///persist.db" \ + -e AUTH_CONNECTION_STRING="sqlite:///auth.db" \ + -e MISP_URL="https://mymisp" \ + -e MISP_KEY="myapikey" \ + -e TAXII_USER=root \ + -e TAXII_PASS=root + -p 9000:9000 \ + taxii +``` + +That'll get you set up with a basic server, but is not recommended for production. +Switch the connection strings to use an external database for that. + +This docker image currently just runs the base server with no supplimentary scripts. + +### Manual install + Download the repository with ```bash git clone --recursive https://github.com/MISP/MISP-Taxii-Server @@ -135,6 +159,3 @@ This will open your crontab. Paste in This will run the polling script every 6 hours to keep things all synced up. -## Planned features - -- Duplicate Detection diff --git a/docker-run.sh b/docker-run.sh new file mode 100644 index 0000000..47d9843 --- /dev/null +++ b/docker-run.sh @@ -0,0 +1,45 @@ +export OPENTAXII_CONFIG=/MISP-Taxii-Server/config.yaml && export PYTHONPATH=. + +cat > /MISP-Taxii-Server/config.yaml <