Skip to content

Commit

Permalink
Teams rule setting disable dnssec validation option
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannes Timm committed Feb 16, 2022
1 parent 1510248 commit 8ccd0fa
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 22 deletions.
3 changes: 3 additions & 0 deletions teams_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ type TeamsRuleSettings struct {

// settings for session check in allow action
CheckSession *TeamsCheckSessionSettings `json:"check_session"`

// whether to disable dnssec validation for allow action
InsecureDisableDNSSECValidation bool `json:"insecure_disable_dnssec_validation"`
}

// TeamsL4OverrideSettings used in l4 filter type rule with action set to override.
Expand Down
57 changes: 35 additions & 22 deletions teams_rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ func TestTeamsRules(t *testing.T) {
"check_session": {
"enforce": true,
"duration": "15m0s"
}
},
"insecure_disable_dnssec_validation": false
}
},
{
Expand All @@ -76,7 +77,8 @@ func TestTeamsRules(t *testing.T) {
"l4override": null,
"biso_admin_controls": null,
"add_headers": null,
"check_session": null
"check_session": null,
"insecure_disable_dnssec_validation": true
}
}
]
Expand Down Expand Up @@ -111,6 +113,7 @@ func TestTeamsRules(t *testing.T) {
Enforce: true,
Duration: Duration{900 * time.Second},
},
InsecureDisableDNSSECValidation: false,
},
CreatedAt: &createdAt,
UpdatedAt: &updatedAt,
Expand All @@ -137,6 +140,8 @@ func TestTeamsRules(t *testing.T) {
AddHeaders: nil,
BISOAdminControls: nil,
CheckSession: nil,
// setting is invalid for block rules, just testing serialization here
InsecureDisableDNSSECValidation: true,
},
CreatedAt: &createdAt,
UpdatedAt: &updatedAt,
Expand Down Expand Up @@ -190,7 +195,8 @@ func TestTeamsRule(t *testing.T) {
"check_session": {
"enforce": true,
"duration": "15m0s"
}
},
"insecure_disable_dnssec_validation": false
}
}
}
Expand Down Expand Up @@ -224,6 +230,7 @@ func TestTeamsRule(t *testing.T) {
Enforce: true,
Duration: Duration{900 * time.Second},
},
InsecureDisableDNSSECValidation: false,
},
CreatedAt: &createdAt,
UpdatedAt: &updatedAt,
Expand Down Expand Up @@ -274,7 +281,8 @@ func TestTeamsCreateRule(t *testing.T) {
"check_session": {
"enforce": true,
"duration": "5m0s"
}
},
"insecure_disable_dnssec_validation": false
}
}
}
Expand Down Expand Up @@ -303,6 +311,7 @@ func TestTeamsCreateRule(t *testing.T) {
Enforce: true,
Duration: Duration{300 * time.Second},
},
InsecureDisableDNSSECValidation: false,
},
DeletedAt: nil,
}
Expand Down Expand Up @@ -349,7 +358,8 @@ func TestTeamsUpdateRule(t *testing.T) {
"l4override": null,
"biso_admin_controls": null,
"add_headers": null,
"check_session": null
"check_session": null,
"insecure_disable_dnssec_validation": false
}
}
}
Expand All @@ -371,14 +381,15 @@ func TestTeamsUpdateRule(t *testing.T) {
Identity: "",
DevicePosture: "",
RuleSettings: TeamsRuleSettings{
BlockPageEnabled: false,
BlockReason: "",
OverrideIPs: nil,
OverrideHost: "",
L4Override: nil,
AddHeaders: nil,
BISOAdminControls: nil,
CheckSession: nil,
BlockPageEnabled: false,
BlockReason: "",
OverrideIPs: nil,
OverrideHost: "",
L4Override: nil,
AddHeaders: nil,
BISOAdminControls: nil,
CheckSession: nil,
InsecureDisableDNSSECValidation: false,
},
CreatedAt: &createdAt,
UpdatedAt: &updatedAt,
Expand Down Expand Up @@ -419,7 +430,8 @@ func TestTeamsPatchRule(t *testing.T) {
"l4override": null,
"biso_admin_controls": null,
"add_headers": null,
"check_session": null
"check_session": null,
"insecure_disable_dnssec_validation": false
}
}
}
Expand All @@ -433,14 +445,15 @@ func TestTeamsPatchRule(t *testing.T) {
Enabled: true,
Action: Block,
RuleSettings: TeamsRuleSettings{
BlockPageEnabled: false,
BlockReason: "",
OverrideIPs: nil,
OverrideHost: "",
L4Override: nil,
AddHeaders: nil,
BISOAdminControls: nil,
CheckSession: nil,
BlockPageEnabled: false,
BlockReason: "",
OverrideIPs: nil,
OverrideHost: "",
L4Override: nil,
AddHeaders: nil,
BISOAdminControls: nil,
CheckSession: nil,
InsecureDisableDNSSECValidation: false,
},
}

Expand Down

0 comments on commit 8ccd0fa

Please sign in to comment.