Skip to content

Commit

Permalink
Merge pull request #1704 from tpdownes/htcondor_secure_boot
Browse files Browse the repository at this point in the history
Add Shielded VM features to HTCondor modules
  • Loading branch information
tpdownes authored Aug 21, 2023
2 parents baa7ab0 + 1864fc2 commit 1878b68
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 0 deletions.
1 change: 1 addition & 0 deletions community/examples/htc-htcondor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ vars:
zone: us-central1-c
disk_size_gb: 100
new_image_family: htcondor-10x
enable_shielded_vm: true

# Documentation for each of the modules used below can be found at
# https://github.com/GoogleCloudPlatform/hpc-toolkit/blob/main/modules/README.md
Expand Down
2 changes: 2 additions & 0 deletions community/modules/compute/htcondor-execute-point/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ limitations under the License.
| <a name="input_disk_size_gb"></a> [disk\_size\_gb](#input\_disk\_size\_gb) | Boot disk size in GB | `number` | `100` | no |
| <a name="input_distribution_policy_target_shape"></a> [distribution\_policy\_target\_shape](#input\_distribution\_policy\_target\_shape) | Target shape across zones for instance group managing execute points | `string` | `"ANY"` | no |
| <a name="input_enable_oslogin"></a> [enable\_oslogin](#input\_enable\_oslogin) | Enable or Disable OS Login with "ENABLE" or "DISABLE". Set to "INHERIT" to inherit project OS Login setting. | `string` | `"ENABLE"` | no |
| <a name="input_enable_shielded_vm"></a> [enable\_shielded\_vm](#input\_enable\_shielded\_vm) | Enable the Shielded VM configuration (var.shielded\_instance\_config). | `bool` | `false` | no |
| <a name="input_execute_point_runner"></a> [execute\_point\_runner](#input\_execute\_point\_runner) | A list of Toolkit runners for configuring an HTCondor execute point | `list(map(string))` | `[]` | no |
| <a name="input_execute_point_service_account_email"></a> [execute\_point\_service\_account\_email](#input\_execute\_point\_service\_account\_email) | Service account for HTCondor execute point (e-mail format) | `string` | n/a | yes |
| <a name="input_guest_accelerator"></a> [guest\_accelerator](#input\_guest\_accelerator) | List of the type and count of accelerator cards attached to the instance. | <pre>list(object({<br> type = string,<br> count = number<br> }))</pre> | `[]` | no |
Expand All @@ -212,6 +213,7 @@ limitations under the License.
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | Project in which the HTCondor execute points will be created | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | The region in which HTCondor execute points will be created | `string` | n/a | yes |
| <a name="input_service_account_scopes"></a> [service\_account\_scopes](#input\_service\_account\_scopes) | Scopes by which to limit service account attached to central manager. | `set(string)` | <pre>[<br> "https://www.googleapis.com/auth/cloud-platform"<br>]</pre> | no |
| <a name="input_shielded_instance_config"></a> [shielded\_instance\_config](#input\_shielded\_instance\_config) | Shielded VM configuration for the instance (must set var.enabled\_shielded\_vm) | <pre>object({<br> enable_secure_boot = bool<br> enable_vtpm = bool<br> enable_integrity_monitoring = bool<br> })</pre> | <pre>{<br> "enable_integrity_monitoring": true,<br> "enable_secure_boot": true,<br> "enable_vtpm": true<br>}</pre> | no |
| <a name="input_spot"></a> [spot](#input\_spot) | Provision VMs using discounted Spot pricing, allowing for preemption | `bool` | `false` | no |
| <a name="input_subnetwork_self_link"></a> [subnetwork\_self\_link](#input\_subnetwork\_self\_link) | The self link of the subnetwork HTCondor execute points will join | `string` | `null` | no |
| <a name="input_target_size"></a> [target\_size](#input\_target\_size) | Initial size of the HTCondor execute point pool; set to null (default) to avoid Terraform management of size. | `number` | `null` | no |
Expand Down
4 changes: 4 additions & 0 deletions community/modules/compute/htcondor-execute-point/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ module "execute_point_instance_template" {
startup_script = local.is_windows_image ? null : module.startup_script.startup_script
metadata = local.metadata
source_image = data.google_compute_image.htcondor.self_link

# secure boot
enable_shielded_vm = var.enable_shielded_vm
shielded_instance_config = var.shielded_instance_config
}

module "mig" {
Expand Down
21 changes: 21 additions & 0 deletions community/modules/compute/htcondor-execute-point/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,24 @@ variable "name_prefix" {
error_message = "var.name_prefix must be a set to a non-empty string and must also be unique across all instances of htcondor-execute-point"
}
}

variable "enable_shielded_vm" {
type = bool
default = false
description = "Enable the Shielded VM configuration (var.shielded_instance_config)."
}

variable "shielded_instance_config" {
description = "Shielded VM configuration for the instance (must set var.enabled_shielded_vm)"
type = object({
enable_secure_boot = bool
enable_vtpm = bool
enable_integrity_monitoring = bool
})

default = {
enable_secure_boot = true
enable_vtpm = true
enable_integrity_monitoring = true
}
}
2 changes: 2 additions & 0 deletions community/modules/scheduler/htcondor-access-point/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ limitations under the License.
| <a name="input_enable_high_availability"></a> [enable\_high\_availability](#input\_enable\_high\_availability) | Provision HTCondor access point in high availability mode | `bool` | `false` | no |
| <a name="input_enable_oslogin"></a> [enable\_oslogin](#input\_enable\_oslogin) | Enable or Disable OS Login with "ENABLE" or "DISABLE". Set to "INHERIT" to inherit project OS Login setting. | `string` | `"ENABLE"` | no |
| <a name="input_enable_public_ips"></a> [enable\_public\_ips](#input\_enable\_public\_ips) | Enable Public IPs on the access points | `bool` | `false` | no |
| <a name="input_enable_shielded_vm"></a> [enable\_shielded\_vm](#input\_enable\_shielded\_vm) | Enable the Shielded VM configuration (var.shielded\_instance\_config). | `bool` | `false` | no |
| <a name="input_htcondor_bucket_name"></a> [htcondor\_bucket\_name](#input\_htcondor\_bucket\_name) | Name of HTCondor configuration bucket | `string` | n/a | yes |
| <a name="input_instance_image"></a> [instance\_image](#input\_instance\_image) | Custom VM image with HTCondor and Toolkit support installed. | <pre>object({<br> family = string,<br> project = string<br> })</pre> | n/a | yes |
| <a name="input_labels"></a> [labels](#input\_labels) | Labels to add to resources. List key, value pairs. | `map(string)` | n/a | yes |
Expand All @@ -102,6 +103,7 @@ limitations under the License.
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | Project in which HTCondor pool will be created | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | Default region for creating resources | `string` | n/a | yes |
| <a name="input_service_account_scopes"></a> [service\_account\_scopes](#input\_service\_account\_scopes) | Scopes by which to limit service account attached to central manager. | `set(string)` | <pre>[<br> "https://www.googleapis.com/auth/cloud-platform"<br>]</pre> | no |
| <a name="input_shielded_instance_config"></a> [shielded\_instance\_config](#input\_shielded\_instance\_config) | Shielded VM configuration for the instance (must set var.enabled\_shielded\_vm) | <pre>object({<br> enable_secure_boot = bool<br> enable_vtpm = bool<br> enable_integrity_monitoring = bool<br> })</pre> | <pre>{<br> "enable_integrity_monitoring": true,<br> "enable_secure_boot": true,<br> "enable_vtpm": true<br>}</pre> | no |
| <a name="input_spool_parent_dir"></a> [spool\_parent\_dir](#input\_spool\_parent\_dir) | HTCondor access point configuration SPOOL will be set to subdirectory named "spool" | `string` | `"/var/lib/condor"` | no |
| <a name="input_subnetwork_self_link"></a> [subnetwork\_self\_link](#input\_subnetwork\_self\_link) | The self link of the subnetwork in which the HTCondor central manager will be created. | `string` | `null` | no |
| <a name="input_zones"></a> [zones](#input\_zones) | Zone(s) in which access point may be created. If not supplied, will default to all zones in var.region. | `list(string)` | `[]` | no |
Expand Down
4 changes: 4 additions & 0 deletions community/modules/scheduler/htcondor-access-point/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ module "access_point_instance_template" {
startup_script = module.startup_script.startup_script
metadata = local.metadata
source_image = data.google_compute_image.htcondor.self_link

# secure boot
enable_shielded_vm = var.enable_shielded_vm
shielded_instance_config = var.shielded_instance_config
}

module "htcondor_ap" {
Expand Down
21 changes: 21 additions & 0 deletions community/modules/scheduler/htcondor-access-point/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,24 @@ variable "default_mig_id" {
default = ""
nullable = false
}

variable "enable_shielded_vm" {
type = bool
default = false
description = "Enable the Shielded VM configuration (var.shielded_instance_config)."
}

variable "shielded_instance_config" {
description = "Shielded VM configuration for the instance (must set var.enabled_shielded_vm)"
type = object({
enable_secure_boot = bool
enable_vtpm = bool
enable_integrity_monitoring = bool
})

default = {
enable_secure_boot = true
enable_vtpm = true
enable_integrity_monitoring = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ limitations under the License.
| <a name="input_disk_size_gb"></a> [disk\_size\_gb](#input\_disk\_size\_gb) | Boot disk size in GB | `number` | `20` | no |
| <a name="input_distribution_policy_target_shape"></a> [distribution\_policy\_target\_shape](#input\_distribution\_policy\_target\_shape) | Target shape for instance group managing high availability of central manager | `string` | `"BALANCED"` | no |
| <a name="input_enable_oslogin"></a> [enable\_oslogin](#input\_enable\_oslogin) | Enable or Disable OS Login with "ENABLE" or "DISABLE". Set to "INHERIT" to inherit project OS Login setting. | `string` | `"ENABLE"` | no |
| <a name="input_enable_shielded_vm"></a> [enable\_shielded\_vm](#input\_enable\_shielded\_vm) | Enable the Shielded VM configuration (var.shielded\_instance\_config). | `bool` | `false` | no |
| <a name="input_htcondor_bucket_name"></a> [htcondor\_bucket\_name](#input\_htcondor\_bucket\_name) | Name of HTCondor configuration bucket | `string` | n/a | yes |
| <a name="input_instance_image"></a> [instance\_image](#input\_instance\_image) | Custom VM image with HTCondor installed using the htcondor-install module. | <pre>object({<br> family = string,<br> project = string<br> })</pre> | n/a | yes |
| <a name="input_labels"></a> [labels](#input\_labels) | Labels to add to resources. List key, value pairs. | `map(string)` | n/a | yes |
Expand All @@ -132,6 +133,7 @@ limitations under the License.
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | Project in which HTCondor central manager will be created | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | Default region for creating resources | `string` | n/a | yes |
| <a name="input_service_account_scopes"></a> [service\_account\_scopes](#input\_service\_account\_scopes) | Scopes by which to limit service account attached to central manager. | `set(string)` | <pre>[<br> "https://www.googleapis.com/auth/cloud-platform"<br>]</pre> | no |
| <a name="input_shielded_instance_config"></a> [shielded\_instance\_config](#input\_shielded\_instance\_config) | Shielded VM configuration for the instance (must set var.enabled\_shielded\_vm) | <pre>object({<br> enable_secure_boot = bool<br> enable_vtpm = bool<br> enable_integrity_monitoring = bool<br> })</pre> | <pre>{<br> "enable_integrity_monitoring": true,<br> "enable_secure_boot": true,<br> "enable_vtpm": true<br>}</pre> | no |
| <a name="input_subnetwork_self_link"></a> [subnetwork\_self\_link](#input\_subnetwork\_self\_link) | The self link of the subnetwork in which the HTCondor central manager will be created. | `string` | `null` | no |
| <a name="input_zones"></a> [zones](#input\_zones) | Zone(s) in which central manager may be created. If not supplied, will default to all zones in var.region. | `list(string)` | `[]` | no |

Expand Down
4 changes: 4 additions & 0 deletions community/modules/scheduler/htcondor-central-manager/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ module "central_manager_instance_template" {
startup_script = module.startup_script.startup_script
metadata = local.metadata
source_image = data.google_compute_image.htcondor.self_link

# secure boot
enable_shielded_vm = var.enable_shielded_vm
shielded_instance_config = var.shielded_instance_config
}

module "htcondor_cm" {
Expand Down
21 changes: 21 additions & 0 deletions community/modules/scheduler/htcondor-central-manager/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,24 @@ variable "htcondor_bucket_name" {
description = "Name of HTCondor configuration bucket"
type = string
}

variable "enable_shielded_vm" {
type = bool
default = false
description = "Enable the Shielded VM configuration (var.shielded_instance_config)."
}

variable "shielded_instance_config" {
description = "Shielded VM configuration for the instance (must set var.enabled_shielded_vm)"
type = object({
enable_secure_boot = bool
enable_vtpm = bool
enable_integrity_monitoring = bool
})

default = {
enable_secure_boot = true
enable_vtpm = true
enable_integrity_monitoring = true
}
}

0 comments on commit 1878b68

Please sign in to comment.