Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
6e7a5f56
Commit
6e7a5f56
authored
Jun 28, 2019
by
bcebere
Committed by
corbot[bot]
Jun 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TLS hardening (#2938)
Automatically submitted.
parent
41661b08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
plugin/tls/tls.go
plugin/tls/tls.go
+20
-0
No files found.
plugin/tls/tls.go
View file @
6e7a5f56
...
@@ -25,6 +25,23 @@ func setup(c *caddy.Controller) error {
...
@@ -25,6 +25,23 @@ func setup(c *caddy.Controller) error {
return
nil
return
nil
}
}
func
setTLSDefaults
(
tls
*
ctls
.
Config
)
{
tls
.
MinVersion
=
ctls
.
VersionTLS12
tls
.
MaxVersion
=
ctls
.
VersionTLS13
tls
.
CipherSuites
=
[]
uint16
{
ctls
.
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
,
ctls
.
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
,
ctls
.
TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305
,
ctls
.
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305
,
ctls
.
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
,
ctls
.
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
,
ctls
.
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
,
ctls
.
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
,
ctls
.
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
,
}
tls
.
PreferServerCipherSuites
=
true
}
func
parseTLS
(
c
*
caddy
.
Controller
)
error
{
func
parseTLS
(
c
*
caddy
.
Controller
)
error
{
config
:=
dnsserver
.
GetConfig
(
c
)
config
:=
dnsserver
.
GetConfig
(
c
)
...
@@ -70,6 +87,9 @@ func parseTLS(c *caddy.Controller) error {
...
@@ -70,6 +87,9 @@ func parseTLS(c *caddy.Controller) error {
tls
.
ClientAuth
=
clientAuth
tls
.
ClientAuth
=
clientAuth
// NewTLSConfigFromArgs only sets RootCAs, so we need to let ClientCAs refer to it.
// NewTLSConfigFromArgs only sets RootCAs, so we need to let ClientCAs refer to it.
tls
.
ClientCAs
=
tls
.
RootCAs
tls
.
ClientCAs
=
tls
.
RootCAs
setTLSDefaults
(
tls
)
config
.
TLSConfig
=
tls
config
.
TLSConfig
=
tls
}
}
return
nil
return
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment