Hello,
I got my Turris Omnia a month ago and I am currently trying to harden my setup. I have several networks for different purposes. All except one should not have access to the Turris administration interfaces (Foris/LuCI). For most this is not a problem as I can deny access to the router itself. The problem is my main LAN as I have also Nextcloud installed on the router that my family should use. So I cannot simply block access to the router.
What I want to achieve is that clients in the LAN are able to connect to Nextcloud but not to Foris or LuCI. The firewall only allows to block on IP addresses and ports. By default, those are the same for Nextcloud and Foris/LuCI. I managed to change the Nextcloud port to a different port but only for http. When I tried to configure https for it it broke and lighttpd did not start anymore.
Below I copied my attempt to change the default lighttpd configuration. Obviously, it is a problem with enabling TLS. Because when I do the changes in ssl-enable.conf lighttpd will not start anymore. But I am not even sure if this is a best way to address my problem. What I really want to achieve is that everyone in the network 192.168.51.0/24 can reach Nextcloud that is running on 192.168.51.13. At the same time, they should not be able to reach anything else on the router.
Any help/suggestion is appreciated.
Georg
=================================
nextcloud.conf:
$SERVER[“socket”] == “192.168.51.13:82” {
alias.url += ( “/nextcloud” => “/srv/www/nextcloud” )
$HTTP[“url”] =~ “^/nextcloud” {
# Add ‘X-Frame-Options’ header, making sure it the website is not embedded in a frame or iframe.
# This avoids clickjacking, and might be helpfull for HTTPS websites
# As frames are not used nowadays, this should be safe to enable at least SAMEORIGIN
# Other option might be DENY or ALLOW-FROM. DENY is not used as frame is used in some old LuCI modules
setenv.add-response-header += ( “X-Frame-Options” => “SAMEORIGIN”)
}
$HTTP[“url”] =~ “^/nextcloud/(build|tests|config|lib|3rdparty|templates|data)” {
url.access-deny = ("")
}
}
ssl-enable.conf:
This settings enables https with user-generated self-signed certificate from
package https-cert
$SERVER[“socket”] == “:443” {
ssl.engine = "enable"
ssl.pemfile = “/etc/lighttpd-self-signed.pem”
}
$SERVER[“socket”] == “[::]:443” {
ssl.engine = "enable"
ssl.pemfile = “/etc/lighttpd-self-signed.pem”
}
$SERVER[“socket”] == “:82” {
ssl.engine = "enable"
ssl.pemfile = “/etc/lighttpd-self-signed.pem”
}
$HTTP[“scheme”] == “https” {
# Add ‘HTTP Strict Transport Security’ header (HSTS) to sites
# setenv.add-response-header += ( “Strict-Transport-Security” => “max-age=31536000; includeSubDomains” )
}