This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| gateway_centos_7 [2015/03/30 19:28] – herwarth | gateway_centos_7 [2016/01/01 14:05] (current) – herwarth | ||
|---|---|---|---|
| Line 173: | Line 173: | ||
| max-lease-time 172800; | max-lease-time 172800; | ||
| authoritative; | authoritative; | ||
| - | |||
| subnet 10.108.108.0 netmask 255.255.255.0 { | subnet 10.108.108.0 netmask 255.255.255.0 { | ||
| Line 196: | Line 195: | ||
| . | . | ||
| visible_hostname gateway.lz.local | visible_hostname gateway.lz.local | ||
| - | http_port 3128 | + | http_port |
| . | . | ||
| #enable only (adapt to zorgnet subnet) | #enable only (adapt to zorgnet subnet) | ||
| Line 203: | Line 202: | ||
| #enable 1024MB cache-size | #enable 1024MB cache-size | ||
| cache_dir ufs / | cache_dir ufs / | ||
| + | . | ||
| + | # Diable IPv6 | ||
| + | dns_v4_first on | ||
| . | . | ||
| </ | </ | ||
| Line 210: | Line 212: | ||
| On the Windows client set the proxy server as the Administrator user in IE. After that run command-box with the following command: | On the Windows client set the proxy server as the Administrator user in IE. After that run command-box with the following command: | ||
| netsh winhttp import proxy source=ie | netsh winhttp import proxy source=ie | ||
| + | |||
| + | Or use a proxy.pac file: | ||
| + | <code - / | ||
| + | function FindProxyForURL(url, | ||
| + | |||
| + | // If the requested website is hosted within the internal network, send direct. | ||
| + | if (isPlainHostName(host) || | ||
| + | shExpMatch(host, | ||
| + | shExpMatch(host, | ||
| + | shExpMatch(host, | ||
| + | return " | ||
| + | else | ||
| + | return "PROXY 10.108.108.5: | ||
| + | } | ||
| + | </ | ||
| + | cd / | ||
| + | ln -s proxy.pac wpad.dat | ||
| + | |||
| =====Guacamole===== | =====Guacamole===== | ||
| This is the HTML5 RDP/SSH/VNC gateway application using Tomcat and Apache as reverse-proxy. | This is the HTML5 RDP/SSH/VNC gateway application using Tomcat and Apache as reverse-proxy. | ||
| Line 251: | Line 271: | ||
| setsebool -P httpd_can_network_connect 1 | setsebool -P httpd_can_network_connect 1 | ||
| ====Configuration==== | ====Configuration==== | ||
| - | <code - / | + | <code - / |
| < | < | ||
| ServerAdmin webmaster@helux.nl | ServerAdmin webmaster@helux.nl | ||
| - | | + | |
| - | RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L] | + | AllowOverride All |
| + | Options MultiViews FollowSymlinks SymLinksIfOwnerMatch IncludesNoExec | ||
| + | Options -Indexes | ||
| + | Order allow,deny | ||
| + | Allow from all | ||
| + | </ | ||
| - | | + | |
| - | | + | AddType application/x-ns-proxy-autoconfig pac |
| - | </VirtualHost> | + | |
| + | <Files " | ||
| + | AddType application/x-ns-proxy-autoconfig dat | ||
| + | </Files> | ||
| + | ErrorLog / | ||
| + | CustomLog / | ||
| + | </ | ||
| + | </ | ||
| + | <code - / | ||
| < | < | ||
| ServerAdmin webmaster@helux.nl | ServerAdmin webmaster@helux.nl | ||
| Line 346: | Line 379: | ||
| | | ||
| ====Create new zones==== | ====Create new zones==== | ||
| - | firewall-cmd --permanent --new-zone=local | ||
| firewall-cmd --permanent --new-zone=zorgnet | firewall-cmd --permanent --new-zone=zorgnet | ||
| Line 353: | Line 385: | ||
| firewall-cmd --permanent --zone=public --add-source=0.0.0.0/ | firewall-cmd --permanent --zone=public --add-source=0.0.0.0/ | ||
| firewall-cmd --permanent --zone=public --add-source=::/ | firewall-cmd --permanent --zone=public --add-source=::/ | ||
| - | |||
| - | firewall-cmd --permanent --zone=local --add-source=172.16.3.0/ | ||
| firewall-cmd --permanent --zone=zorgnet --add-source=10.108.108.0/ | firewall-cmd --permanent --zone=zorgnet --add-source=10.108.108.0/ | ||
| Line 371: | Line 401: | ||
| firewall-cmd --permanent --zone=public --add-service=http | firewall-cmd --permanent --zone=public --add-service=http | ||
| firewall-cmd --permanent --zone=public --add-service=https | firewall-cmd --permanent --zone=public --add-service=https | ||
| - | + | | |
| - | | + | |
| - | firewall-cmd --permanent --zone=local --add-service=http | + | |
| - | firewall-cmd --permanent --zone=local --add-service=https | + | |
| firewall-cmd --permanent --zone=zorgnet --add-service=ssh | firewall-cmd --permanent --zone=zorgnet --add-service=ssh | ||
| Line 385: | Line 412: | ||
| ====Set default zone==== | ====Set default zone==== | ||
| - | firewall-cmd --set-default-zone=local | + | firewall-cmd --set-default-zone=public |
| systemctl enable firewalld | systemctl enable firewalld | ||
| + | =====Fail2ban===== | ||
| + | yum install -y fail2ban fail2ban-systemd | ||
| + | yum update -y selinux-policy* | ||
| + | Configure fail2ban, we decide to use FirewallD which is implemented by default in CentOS 7. | ||
| + | Put the following lines in / | ||
| + | <code - / | ||
| + | [sshd] | ||
| + | enabled = true | ||
| + | port = ssh | ||
| + | logpath = %(sshd_log)s | ||
| + | maxretry = 5 | ||
| + | bantime = 86400 | ||
| + | </ | ||
| + | |||
| + | systemctl enable fail2ban | ||
| + | systemctl start fail2ban | ||
| {{tag> | {{tag> | ||