Compare commits

...

13 Commits

Author SHA1 Message Date
Alexandre Dulaunoy cdfca0dab1 Set theme jekyll-theme-slate 2020-11-06 10:55:14 +01:00
Alexandre Dulaunoy 0fe4fb361b
chg: [doc] master->main (logo) 2020-11-06 10:51:38 +01:00
Alexandre Dulaunoy 56f785f734
chg: [misp-galaxy] updated to the latest version 2020-11-06 10:50:08 +01:00
Alexandre Dulaunoy d914e1898d
Merge pull request #3 from DocArmoryTech/DocArmoryTech-systemd
Systemd and nginx production setup and instructions
2020-11-06 10:49:11 +01:00
DocArmoryTech 772e02f425
Update README.md 2020-11-03 14:03:28 +00:00
DocArmoryTech 987b685321
Update README.md 2020-11-03 13:56:57 +00:00
DocArmoryTech a616df19d4
Update nginx-tai.conf 2020-11-03 13:46:03 +00:00
DocArmoryTech 93b1b6ddd7
Create nginx-tai.conf
A sample nginx configuration file for reverse-proxying to a the _four_ tai servers started by the systemd `target` file
2020-11-03 12:57:19 +00:00
DocArmoryTech bff0996948
Add instructions for alt/production install
Added an instructions for installing TAI server as an unprivileged user and running it using systemd
2020-11-03 12:53:15 +00:00
DocArmoryTech 82964b544c
Update README.md 2020-11-03 12:46:02 +00:00
DocArmoryTech 09d1691032
Create tai@.service 2020-11-03 12:26:01 +00:00
DocArmoryTech 09a93ca1cd
Create tai.target
A systemd `target` file that serves to group and manage `systemctl` control of a number of tai-servers
2020-11-03 12:19:32 +00:00
DocArmoryTech 795c232244
Merge pull request #1 from DocArmoryTech/DocArmoryTech-options
Parameterise listening port and address
2020-11-03 11:54:15 +00:00
6 changed files with 96 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# threat-actor-intelligence-server
![](https://raw.githubusercontent.com/MISP/threat-actor-intelligence-server/master/doc/logo/tai.png)
![](https://raw.githubusercontent.com/MISP/threat-actor-intelligence-server/main/doc/logo/tai.png)
A simple ReST server to lookup threat actors (by name, synonym or UUID) and returning the corresponding MISP galaxy information about the known threat actors.
@ -18,8 +18,7 @@ git submodule init
git submodule update
pip install -r REQUIREMENTS
~~~
# Starting the server
## Starting the server
~~~
cd bin
@ -28,6 +27,65 @@ python tai-server.py
By the default, the server is listening on TCP port 8889.
# Alternative Installation
This method involves:
- installing a few dependencies
- creating a dedicated, unprivileged, user to run the TAI server(s)
- creating a python virtual environment
- installation of TAI
- systemd configuraion of (arbitrarily) four instances
- configuring nginx as a reverse proxy to four instances
Installing a few dependencies
~~~
sudo apt install virtualenv git python3-pip nginx
~~~
Create a dedicated, unprivileged, user to run the TAI server(s)
~~~
sudo adduser tai
~~~
Create and activate a python virtual environment called _tai-env_
~~~
sudo su tai
virtualenv tai-env
source ./tai-env/bin/activate
~~~
Installation of TAI in the home directory of the user `tai`
~~~
cd
git clone https://github.com/MISP/threat-actor-intelligence-server
cd threat-actor-intelligence-server
git submodule init
git submodule update
pip install -r REQUIREMENTS
exit
~~~
systemd configuraion for a group of four instances of TAI
~~~
sudo cp /home/tai/threat-actor-intelligence-server/debian/tai@.service /lib/systemd/system/
sudo cp /home/tai/threat-actor-intelligence-server/debian/tai.target /etc/systemd/system/
sudo systemctl daemon-reload
~~~
configuring nginx as a reverse proxy to four instances
~~~
sudo rm /etc/nginx/site-enabled/default
sudo cp /home/tai/threat-actor-intelligence-server/debian/nginx-tai.conf /etc/nginx/sites-available/
sudo ln -s /etc/nginx/sites-available/nginx-tai.conf /etc/nginx/sites-enabled/
~~~
Lastly, configure systemd to start the TAI servers and nginx automatically
~~~
sudo systemctl enable tai.target
sudo systemctl enable nginx
~~~
# API and public API
The API is simple and can be queried on the `/query` entry point by POSTing a simple query in JSON format. The query format is

1
_config.yml Normal file
View File

@ -0,0 +1 @@
theme: jekyll-theme-slate

14
debian/nginx-tai.conf vendored Normal file
View File

@ -0,0 +1,14 @@
upstream backends {
server 127.0.0.1:8000;
server 127.0.0.1:8001;
server 127.0.0.1:8002;
server 127.0.0.1:8003;
}
server {
listen 80;
location / {
proxy_pass http://backends;
}
}

6
debian/tai.target vendored Normal file
View File

@ -0,0 +1,6 @@
Unit]
Description=TAI Servers
Requires=tai@8000.service tai@8001.service tai@8002.service tai@8003.service
[Install]
WantedBy=multi-user.target

13
debian/tai@.service vendored Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=Threat Actor Intelligence Server
PartOf=tai.target
[Service]
WorkingDirectory=/home/tai/threat-actor-intelligence-server/bin
ExecStart=/home/tai/tai-env/bin/python3 tai-server.py --port=%I --address='127.0.0.1'
User=tai
Restart=on-failure
Type=simple
[Install]
WantedBy=multi-user.target

@ -1 +1 @@
Subproject commit 8080d2abf590fb8a714cf73f2befc672a1fbccd5
Subproject commit 4338af3f0cf3b856397ccbae5de2b7b3d7c75c32