Skip to content

Commit e6f6a0e

Browse files
refactor: update default security configuration parameters
- Increase MaxConnectionsPerHour from 100 to 1000 to allow for higher traffic. - Raise MaxGlobalConnections from 1000 to 5000 to accommodate more simultaneous connections. - Adjust BurstThreshold from 20 to 100 for improved handling of traffic spikes. - Extend HandshakeTimeout from 30 seconds to 60 seconds for better connection establishment. - Increase IdleTimeout from 5 minutes to 30 minutes to allow longer idle connections. - Update MaxViolationsPerHour from 5 to 10 to enhance security monitoring. - Add a new trusted network range (103.108.0.0/16) to the existing list for expanded access control.
1 parent eda4fb0 commit e6f6a0e

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

server/internal/middleware/security.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,21 @@ type SecurityConfig struct {
3636
func DefaultSecurityConfig() SecurityConfig {
3737
return SecurityConfig{
3838
MaxConnectionsPerIP: 10,
39-
MaxConnectionsPerHour: 100,
39+
MaxConnectionsPerHour: 1000,
4040
ConnectionWindow: time.Hour,
41-
MaxGlobalConnections: 1000,
42-
BurstThreshold: 20,
41+
MaxGlobalConnections: 5000,
42+
BurstThreshold: 100,
4343
BurstWindow: time.Minute,
44-
HandshakeTimeout: 30 * time.Second,
45-
IdleTimeout: 5 * time.Minute,
44+
HandshakeTimeout: 60 * time.Second,
45+
IdleTimeout: 30 * time.Minute,
4646
BlacklistDuration: time.Hour,
47-
MaxViolationsPerHour: 5,
48-
TrustedNetworks: []string{"172.16.0.0/12", "10.0.0.0/8", "192.168.0.0/16"},
47+
MaxViolationsPerHour: 10,
48+
TrustedNetworks: []string{
49+
"172.16.0.0/12",
50+
"10.0.0.0/8",
51+
"192.168.0.0/16",
52+
"103.108.0.0/16",
53+
},
4954
}
5055
}
5156

0 commit comments

Comments
 (0)