Git initial commit
This commit is contained in:
commit
e319adc501
24 files changed
+790
No files matched your search
@@ -0,0 +1,5 @@
|
||||
[Definition]
|
||||
|
||||
failregex = ^<HOST> -.*GET .*/~.*
|
||||
|
||||
ignoreregex =
|
||||
@@ -0,0 +1,5 @@
|
||||
[Definition]
|
||||
|
||||
failregex = ^<HOST> -.*GET http.*
|
||||
|
||||
ignoreregex =
|
||||
@@ -0,0 +1,5 @@
|
||||
[Definition]
|
||||
|
||||
failregex = ^<HOST> -.*GET.*(\.asp|\.exe|\.pl|\.cgi|\.scgi)
|
||||
|
||||
ignoreregex =
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
[DEFAULT]
|
||||
bantime = {{ fail2ban_bantime }}
|
||||
findtime = {{ fail2ban_bantime }}
|
||||
maxretry = {{ fail2ban_maxretry }}
|
||||
|
||||
[sshd]
|
||||
enabled = true
|
||||
port = 22,{{ ssh_port }},ssh
|
||||
|
||||
[nginx-http-auth]
|
||||
enabled = {{ 'nginx' in fail2ban_activate_modules }}
|
||||
port = http,https
|
||||
filter = nginx-noscript
|
||||
logpath = %(nginx_error_log)s
|
||||
maxretry = 6
|
||||
|
||||
{% for filter in fail2ban_nginx_default_filter %}
|
||||
[{{ filter }}]
|
||||
enabled = {{ 'nginx' in fail2ban_activate_modules }}
|
||||
port = http,https
|
||||
filter = {{ filter }}
|
||||
logpath = %(nginx_access_log)s
|
||||
maxretry = 2
|
||||
|
||||
{% endfor %}
|
||||
{% for filter in fail2ban_nginx_selfmade_filter %}
|
||||
[{{ filter }}]
|
||||
enabled = {{ 'nginx' in fail2ban_activate_modules }}
|
||||
port = http,https
|
||||
filter = {{ filter }}
|
||||
logpath = %(nginx_access_log)s
|
||||
maxretry = 2
|
||||
|
||||
{% endfor %}
|
||||
Executable
+121
@@ -0,0 +1,121 @@
|
||||
# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $
|
||||
|
||||
# This is the sshd server system-wide configuration file. See
|
||||
# sshd_config(5) for more information.
|
||||
|
||||
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
||||
|
||||
# The strategy used for options in the default sshd_config shipped with
|
||||
# OpenSSH is to specify options with their default value where
|
||||
# possible, but leave them commented. Uncommented options override the
|
||||
# default value.
|
||||
Protocol {{ ssh_protocol_version }}
|
||||
Port {{ ssh_port }}
|
||||
#AddressFamily any
|
||||
#ListenAddress 0.0.0.0
|
||||
#ListenAddress ::
|
||||
|
||||
#HostKey /etc/ssh/ssh_host_rsa_key
|
||||
#HostKey /etc/ssh/ssh_host_ecdsa_key
|
||||
#HostKey /etc/ssh/ssh_host_ed25519_key
|
||||
|
||||
# Ciphers and keying
|
||||
#RekeyLimit default none
|
||||
|
||||
# Logging
|
||||
#SyslogFacility AUTH
|
||||
#LogLevel INFO
|
||||
|
||||
# Authentication:
|
||||
|
||||
#LoginGraceTime 10m
|
||||
PermitRootLogin {{ ssh_login_root }}
|
||||
#StrictModes yes
|
||||
#MaxAuthTries 6
|
||||
#MaxSessions 10
|
||||
|
||||
PubkeyAuthentication {{ ssh_use_key }}
|
||||
|
||||
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
|
||||
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
|
||||
|
||||
#AuthorizedPrincipalsFile none
|
||||
|
||||
#AuthorizedKeysCommand none
|
||||
#AuthorizedKeysCommandUser nobody
|
||||
|
||||
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
|
||||
#HostbasedAuthentication no
|
||||
# Change to yes if you don't trust ~/.ssh/known_hosts for
|
||||
# HostbasedAuthentication
|
||||
#IgnoreUserKnownHosts no
|
||||
# Don't read the user's ~/.rhosts and ~/.shosts files
|
||||
#IgnoreRhosts yes
|
||||
|
||||
# To disable tunneled clear text passwords, change to no here!
|
||||
PasswordAuthentication {{ ssh_use_password }}
|
||||
PermitEmptyPasswords no
|
||||
|
||||
# Change to yes to enable challenge-response passwords (beware issues with
|
||||
# some PAM modules and threads)
|
||||
ChallengeResponseAuthentication no
|
||||
|
||||
# Kerberos options
|
||||
#KerberosAuthentication no
|
||||
#KerberosOrLocalPasswd yes
|
||||
#KerberosTicketCleanup yes
|
||||
#KerberosGetAFSToken no
|
||||
|
||||
# GSSAPI options
|
||||
#GSSAPIAuthentication no
|
||||
#GSSAPICleanupCredentials yes
|
||||
#GSSAPIStrictAcceptorCheck yes
|
||||
#GSSAPIKeyExchange no
|
||||
|
||||
# Set this to 'yes' to enable PAM authentication, account processing,
|
||||
# and session processing. If this is enabled, PAM authentication will
|
||||
# be allowed through the ChallengeResponseAuthentication and
|
||||
# PasswordAuthentication. Depending on your PAM configuration,
|
||||
# PAM authentication via ChallengeResponseAuthentication may bypass
|
||||
# the setting of "PermitRootLogin without-password".
|
||||
# If you just want the PAM account and session checks to run without
|
||||
# PAM authentication, then enable this but set PasswordAuthentication
|
||||
# and ChallengeResponseAuthentication to 'no'.
|
||||
UsePAM yes
|
||||
|
||||
#AllowAgentForwarding yes
|
||||
#AllowTcpForwarding yes
|
||||
#GatewayPorts no
|
||||
X11Forwarding no
|
||||
#X11DisplayOffset 10
|
||||
#X11UseLocalhost yes
|
||||
#PermitTTY yes
|
||||
PrintMotd no
|
||||
#PrintLastLog yes
|
||||
#TCPKeepAlive yes
|
||||
#PermitUserEnvironment no
|
||||
#Compression delayed
|
||||
#ClientAliveInterval 0
|
||||
#ClientAliveCountMax 3
|
||||
#UseDNS no
|
||||
#PidFile /var/run/sshd.pid
|
||||
#MaxStartups 10:30:100
|
||||
#PermitTunnel no
|
||||
#ChrootDirectory none
|
||||
#VersionAddendum none
|
||||
|
||||
# no default banner path
|
||||
#Banner none
|
||||
|
||||
# Allow client to pass locale environment variables
|
||||
AcceptEnv LANG LC_*
|
||||
|
||||
# override default of no subsystems
|
||||
Subsystem sftp /usr/lib/openssh/sftp-server
|
||||
|
||||
# Example of overriding settings on a per-user basis
|
||||
#Match User anoncvs
|
||||
# X11Forwarding no
|
||||
# AllowTcpForwarding no
|
||||
# PermitTTY no
|
||||
# ForceCommand cvs server
|
||||
@@ -0,0 +1 @@
|
||||
{% if not wireguard_is_gateway %}{{ wireguard_clients[wireguard_client_host].private_key }}{% else %}{{ wireguard_gateway_private_key }}{% endif %}
|
||||
@@ -0,0 +1 @@
|
||||
{% if not wireguard_is_gateway %}{{ wireguard_clients[wireguard_client_host].public_key }}{% else %}{{ wireguard_gateway_public_key }}{% endif %}
|
||||
@@ -0,0 +1,11 @@
|
||||
[Interface]
|
||||
Address = {{ wireguard_gateway_net_prefix }}.{{ wireguard_clients[wireguard_client_host].index }}/32
|
||||
PrivateKey = {{ wireguard_clients[wireguard_client_host].private_key }}
|
||||
DNS = {{ cloud_internal_dns }}
|
||||
|
||||
[Peer]
|
||||
PublicKey = {{ wireguard_gateway_public_key }}
|
||||
Endpoint = {{ wireguard_gateway_host }}:{{ wireguard_gateway_port }}
|
||||
AllowedIPs = {{ wireguard_gateway_net_prefix }}.1/{% if wireguard_allow_adjacent_client_traffic %}{{ wireguard_gateway_net_cidr }}{% else %}32{% endif %}
|
||||
|
||||
PersistentKeepalive = {{ wireguard_keepalive }}
|
||||
@@ -0,0 +1,25 @@
|
||||
[Interface]
|
||||
Address = {{ wireguard_gateway_net_prefix }}.1/{{ wireguard_gateway_net_cidr }}
|
||||
ListenPort = {{ wireguard_gateway_port }}
|
||||
PrivateKey = {{ wireguard_gateway_private_key }}
|
||||
|
||||
{% if wireguard_gateway_forward is defined and wireguard_gateway_forward | length > 0 %}
|
||||
PreUp = sysctl -w net.ipv4.ip_forward=1
|
||||
PreUp = sysctl -w net.ipv6.conf.all.forwarding=1
|
||||
|
||||
{% for config in wireguard_gateway_forward %}
|
||||
PreUp = iptables -t nat -A PREROUTING -i {{ wireguard_gateway_interface }} -p tcp --dport {{ config.server_port }} -j DNAT --to-destination {{ wireguard_gateway_net_prefix }}.{{ config.client_index }}:{{ config.client_port }}
|
||||
PostDown = iptables -t nat -D PREROUTING -i {{ wireguard_gateway_interface }} -p tcp --dport {{ config.server_port }} -j DNAT --to-destination {{ wireguard_gateway_net_prefix }}.{{ config.client_index }}:{{ config.client_port }}
|
||||
|
||||
{% endfor %}
|
||||
PreUp = iptables -t nat -A POSTROUTING -o {{ cloud_name }} -j MASQUERADE
|
||||
PostDown = iptables -t nat -D POSTROUTING -o {{ cloud_name }} -j MASQUERADE
|
||||
{% endif %}
|
||||
|
||||
{% for client in wireguard_clients %}
|
||||
## Wireguard {{ cloud_name }} - {{ client }} ##
|
||||
[Peer]
|
||||
PublicKey = {{ wireguard_clients[client].public_key }}
|
||||
AllowedIPs = {{ wireguard_gateway_net_prefix }}.{{ wireguard_clients[client].index }}/32
|
||||
|
||||
{% endfor %}
|
||||
Reference in new issue
Block a user