Skip to content

Commit 2e24796

Browse files
authored
Merge branch 'cloudflare:master' into master
2 parents 5c7e0d4 + f135761 commit 2e24796

File tree

7 files changed

+54
-6
lines changed

7 files changed

+54
-6
lines changed

.changelog/1214.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
teams_rules: Add `untrusted_cert` rule setting
3+
```

.changelog/1220.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:dependency
2+
deps: bumps github.com/stretchr/testify from 1.8.1 to 1.8.2
3+
```

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ENHANCEMENTS:
55
* dex_test: add CRUD functionality for DEX test configurations ([#1209](https://github.com/cloudflare/cloudflare-go/issues/1209))
66
* dlp: Adds support for partial payload logging ([#1212](https://github.com/cloudflare/cloudflare-go/issues/1212))
77
* teams_accounts: Add new root_certificate_installation_enabled field ([#1208](https://github.com/cloudflare/cloudflare-go/issues/1208))
8+
* teams_rules: Add `untrusted_cert` rule setting ([#1214](https://github.com/cloudflare/cloudflare-go/issues/1214))
89
* tunnels: automatically paginate `ListTunnels` ([#1206](https://github.com/cloudflare/cloudflare-go/issues/1206))
910

1011
BUG FIXES:
@@ -13,6 +14,7 @@ BUG FIXES:
1314

1415
DEPENDENCIES:
1516

17+
* deps: bumps github.com/stretchr/testify from 1.8.1 to 1.8.2 ([#1220](https://github.com/cloudflare/cloudflare-go/issues/1220))
1618
* deps: bumps github.com/urfave/cli/v2 from 2.24.3 to 2.24.4 ([#1210](https://github.com/cloudflare/cloudflare-go/issues/1210))
1719
* deps: bumps golang.org/x/net from 0.0.0-20220722155237-a158d28d115b to 0.7.0 ([#1218](https://github.com/cloudflare/cloudflare-go/issues/1218))
1820
* deps: bumps golang.org/x/net from 0.0.0-20220722155237-a158d28d115b to 0.7.0 ([#1219](https://github.com/cloudflare/cloudflare-go/issues/1219))

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/google/go-querystring v1.1.0
77
github.com/hashicorp/go-retryablehttp v0.7.2
88
github.com/olekukonko/tablewriter v0.0.5
9-
github.com/stretchr/testify v1.8.1
9+
github.com/stretchr/testify v1.8.2
1010
github.com/urfave/cli/v2 v2.24.4
1111
golang.org/x/net v0.7.0
1212
golang.org/x/time v0.3.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE
5858
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
5959
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
6060
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
61-
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
62-
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
61+
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
62+
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
6363
github.com/urfave/cli/v2 v2.24.4 h1:0gyJJEBYtCV87zI/x2nZCPyDxD51K6xM8SkwjHFCNEU=
6464
github.com/urfave/cli/v2 v2.24.4/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
6565
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=

teams_rules.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ type TeamsRuleSettings struct {
4040

4141
// DLP payload logging configuration
4242
PayloadLog *TeamsDlpPayloadLogSettings `json:"payload_log"`
43+
44+
UntrustedCertSettings *UntrustedCertSettings `json:"untrusted_cert"`
45+
}
46+
47+
type TeamsGatewayUntrustedCertAction string
48+
49+
const (
50+
UntrustedCertPassthrough TeamsGatewayUntrustedCertAction = "pass_through"
51+
UntrustedCertBlock TeamsGatewayUntrustedCertAction = "block"
52+
UntrustedCertError TeamsGatewayUntrustedCertAction = "error"
53+
)
54+
55+
type UntrustedCertSettings struct {
56+
Action TeamsGatewayUntrustedCertAction `json:"action"`
4357
}
4458

4559
type EgressSettings struct {
@@ -116,6 +130,14 @@ func TeamsRulesActionValues() []string {
116130
}
117131
}
118132

133+
func TeamsRulesUntrustedCertActionValues() []string {
134+
return []string{
135+
string(UntrustedCertPassthrough),
136+
string(UntrustedCertBlock),
137+
string(UntrustedCertError),
138+
}
139+
}
140+
119141
// TeamsRule represents an Teams wirefilter rule.
120142
type TeamsRule struct {
121143
ID string `json:"id,omitempty"`

teams_rules_test.go

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ func TestTeamsRules(t *testing.T) {
5050
"enforce": true,
5151
"duration": "15m0s"
5252
},
53-
"insecure_disable_dnssec_validation": false
53+
"insecure_disable_dnssec_validation": false,
54+
"untrusted_cert": {
55+
"action": "error"
56+
}
5457
}
5558
},
5659
{
@@ -78,7 +81,10 @@ func TestTeamsRules(t *testing.T) {
7881
"biso_admin_controls": null,
7982
"add_headers": null,
8083
"check_session": null,
81-
"insecure_disable_dnssec_validation": true
84+
"insecure_disable_dnssec_validation": true,
85+
"untrusted_cert": {
86+
"action": "pass_through"
87+
}
8288
}
8389
}
8490
]
@@ -114,6 +120,9 @@ func TestTeamsRules(t *testing.T) {
114120
Duration: Duration{900 * time.Second},
115121
},
116122
InsecureDisableDNSSECValidation: false,
123+
UntrustedCertSettings: &UntrustedCertSettings{
124+
Action: UntrustedCertError,
125+
},
117126
},
118127
CreatedAt: &createdAt,
119128
UpdatedAt: &updatedAt,
@@ -142,6 +151,9 @@ func TestTeamsRules(t *testing.T) {
142151
CheckSession: nil,
143152
// setting is invalid for block rules, just testing serialization here
144153
InsecureDisableDNSSECValidation: true,
154+
UntrustedCertSettings: &UntrustedCertSettings{
155+
Action: UntrustedCertPassthrough,
156+
},
145157
},
146158
CreatedAt: &createdAt,
147159
UpdatedAt: &updatedAt,
@@ -196,7 +208,10 @@ func TestTeamsRule(t *testing.T) {
196208
"enforce": true,
197209
"duration": "15m0s"
198210
},
199-
"insecure_disable_dnssec_validation": false
211+
"insecure_disable_dnssec_validation": false,
212+
"untrusted_cert": {
213+
"action": "block"
214+
}
200215
}
201216
}
202217
}
@@ -231,6 +246,9 @@ func TestTeamsRule(t *testing.T) {
231246
Duration: Duration{900 * time.Second},
232247
},
233248
InsecureDisableDNSSECValidation: false,
249+
UntrustedCertSettings: &UntrustedCertSettings{
250+
Action: UntrustedCertBlock,
251+
},
234252
},
235253
CreatedAt: &createdAt,
236254
UpdatedAt: &updatedAt,

0 commit comments

Comments
 (0)