File tree Expand file tree Collapse file tree 5 files changed +21
-11
lines changed
aws_rdp_domain_controller Expand file tree Collapse file tree 5 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,9 @@ scenario "e2e_aws_rdp_base" {
14
14
]
15
15
16
16
matrix {
17
- builder = [" local" , " crt" ]
18
- client = [" win10" , " win11" ]
17
+ builder = [" local" , " crt" ]
18
+ client = [" win10" , " win11" ]
19
+ kerberos_only = [" true" , " false" ]
19
20
# Windows Server 2016 does not support OpenSSH, but it's relied on for some
20
21
# parts of setup. If 2016 is selected, the member server will be created as
21
22
# 2016, but the domain controller and worker will be 2019.
@@ -266,6 +267,7 @@ scenario "e2e_aws_rdp_base" {
266
267
variables {
267
268
vpc_id = step. create_base_infra . vpc_id
268
269
server_version = matrix. rdp_server
270
+ kerberos_only = matrix. kerberos_only == " true" ? true : false
269
271
active_directory_domain = step. create_rdp_domain_controller . domain_name
270
272
domain_controller_aws_keypair_name = step. create_rdp_domain_controller . keypair_name
271
273
domain_controller_ip = step. create_rdp_domain_controller . private_ip
Original file line number Diff line number Diff line change @@ -36,7 +36,9 @@ data "aws_subnets" "infra" {
36
36
}
37
37
38
38
locals {
39
- username = split (" :" , data. aws_caller_identity . current . user_id )[1 ]
39
+ username = split (" :" , data. aws_caller_identity . current . user_id )[1 ]
40
+ domain_parts = split (" ." , var. active_directory_domain )
41
+ domain_sld = local. domain_parts [0 ] # second-level domain (example.com --> example)
40
42
}
41
43
42
44
// We need a keypair to obtain the local administrator credentials to an AWS Windows based EC2 instance. So we generate it locally here
@@ -273,7 +275,7 @@ resource "aws_instance" "domain_controller" {
273
275
Add-WindowsFeature -name ad-domain-services -IncludeManagementTools
274
276
275
277
# causes the instance to reboot
276
- Install-ADDSForest -CreateDnsDelegation:$false -DomainMode 7 -DomainName ${ var . active_directory_domain } -DomainNetbiosName ${ var . active_directory_netbios_name } -ForestMode 7 -InstallDns:$true -NoRebootOnCompletion:$false -SafeModeAdministratorPassword $password -Force:$true
278
+ Install-ADDSForest -CreateDnsDelegation:$false -DomainMode 7 -DomainName ${ var . active_directory_domain } -DomainNetbiosName ${ local . domain_sld } -ForestMode 7 -InstallDns:$true -NoRebootOnCompletion:$false -SafeModeAdministratorPassword $password -Force:$true
277
279
</powershell>
278
280
EOF
279
281
Original file line number Diff line number Diff line change @@ -46,10 +46,4 @@ variable "active_directory_domain" {
46
46
type = string
47
47
description = " The name of the Active Directory domain to be created on the Windows Domain Controller."
48
48
default = " mydomain.com"
49
- }
50
-
51
- variable "active_directory_netbios_name" {
52
- type = string
53
- description = " Ostensibly the short-hand for the name of the domain."
54
- default = " mydomain"
55
- }
49
+ }
Original file line number Diff line number Diff line change @@ -192,6 +192,12 @@ ${var.domain_admin_password}
192
192
(Get-WmiObject Win32_ComputerSystem).Domain
193
193
Get-Process -Name *ssh* -ErrorAction SilentlyContinue
194
194
195
+ # Enable Kerberos only authentication if required
196
+ %{ if var . kerberos_only ~}
197
+ Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0" -Name RestrictSendingNTLMTraffic -Value 2
198
+ Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0" -Name RestrictReceivingNTLMTraffic -Value 2
199
+ %{ endif ~}
200
+
195
201
# Enable audio
196
202
Set-Service -Name "Audiosrv" -StartupType Automatic
197
203
Start-Service -Name "Audiosrv"
Original file line number Diff line number Diff line change @@ -71,3 +71,9 @@ variable "domain_controller_sec_group_id_list" {
71
71
type = list (any )
72
72
description = " ID's of AWS Network Security Groups created during creation of the domain controller."
73
73
}
74
+
75
+ variable "kerberos_only" {
76
+ type = bool
77
+ description = " Only allow kerberos auth"
78
+ default = false
79
+ }
You can’t perform that action at this time.
0 commit comments