Add Tailscale configuration
This commit is contained in:
		
							parent
							
								
									1e210137ad
								
							
						
					
					
						commit
						71ac76ea98
					
				
					 1 changed files with 30 additions and 2 deletions
				
			
		
							
								
								
									
										32
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										32
									
								
								README.md
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -8,6 +8,7 @@
 | 
			
		|||
  - [Table of Contents](#table-of-contents)
 | 
			
		||||
  - [Prerequisites](#prerequisites)
 | 
			
		||||
    - [Server Setup](#server-setup)
 | 
			
		||||
    - [Tailscale](#tailscale)
 | 
			
		||||
    - [Base23 Docker registry login](#base23-docker-registry-login)
 | 
			
		||||
    - [CrowdSec](#crowdsec)
 | 
			
		||||
      - [Setup CrowdSec Repo](#setup-crowdsec-repo)
 | 
			
		||||
| 
						 | 
				
			
			@ -48,6 +49,21 @@ apt update \
 | 
			
		|||
  && unset TEMP_DIR
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Tailscale
 | 
			
		||||
 | 
			
		||||
```shell
 | 
			
		||||
printf "Enter preauthkey for Tailscale: " \
 | 
			
		||||
  && read -rs TAILSCALE_PREAUTHKEY \
 | 
			
		||||
  && curl -fsSL https://pkgs.tailscale.com/stable/debian/bookworm.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null \
 | 
			
		||||
  && curl -fsSL https://pkgs.tailscale.com/stable/debian/bookworm.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list \
 | 
			
		||||
  && apt-get update \
 | 
			
		||||
  && apt-get install tailscale \
 | 
			
		||||
  && tailscale up --login-server https://vpn.base23.de --authkey ${TAILSCALE_PREAUTHKEY} --advertise-tags=tag:prod-servers \
 | 
			
		||||
  && sleep 2 \
 | 
			
		||||
  && tailscale status \
 | 
			
		||||
  && unset TAILSCALE_PREAUTHKEY
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Base23 Docker registry login
 | 
			
		||||
 | 
			
		||||
```shell
 | 
			
		||||
| 
						 | 
				
			
			@ -74,10 +90,22 @@ EOF
 | 
			
		|||
 | 
			
		||||
#### Install CrowdSec
 | 
			
		||||
 | 
			
		||||
Install CrowdSec:
 | 
			
		||||
 | 
			
		||||
```shell
 | 
			
		||||
apt install -y crowdsec crowdsec-firewall-bouncer-iptables \
 | 
			
		||||
printf "Enter CrowdSec context: " \
 | 
			
		||||
  && read -rs CROWDSEC_CONTEXT \
 | 
			
		||||
  && apt install -y crowdsec crowdsec-firewall-bouncer-iptables \
 | 
			
		||||
  && cscli completion bash | tee /etc/bash_completion.d/cscli \
 | 
			
		||||
  && source ~/.bashrc
 | 
			
		||||
  && source ~/.bashrc \
 | 
			
		||||
  && cscli console enroll -e context ${CROWDSEC_CONTEXT} \
 | 
			
		||||
  && unset CROWDSEC_CONTEXT
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Restart CordSec Service, after accepting the enrollment on the [CrowdSec Console](https://app.crowdsec.net/):
 | 
			
		||||
 | 
			
		||||
```shell
 | 
			
		||||
systemctl restart crowdsec; systemctl status crowdsec.service
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### Configure CrowdSec
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue