From bbc5877eb9dd72e71d48a06f553d7b0bbf78caf5 Mon Sep 17 00:00:00 2001 From: bjdgyc <bjdgyc@163.com> Date: Fri, 22 Sep 2023 16:18:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dheader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/conf/profile.xml | 11 ++++++++++- server/pkg/utils/secure_header.go | 8 ++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/server/conf/profile.xml b/server/conf/profile.xml index 0df0912..81645b8 100644 --- a/server/conf/profile.xml +++ b/server/conf/profile.xml @@ -8,6 +8,7 @@ <RestrictPreferenceCaching>false</RestrictPreferenceCaching> <RestrictTunnelProtocols>IPSec</RestrictTunnelProtocols> <BypassDownloader>true</BypassDownloader> + <AutoUpdate UserControllable="false">false</AutoUpdate> <WindowsVPNEstablishment>AllowRemoteUsers</WindowsVPNEstablishment> <LinuxVPNEstablishment>AllowRemoteUsers</LinuxVPNEstablishment> <CertEnrollmentPin>pinAllowed</CertEnrollmentPin> @@ -21,14 +22,22 @@ </CertificateMatch> <BackupServerList> - <HostAddress>localhost</HostAddress> + <HostAddress>localhost-bak</HostAddress> </BackupServerList> </ClientInitialization> <ServerList> + <HostEntry> <HostName>VPN Server</HostName> <HostAddress>localhost</HostAddress> </HostEntry> + + <HostEntry> + <HostName>VPN Server2</HostName> + <HostAddress>localhost2</HostAddress> + </HostEntry> + + </ServerList> </AnyConnectProfile> \ No newline at end of file diff --git a/server/pkg/utils/secure_header.go b/server/pkg/utils/secure_header.go index f323693..f31dbe1 100644 --- a/server/pkg/utils/secure_header.go +++ b/server/pkg/utils/secure_header.go @@ -13,17 +13,17 @@ func SetSecureHeader(w http.ResponseWriter) { w.Header().Set("Cache-Control", "no-store,no-cache") w.Header().Set("Pragma", "no-cache") w.Header().Set("Connection", "keep-alive") - w.Header().Set("X-Frame-Options", "deny") + w.Header().Set("X-Frame-Options", "SAMEORIGIN") w.Header().Set("X-Content-Type-Options", "nosniff") w.Header().Set("X-Download-Options", "noopen") - w.Header().Set("Content-Security-Policy", "default-src 'self' 'unsafe-inline'") + w.Header().Set("Content-Security-Policy", "default-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob:; frame-ancestors 'self'; base-uri 'self'; block-all-mixed-content") w.Header().Set("X-Permitted-Cross-Domain-Policies", "none") w.Header().Set("Referrer-Policy", "no-referrer") w.Header().Set("Cross-Origin-Embedder-Policy", "require-corp") w.Header().Set("Cross-Origin-Opener-Policy", "same-origin") w.Header().Set("Cross-Origin-Resource-Policy", "same-origin") - w.Header().Set("X-XSS-Protection", "0") - w.Header().Set("Strict-Transport-Security", "max-age=31536000") + w.Header().Set("X-XSS-Protection", "1") + w.Header().Set("Strict-Transport-Security", "max-age=31536000; includeSubDomains") // w.Header().Set("Clear-Site-Data", "cache,cookies,storage") }