mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-02 01:27:27 -04:00
Begin of restructuring ...
- deprecate old release - set virtual version - we need tpot user / group, adding to installer - tweaking - do not use the dev branch, it will break stuff
This commit is contained in:
257
_deprecated/cloud/ansible/README.md
Normal file
257
_deprecated/cloud/ansible/README.md
Normal file
@ -0,0 +1,257 @@
|
||||
# T-Pot Ansible
|
||||
|
||||
Here you can find a ready-to-use solution for your automated T-Pot deployment using [Ansible](https://www.ansible.com/).
|
||||
It consists of an Ansible Playbook with multiple roles, which is reusable for all [OpenStack](https://www.openstack.org/) based clouds (e.g. Open Telekom Cloud, Orange Cloud, Telefonica Open Cloud, OVH) out of the box.
|
||||
Apart from that you can easily adapt the deploy role to use other [cloud providers](https://docs.ansible.com/ansible/latest/scenario_guides/cloud_guides.html). Check out [Ansible Galaxy](https://galaxy.ansible.com/search?keywords=&order_by=-relevance&page=1&deprecated=false&type=collection&tags=cloud) for more cloud collections.
|
||||
|
||||
The Playbook first creates all resources (security group, network, subnet, router), deploys one (or more) new servers and then installs and configures T-Pot on them.
|
||||
|
||||
This example showcases the deployment on our own OpenStack based Public Cloud Offering [Open Telekom Cloud](https://open-telekom-cloud.com/en).
|
||||
|
||||
# Table of contents
|
||||
- [Preparation of Ansible Master](#ansible-master)
|
||||
- [Ansible Installation](#ansible)
|
||||
- [OpenStack Collection Installation](#collection)
|
||||
- [Agent Forwarding](#agent-forwarding)
|
||||
- [Preparations in Open Telekom Cloud Console](#preparation)
|
||||
- [Create new project](#project)
|
||||
- [Create API user](#api-user)
|
||||
- [Import Key Pair](#key-pair)
|
||||
- [Clone Git Repository](#clone-git)
|
||||
- [Settings and recommended values](#settings)
|
||||
- [clouds.yaml](#clouds-yaml)
|
||||
- [Ansible remote user](#remote-user)
|
||||
- [Number of instances to deploy](#number)
|
||||
- [Instance settings](#instance-settings)
|
||||
- [User password](#user-password)
|
||||
- [Configure `tpot.conf.dist`](#tpot-conf)
|
||||
- [Optional: Custom `ews.cfg`](#ews-cfg)
|
||||
- [Optional: Custom HPFEEDS](#hpfeeds)
|
||||
- [Deploying a T-Pot](#deploy)
|
||||
- [Further documentation](#documentation)
|
||||
|
||||
<a name="ansible-master"></a>
|
||||
# Preparation of Ansible Master
|
||||
You can either run the Ansible Playbook locally on your Linux or macOS machine or you can use an ECS (Elastic Cloud Server) on Open Telekom Cloud, which I did.
|
||||
I used Ubuntu 18.04 for my Ansible Master Server, but other OSes are fine too.
|
||||
Ansible works over the SSH Port, so you don't have to add any special rules to your Security Group.
|
||||
|
||||
<a name="ansible"></a>
|
||||
## Ansible Installation
|
||||
:warning: Ansible 2.10 or newer is required!
|
||||
|
||||
Example for Ubuntu 18.04:
|
||||
|
||||
At first we update the system:
|
||||
`sudo apt update`
|
||||
`sudo apt dist-upgrade`
|
||||
|
||||
Then we need to add the repository and install Ansible:
|
||||
`sudo apt-add-repository --yes --update ppa:ansible/ansible`
|
||||
`sudo apt install ansible`
|
||||
|
||||
For other OSes and Distros have a look at the official [Ansible Documentation](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).
|
||||
|
||||
If your OS does not offer a recent version of Ansible (>= 2.10) you should consider [installing Ansible with pip](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-with-pip).
|
||||
In short (if you already have Python3/pip3 installed):
|
||||
```
|
||||
pip3 install ansible
|
||||
```
|
||||
|
||||
<a name="collection"></a>
|
||||
## OpenStack Collection Installation
|
||||
For interacting with OpenStack resources in Ansible, you need to install the collection from Ansible Galaxy:
|
||||
`ansible-galaxy collection install openstack.cloud`
|
||||
|
||||
<a name="agent-forwarding"></a>
|
||||
## Agent Forwarding
|
||||
If you run the Ansible Playbook remotely on your Ansible Master Server, Agent Forwarding must be enabled in order to let Ansible connect to newly created machines.
|
||||
- On Linux or macOS:
|
||||
- Create or edit `~/.ssh/config`
|
||||
```
|
||||
Host ANSIBLE_MASTER_IP
|
||||
ForwardAgent yes
|
||||
```
|
||||
- On Windows using Putty:
|
||||

|
||||
|
||||
<a name="preparation"></a>
|
||||
# Preparations in Open Telekom Cloud Console
|
||||
(You can skip this if you have already set up a project and an API account with key pair)
|
||||
(Just make sure you know the naming for everything, as you need to configure the Ansible variables.)
|
||||
|
||||
Before we can start deploying, we have to prepare the Open Telekom Cloud tenant.
|
||||
For that, go to the [Web Console](https://auth.otc.t-systems.com/authui/login) and log in with an admin user.
|
||||
|
||||
<a name="project"></a>
|
||||
## Create new project
|
||||
I strongly advise you to create a separate project for the T-Pots in your tenant.
|
||||
In my case I named it `tpot`.
|
||||
|
||||

|
||||
|
||||
<a name="api-user"></a>
|
||||
## Create API user
|
||||
The next step is to create a new user account, which is restricted to the project.
|
||||
This ensures that the API access is limited to that project.
|
||||
|
||||

|
||||
|
||||
<a name="key-pair"></a>
|
||||
## Import Key Pair
|
||||
:warning: Now log in with the newly created API user account and select your project.
|
||||
|
||||

|
||||
|
||||
Import your SSH public key.
|
||||
|
||||

|
||||
|
||||
|
||||
<a name="clone-git"></a>
|
||||
# Clone Git Repository
|
||||
Clone the `tpotce` repository to your Ansible Master:
|
||||
`git clone https://github.com/telekom-security/tpotce.git`
|
||||
All Ansible related files are located in the [`cloud/ansible/openstack`](openstack) folder.
|
||||
|
||||
<a name="settings"></a>
|
||||
# Settings and recommended values
|
||||
You can configure all aspects of your Elastic Cloud Server and T-Pot before using the Playbook:
|
||||
|
||||
<a name="clouds-yaml"></a>
|
||||
## clouds.yaml
|
||||
Located at [`openstack/clouds.yaml`](openstack/clouds.yaml).
|
||||
Enter your Open Telekom Cloud API user credentials here (username, password, project name, user domain name):
|
||||
```
|
||||
clouds:
|
||||
open-telekom-cloud:
|
||||
profile: otc
|
||||
auth:
|
||||
project_name: eu-de_your_project
|
||||
username: your_api_user
|
||||
password: your_password
|
||||
user_domain_name: OTC-EU-DE-000000000010000XXXXX
|
||||
```
|
||||
You can also perform different authentication methods like sourcing OpenStack OS_* environment variables or providing an inline dictionary.
|
||||
For more information have a look in the [openstack.cloud.server](https://docs.ansible.com/ansible/latest/collections/openstack/cloud/server_module.html) Ansible module documentation.
|
||||
|
||||
If you already have your own `clouds.yaml` file or have multiple clouds in there, you can specify which one to use in the `openstack/my_os_cloud.yaml` file:
|
||||
```
|
||||
# Enter the name of your cloud to use from clouds.yaml
|
||||
cloud: open-telekom-cloud
|
||||
```
|
||||
|
||||
<a name="remote-user"></a>
|
||||
## Ansible remote user
|
||||
You may have to adjust the `remote_user` in the Ansible Playbook under [`openstack/deploy_tpot.yaml`](openstack/deploy_tpot.yaml) depending on your Debian base image (e.g. on Open Telekom Cloud the default Debian user is `linux`).
|
||||
|
||||
<a name="number"></a>
|
||||
## Number of instances to deploy
|
||||
You can adjust the number of VMs/T-Pots that you want to create in [`openstack/deploy_tpot.yaml`](openstack/deploy_tpot.yaml):
|
||||
```
|
||||
loop: "{{ range(0, 1) }}"
|
||||
```
|
||||
One instance is set as the default, increase to your liking.
|
||||
|
||||
<a name="instance-settings"></a>
|
||||
## Instance settings
|
||||
Located at [`openstack/roles/create_vm/vars/main.yaml`](openstack/roles/create_vm/vars/main.yaml).
|
||||
Here you can customize your virtual machine specifications:
|
||||
- Choose an availability zone. For Open Telekom Cloud reference see [here](https://docs.otc.t-systems.com/en-us/endpoint/index.html).
|
||||
- Change the OS image (For T-Pot we need Debian)
|
||||
- (Optional) Change the volume size
|
||||
- Specify your key pair (:warning: Mandatory)
|
||||
- (Optional) Change the instance type (flavor)
|
||||
`s3.medium.8` corresponds to 1 vCPU and 8GB of RAM and is the minimum required flavor.
|
||||
A full list of Open Telekom Cloud flavors can be found [here](https://docs.otc.t-systems.com/en-us/usermanual/ecs/en-us_topic_0177512565.html).
|
||||
|
||||
```
|
||||
availability_zone: eu-de-03
|
||||
image: Standard_Debian_10_latest
|
||||
volume_size: 128
|
||||
key_name: your-KeyPair
|
||||
flavor: s3.medium.8
|
||||
```
|
||||
|
||||
<a name="user-password"></a>
|
||||
## User password
|
||||
Located at [`openstack/roles/install/vars/main.yaml`](openstack/roles/install/vars/main.yaml).
|
||||
Here you can set the password for your Debian user (**you should definitely change that**).
|
||||
```
|
||||
user_password: LiNuXuSeRPaSs#
|
||||
```
|
||||
|
||||
<a name="tpot-conf"></a>
|
||||
## Configure `tpot.conf.dist`
|
||||
The file is located in [`iso/installer/tpot.conf.dist`](/iso/installer/tpot.conf.dist).
|
||||
Here you can choose:
|
||||
- between the various T-Pot editions
|
||||
- a username for the web interface
|
||||
- a password for the web interface (**you should definitely change that**)
|
||||
|
||||
<a name="ews-cfg"></a>
|
||||
## Optional: Custom `ews.cfg`
|
||||
Enable this by uncommenting the role in the [deploy_tpot.yaml](openstack/deploy_tpot.yaml) playbook.
|
||||
```
|
||||
# - custom_ews
|
||||
```
|
||||
|
||||
You can use a custom config file for `ewsposter`.
|
||||
e.g. when you have your own credentials for delivering data to our [Sicherheitstacho](https://sicherheitstacho.eu/start/main).
|
||||
You can find the `ews.cfg` template file here: [`openstack/roles/custom_ews/templates/ews.cfg`](openstack/roles/custom_ews/templates/ews.cfg) and adapt it for your needs.
|
||||
|
||||
For setting custom credentials, these settings would be relevant for you (the rest of the file can stay as is):
|
||||
```
|
||||
[MAIN]
|
||||
...
|
||||
contact = your_email_address
|
||||
...
|
||||
|
||||
[EWS]
|
||||
...
|
||||
username = your_username
|
||||
token = your_token
|
||||
...
|
||||
```
|
||||
|
||||
<a name="hpfeeds"></a>
|
||||
## Optional: Custom HPFEEDS
|
||||
Enable this by uncommenting the role in the [deploy_tpot.yaml](openstack/deploy_tpot.yaml) playbook.
|
||||
```
|
||||
# - custom_hpfeeds
|
||||
```
|
||||
|
||||
You can specify custom HPFEEDS in [`openstack/roles/custom_hpfeeds/files/hpfeeds.cfg`](openstack/roles/custom_hpfeeds/files/hpfeeds.cfg).
|
||||
That file contains the defaults (turned off) and you can adapt it for your needs, e.g. for SISSDEN:
|
||||
```
|
||||
myENABLE=true
|
||||
myHOST=hpfeeds.sissden.eu
|
||||
myPORT=10000
|
||||
myCHANNEL=t-pot.events
|
||||
myCERT=/opt/ewsposter/sissden.pem
|
||||
myIDENT=your_user
|
||||
mySECRET=your_secret
|
||||
myFORMAT=json
|
||||
```
|
||||
|
||||
<a name="deploy"></a>
|
||||
# Deploying a T-Pot :honey_pot::honeybee:
|
||||
Now, after configuring everything, we can finally start deploying T-Pots!
|
||||
|
||||
Go to the [`openstack`](openstack) folder and run the Ansible Playbook with:
|
||||
`ansible-playbook deploy_tpot.yaml`
|
||||
(Yes, it is as easy as that :smile:)
|
||||
|
||||
If you are running on a machine which asks for a sudo password, you can use:
|
||||
`ansible-playbook --ask-become-pass deploy_tpot.yaml`
|
||||
|
||||
The Playbook will first install required packages on the Ansible Master and then deploy one (or more) new server instances.
|
||||
After that, T-Pot gets installed and configured on them, optionally custom configs are applied and finally it reboots.
|
||||
|
||||
Once this is done, you can proceed with connecting/logging in to the T-Pot according to the [documentation](https://github.com/telekom-security/tpotce#ssh-and-web-access).
|
||||
|
||||
<a name="documentation"></a>
|
||||
# Further documentation
|
||||
- [Ansible Documentation](https://docs.ansible.com/ansible/latest/)
|
||||
- [openstack.cloud.server – Create/Delete Compute Instances from OpenStack](https://docs.ansible.com/ansible/latest/collections/openstack/cloud/server_module.html)
|
||||
- [Open Telekom Cloud Help Center](https://docs.otc.t-systems.com/)
|
BIN
_deprecated/cloud/ansible/doc/otc_1_project.gif
Normal file
BIN
_deprecated/cloud/ansible/doc/otc_1_project.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 204 KiB |
BIN
_deprecated/cloud/ansible/doc/otc_2_user.gif
Normal file
BIN
_deprecated/cloud/ansible/doc/otc_2_user.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 883 KiB |
BIN
_deprecated/cloud/ansible/doc/otc_3_login.gif
Normal file
BIN
_deprecated/cloud/ansible/doc/otc_3_login.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 148 KiB |
BIN
_deprecated/cloud/ansible/doc/otc_4_import_key.gif
Normal file
BIN
_deprecated/cloud/ansible/doc/otc_4_import_key.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 193 KiB |
BIN
_deprecated/cloud/ansible/doc/putty_agent_forwarding.png
Normal file
BIN
_deprecated/cloud/ansible/doc/putty_agent_forwarding.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
6
_deprecated/cloud/ansible/openstack/ansible.cfg
Normal file
6
_deprecated/cloud/ansible/openstack/ansible.cfg
Normal file
@ -0,0 +1,6 @@
|
||||
[defaults]
|
||||
host_key_checking = false
|
||||
|
||||
[ssh_connection]
|
||||
scp_if_ssh = true
|
||||
ssh_args = -o ServerAliveInterval=60
|
30
_deprecated/cloud/ansible/openstack/deploy_tpot.yaml
Normal file
30
_deprecated/cloud/ansible/openstack/deploy_tpot.yaml
Normal file
@ -0,0 +1,30 @@
|
||||
- name: Check host prerequisites
|
||||
hosts: localhost
|
||||
become: yes
|
||||
roles:
|
||||
- check
|
||||
|
||||
- name: Deploy instances
|
||||
hosts: localhost
|
||||
vars_files: my_os_cloud.yaml
|
||||
tasks:
|
||||
- name: Create security group and network
|
||||
ansible.builtin.include_role:
|
||||
name: create_net
|
||||
- name: Create one or more instances
|
||||
ansible.builtin.include_role:
|
||||
name: create_vm
|
||||
loop: "{{ range(0, 1) }}"
|
||||
loop_control:
|
||||
extended: yes
|
||||
|
||||
- name: Install T-Pot
|
||||
hosts: tpot
|
||||
remote_user: linux
|
||||
become: yes
|
||||
gather_facts: no
|
||||
roles:
|
||||
- install
|
||||
# - custom_ews
|
||||
# - custom_hpfeeds
|
||||
- reboot
|
2
_deprecated/cloud/ansible/openstack/my_os_cloud.yaml
Normal file
2
_deprecated/cloud/ansible/openstack/my_os_cloud.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
# Enter the name of your cloud to use from clouds.yaml
|
||||
cloud: open-telekom-cloud
|
2
_deprecated/cloud/ansible/openstack/requirements.yaml
Normal file
2
_deprecated/cloud/ansible/openstack/requirements.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
collections:
|
||||
- name: openstack.cloud
|
@ -0,0 +1,19 @@
|
||||
- name: Install dependencies
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- gcc
|
||||
- python3-dev
|
||||
- python3-setuptools
|
||||
- python3-pip
|
||||
state: present
|
||||
|
||||
- name: Install openstacksdk
|
||||
ansible.builtin.pip:
|
||||
name: openstacksdk
|
||||
executable: pip3
|
||||
|
||||
- name: Check if agent forwarding is enabled
|
||||
ansible.builtin.fail:
|
||||
msg: Please enable agent forwarding to allow Ansible to connect to the remote host!
|
||||
ignore_errors: yes
|
||||
failed_when: lookup('env','SSH_AUTH_SOCK') == ""
|
@ -0,0 +1,33 @@
|
||||
- name: Create security group
|
||||
openstack.cloud.security_group:
|
||||
cloud: "{{ cloud }}"
|
||||
name: sg-tpot-ansible
|
||||
description: Security Group for T-Pot
|
||||
|
||||
- name: Add rules to security group
|
||||
openstack.cloud.security_group_rule:
|
||||
cloud: "{{ cloud }}"
|
||||
security_group: sg-tpot-ansible
|
||||
remote_ip_prefix: 0.0.0.0/0
|
||||
|
||||
- name: Create network
|
||||
openstack.cloud.network:
|
||||
cloud: "{{ cloud }}"
|
||||
name: network-tpot-ansible
|
||||
|
||||
- name: Create subnet
|
||||
openstack.cloud.subnet:
|
||||
cloud: "{{ cloud }}"
|
||||
network_name: network-tpot-ansible
|
||||
name: subnet-tpot-ansible
|
||||
cidr: 192.168.0.0/24
|
||||
dns_nameservers:
|
||||
- 100.125.4.25
|
||||
- 100.125.129.199
|
||||
|
||||
- name: Create router
|
||||
openstack.cloud.router:
|
||||
cloud: "{{ cloud }}"
|
||||
name: router-tpot-ansible
|
||||
interfaces:
|
||||
- subnet-tpot-ansible
|
@ -0,0 +1,24 @@
|
||||
- name: Generate T-Pot name
|
||||
ansible.builtin.set_fact:
|
||||
tpot_name: "t-pot-ansible-{{ lookup('password', '/dev/null chars=ascii_lowercase,digits length=6') }}"
|
||||
|
||||
- name: Create instance {{ ansible_loop.index }} of {{ ansible_loop.length }}
|
||||
openstack.cloud.server:
|
||||
cloud: "{{ cloud }}"
|
||||
name: "{{ tpot_name }}"
|
||||
availability_zone: "{{ availability_zone }}"
|
||||
image: "{{ image }}"
|
||||
boot_from_volume: yes
|
||||
volume_size: "{{ volume_size }}"
|
||||
key_name: "{{ key_name }}"
|
||||
auto_ip: yes
|
||||
flavor: "{{ flavor }}"
|
||||
security_groups: sg-tpot-ansible
|
||||
network: network-tpot-ansible
|
||||
register: tpot
|
||||
|
||||
- name: Add instance to inventory
|
||||
ansible.builtin.add_host:
|
||||
hostname: "{{ tpot_name }}"
|
||||
ansible_host: "{{ tpot.server.public_v4 }}"
|
||||
groups: tpot
|
@ -0,0 +1,5 @@
|
||||
availability_zone: eu-de-03
|
||||
image: Standard_Debian_10_latest
|
||||
volume_size: 128
|
||||
key_name: your-KeyPair
|
||||
flavor: s3.medium.8
|
@ -0,0 +1,13 @@
|
||||
- name: Copy ews configuration file
|
||||
ansible.builtin.template:
|
||||
src: ews.cfg
|
||||
dest: /data/ews/conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Patching tpot.yml with custom ews configuration file
|
||||
ansible.builtin.lineinfile:
|
||||
path: /opt/tpot/etc/tpot.yml
|
||||
insertafter: "/opt/ewsposter/ews.ip"
|
||||
line: " - /data/ews/conf/ews.cfg:/opt/ewsposter/ews.cfg"
|
@ -0,0 +1,137 @@
|
||||
[MAIN]
|
||||
homedir = /opt/ewsposter/
|
||||
spooldir = /opt/ewsposter/spool/
|
||||
logdir = /opt/ewsposter/log/
|
||||
del_malware_after_send = false
|
||||
send_malware = true
|
||||
sendlimit = 500
|
||||
contact = your_email_address
|
||||
proxy =
|
||||
ip =
|
||||
|
||||
[EWS]
|
||||
ews = true
|
||||
username = your_username
|
||||
token = your_token
|
||||
rhost_first = https://community.sicherheitstacho.eu/ews-0.1/alert/postSimpleMessage
|
||||
rhost_second = https://community.sicherheitstacho.eu/ews-0.1/alert/postSimpleMessage
|
||||
ignorecert = false
|
||||
|
||||
[HPFEED]
|
||||
hpfeed = %(EWS_HPFEEDS_ENABLE)s
|
||||
host = %(EWS_HPFEEDS_HOST)s
|
||||
port = %(EWS_HPFEEDS_PORT)s
|
||||
channels = %(EWS_HPFEEDS_CHANNELS)s
|
||||
ident = %(EWS_HPFEEDS_IDENT)s
|
||||
secret= %(EWS_HPFEEDS_SECRET)s
|
||||
# path/to/certificate for tls broker - or "false" for non-tls broker
|
||||
tlscert = %(EWS_HPFEEDS_TLSCERT)s
|
||||
# hpfeeds submission format: "ews" (xml) or "json"
|
||||
hpfformat = %(EWS_HPFEEDS_FORMAT)s
|
||||
|
||||
[EWSJSON]
|
||||
json = false
|
||||
jsondir = /data/ews/json/
|
||||
|
||||
[GLASTOPFV3]
|
||||
glastopfv3 = true
|
||||
nodeid = glastopfv3-{{ ansible_hostname }}
|
||||
sqlitedb = /data/glastopf/db/glastopf.db
|
||||
malwaredir = /data/glastopf/data/files/
|
||||
|
||||
[GLASTOPFV2]
|
||||
glastopfv2 = false
|
||||
nodeid =
|
||||
mysqlhost =
|
||||
mysqldb =
|
||||
mysqluser =
|
||||
mysqlpw =
|
||||
malwaredir =
|
||||
|
||||
[KIPPO]
|
||||
kippo = false
|
||||
nodeid =
|
||||
mysqlhost =
|
||||
mysqldb =
|
||||
mysqluser =
|
||||
mysqlpw =
|
||||
malwaredir =
|
||||
|
||||
[COWRIE]
|
||||
cowrie = true
|
||||
nodeid = cowrie-{{ ansible_hostname }}
|
||||
logfile = /data/cowrie/log/cowrie.json
|
||||
|
||||
[DIONAEA]
|
||||
dionaea = true
|
||||
nodeid = dionaea-{{ ansible_hostname }}
|
||||
malwaredir = /data/dionaea/binaries/
|
||||
sqlitedb = /data/dionaea/log/dionaea.sqlite
|
||||
|
||||
[HONEYTRAP]
|
||||
honeytrap = true
|
||||
nodeid = honeytrap-{{ ansible_hostname }}
|
||||
newversion = true
|
||||
payloaddir = /data/honeytrap/attacks/
|
||||
attackerfile = /data/honeytrap/log/attacker.log
|
||||
|
||||
[RDPDETECT]
|
||||
rdpdetect = false
|
||||
nodeid =
|
||||
iptableslog =
|
||||
targetip =
|
||||
|
||||
[EMOBILITY]
|
||||
eMobility = false
|
||||
nodeid = emobility-{{ ansible_hostname }}
|
||||
logfile = /data/emobility/log/centralsystemEWS.log
|
||||
|
||||
[CONPOT]
|
||||
conpot = true
|
||||
nodeid = conpot-{{ ansible_hostname }}
|
||||
logfile = /data/conpot/log/conpot*.json
|
||||
|
||||
[ELASTICPOT]
|
||||
elasticpot = true
|
||||
nodeid = elasticpot-{{ ansible_hostname }}
|
||||
logfile = /data/elasticpot/log/elasticpot.log
|
||||
|
||||
[SURICATA]
|
||||
suricata = true
|
||||
nodeid = suricata-{{ ansible_hostname }}
|
||||
logfile = /data/suricata/log/eve.json
|
||||
|
||||
[MAILONEY]
|
||||
mailoney = true
|
||||
nodeid = mailoney-{{ ansible_hostname }}
|
||||
logfile = /data/mailoney/log/commands.log
|
||||
|
||||
[RDPY]
|
||||
rdpy = true
|
||||
nodeid = rdpy-{{ ansible_hostname }}
|
||||
logfile = /data/rdpy/log/rdpy.log
|
||||
|
||||
[VNCLOWPOT]
|
||||
vnclowpot = true
|
||||
nodeid = vnclowpot-{{ ansible_hostname }}
|
||||
logfile = /data/vnclowpot/log/vnclowpot.log
|
||||
|
||||
[HERALDING]
|
||||
heralding = true
|
||||
nodeid = heralding-{{ ansible_hostname }}
|
||||
logfile = /data/heralding/log/auth.csv
|
||||
|
||||
[CISCOASA]
|
||||
ciscoasa = true
|
||||
nodeid = ciscoasa-{{ ansible_hostname }}
|
||||
logfile = /data/ciscoasa/log/ciscoasa.log
|
||||
|
||||
[TANNER]
|
||||
tanner = true
|
||||
nodeid = tanner-{{ ansible_hostname }}
|
||||
logfile = /data/tanner/log/tanner_report.json
|
||||
|
||||
[GLUTTON]
|
||||
glutton = true
|
||||
nodeid = glutton-{{ ansible_hostname }}
|
||||
logfile = /data/glutton/log/glutton.log
|
@ -0,0 +1,8 @@
|
||||
myENABLE=false
|
||||
myHOST=host
|
||||
myPORT=port
|
||||
myCHANNEL=channels
|
||||
myCERT=false
|
||||
myIDENT=user
|
||||
mySECRET=secret
|
||||
myFORMAT=json
|
@ -0,0 +1,12 @@
|
||||
- name: Copy hpfeeds configuration file
|
||||
ansible.builtin.copy:
|
||||
src: hpfeeds.cfg
|
||||
dest: /data/ews/conf
|
||||
owner: tpot
|
||||
group: tpot
|
||||
mode: 0770
|
||||
register: config
|
||||
|
||||
- name: Applying hpfeeds settings
|
||||
ansible.builtin.command: /opt/tpot/bin/hpfeeds_optin.sh --conf=/data/ews/conf/hpfeeds.cfg
|
||||
when: config.changed == true
|
@ -0,0 +1,48 @@
|
||||
- name: Waiting for SSH connection
|
||||
ansible.builtin.wait_for_connection:
|
||||
|
||||
- name: Gathering facts
|
||||
ansible.builtin.setup:
|
||||
|
||||
- name: Cloning T-Pot install directory
|
||||
ansible.builtin.git:
|
||||
repo: "https://github.com/telekom-security/tpotce.git"
|
||||
dest: /root/tpot
|
||||
|
||||
- name: Prepare to set user password
|
||||
ansible.builtin.set_fact:
|
||||
user_name: "{{ ansible_user }}"
|
||||
user_salt: "s0mew1ck3dTpoT"
|
||||
no_log: true
|
||||
|
||||
- name: Changing password for user {{ user_name }}
|
||||
ansible.builtin.user:
|
||||
name: "{{ ansible_user }}"
|
||||
password: "{{ user_password | password_hash('sha512', user_salt) }}"
|
||||
state: present
|
||||
shell: /bin/bash
|
||||
|
||||
- name: Copy T-Pot configuration file
|
||||
ansible.builtin.copy:
|
||||
src: ../../../../../../iso/installer/tpot.conf.dist
|
||||
dest: /root/tpot.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Install T-Pot on instance - be patient, this might take 15 to 30 minutes depending on the connection speed.
|
||||
ansible.builtin.command: /root/tpot/iso/installer/install.sh --type=auto --conf=/root/tpot.conf
|
||||
|
||||
- name: Delete T-Pot configuration file
|
||||
ansible.builtin.file:
|
||||
path: /root/tpot.conf
|
||||
state: absent
|
||||
|
||||
- name: Change unattended-upgrades to take default action
|
||||
ansible.builtin.blockinfile:
|
||||
dest: /etc/apt/apt.conf.d/50unattended-upgrades
|
||||
block: |
|
||||
Dpkg::Options {
|
||||
"--force-confdef";
|
||||
"--force-confold";
|
||||
}
|
@ -0,0 +1 @@
|
||||
user_password: LiNuXuSeRPaSs#
|
@ -0,0 +1,16 @@
|
||||
- name: Finally rebooting T-Pot
|
||||
ansible.builtin.command: shutdown -r now
|
||||
async: 1
|
||||
poll: 0
|
||||
|
||||
- name: Next login options
|
||||
ansible.builtin.debug:
|
||||
msg:
|
||||
- "***** SSH Access:"
|
||||
- "***** ssh {{ ansible_user }}@{{ ansible_host }} -p 64295"
|
||||
- ""
|
||||
- "***** Web UI:"
|
||||
- "***** https://{{ ansible_host }}:64297"
|
||||
- ""
|
||||
- "***** Admin UI:"
|
||||
- "***** https://{{ ansible_host }}:64294"
|
Reference in New Issue
Block a user