Skip to content

Commit 99247ba

Browse files
Initial definitions for the 5 authentication policies
1 parent dad8d9c commit 99247ba

File tree

1 file changed

+60
-0
lines changed
  • terraform/snowflake/environments/prd

1 file changed

+60
-0
lines changed

terraform/snowflake/environments/prd/main.tf

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,63 @@ resource "snowflake_password_policy" "user_password_policy" {
133133
resource "snowflake_account_password_policy_attachment" "attachment" {
134134
password_policy = snowflake_password_policy.user_password_policy.fully_qualified_name
135135
}
136+
137+
// Defines an authentication policy for ODI human users that enforces Okta-only authentication via SAML.
138+
resource "snowflake_authentication_policy" "odi_okta_only" {
139+
provider = snowflake.accountadmin
140+
database = snowflake_database.policies.name # Database name
141+
schema = "PUBLIC" # Schema name
142+
name = "odi_okta_only"
143+
authentication_methods = ["SAML"]
144+
security_integrations = ["OKTAINTEGRATION"] # Okta security integration name
145+
comment = "Okta-only authentication policy for ODI human users"
146+
}
147+
148+
// Defines an authentication policy for external human users that enforces password-based authentication with Duo MFA.
149+
resource "snowflake_authentication_policy" "external_duo_mfa" {
150+
provider = snowflake.accountadmin
151+
database = snowflake_database.policies.name # Database name
152+
schema = "PUBLIC" # Schema name
153+
name = "external_duo_mfa"
154+
authentication_methods = ["PASSWORD"]
155+
mfa_authentication_methods = ["PASSWORD"]
156+
mfa_enrollment = "REQUIRED"
157+
client_types = ["SNOWFLAKE_UI", "DRIVERS", "SNOWSQL"] # MFA enrollment requires SNOWFLAKE_UI
158+
comment = "Duo-MFA-only authentication policy for external human users"
159+
}
160+
161+
// Defines an authentication policy for admin human users that allows both Okta SAML and password-based authentication with Duo MFA.
162+
resource "snowflake_authentication_policy" "admin_okta_duo" {
163+
provider = snowflake.accountadmin
164+
database = snowflake_database.policies.name # Database name
165+
schema = "PUBLIC" # Schema name
166+
name = "admin_okta_duo"
167+
authentication_methods = ["SAML", "PASSWORD"]
168+
mfa_authentication_methods = ["PASSWORD"]
169+
mfa_enrollment = "REQUIRED"
170+
client_types = ["SNOWFLAKE_UI", "DRIVERS", "SNOWSQL"]
171+
security_integrations = ["OKTAINTEGRATION"] # Okta security integration name
172+
comment = "Okta and Duo-MFA authentication policy for admin human users"
173+
}
174+
175+
// Defines an authentication policy for most service accounts that enforces key-pair authentication.
176+
resource "snowflake_authentication_policy" "service_account_keypair" {
177+
provider = snowflake.accountadmin
178+
database = snowflake_database.policies.name # Database name
179+
schema = "PUBLIC" # Schema name
180+
name = "service_account_keypair"
181+
authentication_methods = ["KEYPAIR"]
182+
client_types = ["DRIVERS", "SNOWSQL"]
183+
comment = "Key-pair only authentication policy for most service accounts"
184+
}
185+
186+
// Defines an authentication policy for legacy service accounts that enforces password-based authentication.
187+
resource "snowflake_authentication_policy" "legacy_service_password" {
188+
provider = snowflake.accountadmin
189+
database = snowflake_database.policies.name # Database name
190+
schema = "PUBLIC" # Schema name
191+
name = "legacy_service_password"
192+
authentication_methods = ["PASSWORD"]
193+
client_types = ["DRIVERS", "SNOWSQL"]
194+
comment = "Password-only authentication policy for legacy service accounts"
195+
}

0 commit comments

Comments
 (0)