Skip to content

Commit

Permalink
finish documentation
Browse files Browse the repository at this point in the history
add uninstaller playbook and script
tweaking and cleanup
  • Loading branch information
t3chn0m4g3 committed Mar 24, 2024
1 parent 013f817 commit 3a81e98
Show file tree
Hide file tree
Showing 7 changed files with 363 additions and 236 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ env bash -c "$(curl -sL https://github.com/telekom-security/tpotce/raw/alpha/ins
* [Installation Types](#installation-types)
* [Standard / HIVE](#standard--hive)
* [**Distributed**](#distributed)
* [Uninstall T-Pot (Linux only!) (to do)](#uninstall-t-pot-linux-only-to-do)
* [Uninstall T-Pot](#uninstall-t-pot)
* [First Start](#first-start)
* [Standalone First Start](#standalone-first-start)
* [Distributed Deployment](#distributed-deployment)
Expand Down Expand Up @@ -354,7 +354,8 @@ The distributed version of T-Pot requires at least two hosts
- The **SENSOR** will not start before finalizing the **SENSOR** installation as described in [Distributed Deployment](#distributed-deployment).
<br><br>

## Uninstall T-Pot (Linux only!) (to do)
## Uninstall T-Pot
Uninstallation of T-Pot is only available on the [supported Linux distros](#choose-your-distro).<br>
To uninstall T-Pot run `~/tpotce/uninstall.sh` and follow the uninstaller instructions, you will have to enter your password at least once.<br>
Once the uninstall is finished reboot the machine `sudo reboot`
<br><br>
Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ echo "# New htpasswd encoded credentials: ${myLS_WEB_USER_ENC}"
echo "# New htpasswd credentials base64 encoded: ${myLS_WEB_USER_ENC_B64}"
echo "# New SENSOR credentials base64 encoded: ${myTPOT_HIVE_USER}"
echo
echo "# When asked for a 'BECOME password' enter the password for your user on the SENSOR machine."
echo "# Ansible will ask for the ‘BECOME password‘ which is typically the password you ’sudo’ with on the SENSOR."
echo "# The password will allow Ansible to run a reboot via sudo on the SENSOR."
echo
Expand Down
13 changes: 9 additions & 4 deletions installer/install/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
---
- name: TPOT configuration playbook
###########################
# T-Pot Sensor Deployment #
###########################

- name: T-POT Sensor Deployment
hosts: all
vars:
local_nginx_cert_path: "~/tpotce/data/nginx/cert/nginx.crt"
remote_cert_path: "~/tpotce/data/hive.crt"
remote_sensor_yml_path: "~/tpotce/compose/sensor.yml"
remote_docker_compose_path: "~/tpotce/docker-compose.yml"
env_file_path: "~/tpotce/.env"

tasks:
- name: Ensure the destination directory exists
ansible.builtin.file:
Expand All @@ -23,19 +28,19 @@
ansible.builtin.command:
cmd: "cp {{ remote_sensor_yml_path }} {{ remote_docker_compose_path }}"

- name: Update TPOT_HIVE_USER in .env
- name: Update T-POT_HIVE_USER in .env
ansible.builtin.lineinfile:
path: "{{ env_file_path }}"
regexp: '^TPOT_HIVE_USER='
line: 'TPOT_HIVE_USER={{ lookup("env", "myTPOT_HIVE_USER") }}'

- name: Update TPOT_HIVE_IP in .env
- name: Update T-POT_HIVE_IP in .env
ansible.builtin.lineinfile:
path: "{{ env_file_path }}"
regexp: '^TPOT_HIVE_IP='
line: 'TPOT_HIVE_IP={{ lookup("env", "myTPOT_HIVE_IP") }}'

- name: Ensure TPOT_TYPE is set to SENSOR in .env
- name: Ensure T-POT_TYPE is set to SENSOR in .env
ansible.builtin.lineinfile:
path: "{{ env_file_path }}"
regexp: '^TPOT_TYPE='
Expand Down
12 changes: 6 additions & 6 deletions installer/install/tpot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,12 @@
- "Ubuntu"

tasks:
- name: Check for non-root user id (All)
debug:
msg: "Detected user: '{{ ansible_user_id }}'"
when: ansible_distribution in ["AlmaLinux", "Debian", "Fedora", "openSUSE Tumbleweed", "Raspbian", "Rocky", "Ubuntu"]
failed_when: ansible_user_id == "root"

- name: Add aliases (All)
blockinfile:
path: ~/.bashrc
Expand Down Expand Up @@ -703,12 +709,6 @@
append: yes
when: ansible_distribution in ["AlmaLinux", "Debian", "Fedora", "openSUSE Tumbleweed", "Raspbian", "Rocky", "Ubuntu"]

- name: Check for non-root user id (All)
debug:
msg: "Detected user: '{{ ansible_user_id }}'"
when: ansible_distribution in ["AlmaLinux", "Debian", "Fedora", "openSUSE Tumbleweed", "Raspbian", "Rocky", "Ubuntu"]
failed_when: ansible_user_id == "root"

########################################
# T-Pot - Install service and cron job #
########################################
Expand Down
55 changes: 0 additions & 55 deletions installer/remove/sudo.yml

This file was deleted.

Loading

0 comments on commit 3a81e98

Please sign in to comment.