-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warn in case TPM device is detected on a VM. Signed-off-by: Liran Rotenberg <[email protected]>
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
validation/policies/io/konveyor/forklift/vmware/tpm_enabled.rego
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.konveyor.forklift.vmware | ||
|
||
default has_tpm_enabled = false | ||
|
||
has_tpm_enabled = true { | ||
input.tpmEnabled == true | ||
} | ||
|
||
concerns[flag] { | ||
has_tpm_enabled | ||
flag := { | ||
"category": "Warning", | ||
"label": "VM configured with a TPM device", | ||
"assessment": "The VM is configured with a TPM device. TPM data is not transferred during the migration." | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
validation/policies/io/konveyor/forklift/vmware/tpm_enabled_test.rego
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.konveyor.forklift.vmware | ||
|
||
test_with_tpm_disabled { | ||
mock_vm := { | ||
"name": "test", | ||
"tpmEnabled": false, | ||
} | ||
results := concerns with input as mock_vm | ||
count(results) == 0 | ||
} | ||
|
||
test_with_cpu_hot_add_enabled { | ||
mock_vm := { | ||
"name": "test", | ||
"tpmEnabled": true | ||
} | ||
results := concerns with input as mock_vm | ||
count(results) == 1 | ||
} |