Coder Social home page Coder Social logo

soctopus's Introduction

SOCtopus

Flask API to assist with automating SOC functions from Security Onion

Clone the repo:

git clone https://github.com/NRDCS/soctopus

Change into directory:
cd SOCtopus

Edit the config file to include your URL and API key:

sudo vi SOCtopus.conf

Install docker-composer:

sudo apt install docker-compose

Build the image:

sudo docker build -t cs-soctopus:latest .

Start the container:

sudo docker ps sudo docker run -d --name cs-soctopus -p 7000:7000 cs-soctopus sudo docker ps

After RC edit of docker-compose.yaml file, docker starts with :

docker run -d --name soctopus -p 127.0.0.1:7000:7000/tcp soctopus

Now docker ps command will display docker name as "soctopus".

Add the docker to the SO network sudo docker network connect so-elastic-net cs-soctopus

Add the following to /etc/apache2/sites-available/securityonion.conf:

<Location /soctopus>
	AuthType form
	AuthName "Security Onion"
	AuthFormProvider external
	AuthExternal so-apache-auth-sguil
	Session On
	SessionCookieName session path=/;httponly;secure;
	SessionCryptoPassphraseFile /etc/apache2/session
	ErrorDocument 401 /login.html
	Require valid-user
	ProxyPass http://127.0.0.1:7000
	ProxyPassReverse http://127.0.0.1:7000
</Location>

OR

                <Location /soctopus>
                        AuthType shibboleth
                        ShibRequireSession On
                        ShibRequestSetting requireSession 1
                        Require shib-attr memberOf 'CN=Admins,....DC=domain2,DC=lt'
                        SessionCookieName session path=/;httponly;secure;
                        SessionCryptoPassphraseFile /etc/apache2/session
                        ErrorDocument 401 /login.html
                        ProxyPass http://127.0.0.1:7000
                        ProxyPassReverse http://127.0.0.1:7000
                </Location>

Restart Apache:

sudo service apache2 restart

Add scripted field in Kibana. For example, for TheHive, name it TheHive, specifying as a string value and the script as:

'https://SECURITYONIONIP/soctopus/thehive/alert/' + doc['_id'].value

Test by clicking the hyperlinked field from an applicable log in Discover. An alert should be sent to TheHive, and the user should be redirected to the alerts view.

For RTIR: 'https://idx-master.xxx.local/soctopus/rtir/incident/' + doc['_id'].value +'/' + doc['_index'].value

For this docker integration with Kibana management, to start and stop together both dockers, add following to Kibana start script:

				echo "Configuring Kibana, please wait..."
                                /usr/sbin/so-elastic-configure-kibana > /dev/null 2>&1
                        fi
                         echo "Starting Kibana - RTIR integration !"
                         docker rm cs-octopus >/dev/null 2>&1
                         sleep  2
                         docker run -d --name cs-octopus -p 127.0.0.1:7000:7000/tcp cs-octopus
                         docker network connect so-elastic-net cs-octopus
                fi
        fi
fi 

Kibana stop script :

if [ "$KIBANA_ENABLED" = "yes" ] && docker ps | grep -q so-kibana; then
        docker stop so-kibana
        docker rm so-kibana >/dev/null 2>&1
        docker  stop cs-octopus
        docker rm cs-octopus >/dev/null 2>&1
fi

soctopus's People

Contributors

weslambert avatar monikaven avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.