Skip to content

Commit ce5b632

Browse files
committed
update TLS security profile documentation for clarity and consistency
1 parent 0952bf6 commit ce5b632

File tree

1 file changed

+55
-97
lines changed

1 file changed

+55
-97
lines changed

config/v1/types_tlssecurityprofile.go

Lines changed: 55 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -4,178 +4,130 @@ package v1
44
// is used by operators to apply TLS security settings to operands.
55
// +union
66
type TLSSecurityProfile struct {
7-
// type is one of Old, Intermediate, Modern or Custom. Custom provides
8-
// the ability to specify individual TLS security profile parameters.
9-
// Old, Intermediate and Modern are TLS security profiles based on:
7+
// type is one of Old, Intermediate, Modern or Custom. Custom provides the
8+
// ability to specify individual TLS security profile parameters.
109
//
11-
// https://wiki.mozilla.org/Security/Server_Side_TLS#Recommended_configurations
10+
// The profiles are currently based on version 5.0 of the Mozilla Server Side TLS
11+
// configuration guidelines (released 2019-06-28) with TLS 1.3 ciphers added for
12+
// forward compatibility. See: https://ssl-config.mozilla.org/guidelines/5.0.json
1213
//
13-
// The profiles are intent based, so they may change over time as new ciphers are developed and existing ciphers
14-
// are found to be insecure. Depending on precisely which ciphers are available to a process, the list may be
15-
// reduced.
16-
//
17-
// Note that the Modern profile is currently not supported because it is not
18-
// yet well adopted by common software libraries.
14+
// The profiles are intent based, so they may change over time as new ciphers are
15+
// developed and existing ciphers are found to be insecure. Depending on
16+
// precisely which ciphers are available to a process, the list may be reduced.
1917
//
2018
// +unionDiscriminator
2119
// +optional
2220
Type TLSProfileType `json:"type"`
23-
// old is a TLS security profile based on:
24-
//
25-
// https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility
21+
22+
// old is a TLS profile for use when services need to be accessed by very old
23+
// clients or libraries and should be used only as a last resort.
2624
//
27-
// and looks like this (yaml):
25+
// The cipher list includes TLS 1.3 ciphers for forward compatibility, followed by
26+
// the Mozilla 5.0 "old" profile ciphers.
2827
//
28+
// This profile is equivalent to a Custom profile specified as:
29+
// minTLSVersion: VersionTLS10
2930
// ciphers:
30-
//
3131
// - TLS_AES_128_GCM_SHA256
32-
//
3332
// - TLS_AES_256_GCM_SHA384
34-
//
3533
// - TLS_CHACHA20_POLY1305_SHA256
36-
//
3734
// - ECDHE-ECDSA-AES128-GCM-SHA256
38-
//
3935
// - ECDHE-RSA-AES128-GCM-SHA256
40-
//
4136
// - ECDHE-ECDSA-AES256-GCM-SHA384
42-
//
4337
// - ECDHE-RSA-AES256-GCM-SHA384
44-
//
4538
// - ECDHE-ECDSA-CHACHA20-POLY1305
46-
//
4739
// - ECDHE-RSA-CHACHA20-POLY1305
48-
//
4940
// - DHE-RSA-AES128-GCM-SHA256
50-
//
5141
// - DHE-RSA-AES256-GCM-SHA384
52-
//
5342
// - DHE-RSA-CHACHA20-POLY1305
54-
//
5543
// - ECDHE-ECDSA-AES128-SHA256
56-
//
5744
// - ECDHE-RSA-AES128-SHA256
58-
//
5945
// - ECDHE-ECDSA-AES128-SHA
60-
//
6146
// - ECDHE-RSA-AES128-SHA
62-
//
6347
// - ECDHE-ECDSA-AES256-SHA384
64-
//
6548
// - ECDHE-RSA-AES256-SHA384
66-
//
6749
// - ECDHE-ECDSA-AES256-SHA
68-
//
6950
// - ECDHE-RSA-AES256-SHA
70-
//
7151
// - DHE-RSA-AES128-SHA256
72-
//
7352
// - DHE-RSA-AES256-SHA256
74-
//
7553
// - AES128-GCM-SHA256
76-
//
7754
// - AES256-GCM-SHA384
78-
//
7955
// - AES128-SHA256
80-
//
8156
// - AES256-SHA256
82-
//
8357
// - AES128-SHA
84-
//
8558
// - AES256-SHA
86-
//
8759
// - DES-CBC3-SHA
8860
//
89-
// minTLSVersion: VersionTLS10
90-
//
9161
// +optional
9262
// +nullable
9363
Old *OldTLSProfile `json:"old,omitempty"`
94-
// intermediate is a TLS security profile based on:
95-
//
96-
// https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29
64+
65+
// intermediate is a TLS profile for use when you do not need compatibility with
66+
// legacy clients such as Windows XP or old versions of OpenSSL and want remain
67+
// highly secure while being compatible with most clients currently in use.
9768
//
98-
// and looks like this (yaml):
69+
// The cipher list includes TLS 1.3 ciphers for forward compatibility, followed by
70+
// the Mozilla 5.0 "intermediate" profile ciphers.
9971
//
72+
// This profile is equivalent to a Custom profile specified as:
73+
// minTLSVersion: VersionTLS12
10074
// ciphers:
101-
//
10275
// - TLS_AES_128_GCM_SHA256
103-
//
10476
// - TLS_AES_256_GCM_SHA384
105-
//
10677
// - TLS_CHACHA20_POLY1305_SHA256
107-
//
10878
// - ECDHE-ECDSA-AES128-GCM-SHA256
109-
//
11079
// - ECDHE-RSA-AES128-GCM-SHA256
111-
//
11280
// - ECDHE-ECDSA-AES256-GCM-SHA384
113-
//
11481
// - ECDHE-RSA-AES256-GCM-SHA384
115-
//
11682
// - ECDHE-ECDSA-CHACHA20-POLY1305
117-
//
11883
// - ECDHE-RSA-CHACHA20-POLY1305
119-
//
12084
// - DHE-RSA-AES128-GCM-SHA256
121-
//
12285
// - DHE-RSA-AES256-GCM-SHA384
12386
//
124-
// minTLSVersion: VersionTLS12
125-
//
12687
// +optional
12788
// +nullable
12889
Intermediate *IntermediateTLSProfile `json:"intermediate,omitempty"`
129-
// modern is a TLS security profile based on:
130-
//
131-
// https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility
132-
//
133-
// and looks like this (yaml):
90+
91+
// modern is a TLS security profile for use with clients that support TLS 1.3 and
92+
// don't need backward compatibility.
13493
//
94+
// This profile is equivalent to a Custom profile specified as:
95+
// minTLSVersion: VersionTLS13
13596
// ciphers:
136-
//
13797
// - TLS_AES_128_GCM_SHA256
138-
//
13998
// - TLS_AES_256_GCM_SHA384
140-
//
14199
// - TLS_CHACHA20_POLY1305_SHA256
142100
//
143-
// minTLSVersion: VersionTLS13
144-
//
145101
// +optional
146102
// +nullable
147103
Modern *ModernTLSProfile `json:"modern,omitempty"`
104+
148105
// custom is a user-defined TLS security profile. Be extremely careful using a custom
149106
// profile as invalid configurations can be catastrophic. An example custom profile
150107
// looks like this:
151108
//
109+
// minTLSVersion: VersionTLS11
152110
// ciphers:
153-
//
154111
// - ECDHE-ECDSA-CHACHA20-POLY1305
155-
//
156112
// - ECDHE-RSA-CHACHA20-POLY1305
157-
//
158113
// - ECDHE-RSA-AES128-GCM-SHA256
159-
//
160114
// - ECDHE-ECDSA-AES128-GCM-SHA256
161115
//
162-
// minTLSVersion: VersionTLS11
163-
//
164116
// +optional
165117
// +nullable
166118
Custom *CustomTLSProfile `json:"custom,omitempty"`
167119
}
168120

169-
// OldTLSProfile is a TLS security profile based on:
170-
// https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility
121+
// OldTLSProfile is a TLS security profile based on the "old" configuration of
122+
// the Mozilla Server Side TLS configuration guidelines.
171123
type OldTLSProfile struct{}
172124

173-
// IntermediateTLSProfile is a TLS security profile based on:
174-
// https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29
125+
// IntermediateTLSProfile is a TLS security profile based on the "intermediate"
126+
// configuration of the Mozilla Server Side TLS configuration guidelines.
175127
type IntermediateTLSProfile struct{}
176128

177-
// ModernTLSProfile is a TLS security profile based on:
178-
// https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility
129+
// ModernTLSProfile is a TLS security profile based on the "modern" configuration
130+
// of the Mozilla Server Side TLS configuration guidelines.
179131
type ModernTLSProfile struct{}
180132

181133
// CustomTLSProfile is a user-defined TLS security profile. Be extremely careful
@@ -189,16 +141,19 @@ type CustomTLSProfile struct {
189141
type TLSProfileType string
190142

191143
const (
192-
// Old is a TLS security profile based on:
193-
// https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility
144+
// TLSProfileOldType sets parameters based on the "old" configuration of
145+
// the Mozilla Server Side TLS configuration guidelines.
194146
TLSProfileOldType TLSProfileType = "Old"
195-
// Intermediate is a TLS security profile based on:
196-
// https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29
147+
148+
// TLSProfileIntermediateType sets parameters based on the "intermediate"
149+
// configuration of the Mozilla Server Side TLS configuration guidelines.
197150
TLSProfileIntermediateType TLSProfileType = "Intermediate"
198-
// Modern is a TLS security profile based on:
199-
// https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility
151+
152+
// TLSProfileModernType sets parameters based on the "modern" configuration
153+
// of the Mozilla Server Side TLS configuration guidelines.
200154
TLSProfileModernType TLSProfileType = "Modern"
201-
// Custom is a TLS security profile that allows for user-defined parameters.
155+
156+
// TLSProfileCustomType is a TLS security profile that allows for user-defined parameters.
202157
TLSProfileCustomType TLSProfileType = "Custom"
203158
)
204159

@@ -219,8 +174,6 @@ type TLSProfileSpec struct {
219174
//
220175
// minTLSVersion: VersionTLS11
221176
//
222-
// NOTE: currently the highest minTLSVersion allowed is VersionTLS12
223-
//
224177
MinTLSVersion TLSProtocolVersion `json:"minTLSVersion"`
225178
}
226179

@@ -245,11 +198,16 @@ const (
245198
VersionTLS13 TLSProtocolVersion = "VersionTLS13"
246199
)
247200

248-
// TLSProfiles Contains a map of TLSProfileType names to TLSProfileSpec.
201+
// TLSProfiles contains a map of TLSProfileType names to TLSProfileSpec.
202+
//
203+
// These profiles are based on version 5.0 of the Mozilla Server Side TLS
204+
// configuration guidelines (2019-06-28) with TLS 1.3 cipher suites prepended for
205+
// forward compatibility. See: https://ssl-config.mozilla.org/guidelines/5.0.json
249206
//
250-
// NOTE: The caller needs to make sure to check that these constants are valid for their binary. Not all
251-
// entries map to values for all binaries. In the case of ties, the kube-apiserver wins. Do not fail,
252-
// just be sure to whitelist only and everything will be ok.
207+
// NOTE: The caller needs to make sure to check that these constants are valid
208+
// for their binary. Not all entries map to values for all binaries. In the case
209+
// of ties, the kube-apiserver wins. Do not fail, just be sure to whitelist only
210+
// and everything will be ok.
253211
var TLSProfiles = map[TLSProfileType]*TLSProfileSpec{
254212
TLSProfileOldType: {
255213
Ciphers: []string{

0 commit comments

Comments
 (0)