Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tools/flavor-convert/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
GITTAG := $(shell git describe --tags --abbrev=0 2> /dev/null)
VERSION := $(or ${GITTAG}, v0.0.0)

all:
go build -ldflags "-X main.BuildVersion=$(VERSION)" -o flavor-convert-$(VERSION)
79 changes: 79 additions & 0 deletions tools/flavor-convert/flavortemplates/default-esxi-tpm12.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"id": "f7e3ee4c-944b-4030-9d32-94d22778954d",
"label": "default-esxi-tpm12",
"condition": [
"//host_info/os_name//*[text()='VMware ESXi']",
"//host_info/hardware_features/TPM/meta/tpm_version//*[text()='1.2']"
],
"flavor_parts": {
"PLATFORM": {
"meta": {
"tpm_version": "1.2"
},
"pcr_rules": [
{
"pcr": {
"index": 0,
"bank": "SHA1"
},
"pcr_matches": true
},
{
"pcr": {
"index": 17,
"bank": "SHA1"
},
"pcr_matches": true
}
]
},
"OS": {
"meta": {
"tpm_version": "1.2"
},
"pcr_rules": [
{
"pcr": {
"index": 18,
"bank": "SHA1"
},
"pcr_matches": true
},
{
"pcr": {
"index": 19,
"bank": "SHA1"
},
"eventlog_equals": {
"excluding_tags": [
"commandLine."
]
}
},
{
"pcr": {
"index": 20,
"bank": "SHA1"
},
"pcr_matches": true
}
]
},
"HOST_UNIQUE": {
"meta": {
"tpm_version": "1.2"
},
"pcr_rules": [
{
"pcr": {
"index": 19,
"bank": "SHA1"
},
"eventlog_includes": [
"commandLine."
]
}
]
}
}
}
104 changes: 104 additions & 0 deletions tools/flavor-convert/flavortemplates/default-esxi-tpm20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"label": "default-esxi-tpm20",
"condition": [
"//host_info/os_name//*[text()='VMware ESXi']",
"//host_info/hardware_features/TPM/meta/tpm_version//*[text()='2.0']"
],
"flavor_parts": {
"PLATFORM": {
"meta": {
"tpm_version": "2.0"
},
"pcr_rules": [
{
"pcr": {
"index": 0,
"bank": "SHA256"
},
"pcr_matches": true,
"eventlog_equals": {}
},
{
"pcr": {
"index": 17,
"bank": "SHA256"
},
"pcr_matches": true,
"eventlog_equals": {}
},
{
"pcr": {
"index": 18,
"bank": "SHA256"
},
"pcr_matches": true,
"eventlog_equals": {}
}
]
},
"OS": {
"meta": {
"tpm_version": "2.0"
},
"pcr_rules": [
{
"pcr": {
"index": 19,
"bank": "SHA256"
},
"pcr_matches": true,
"eventlog_equals": {}
},
{
"pcr": {
"index": 20,
"bank": "SHA256"
},
"eventlog_equals": {
"excluding_tags": [
"componentName.imgdb.tgz",
"componentName.onetime.tgz"
]
}
},
{
"pcr": {
"index": 21,
"bank": "SHA256"
},
"eventlog_equals": {
"excluding_tags": [
"commandLine."
]
}
}
]
},
"HOST_UNIQUE": {
"meta": {
"tpm_version": "2.0"
},
"pcr_rules": [
{
"pcr": {
"index": 20,
"bank": "SHA256"
},
"eventlog_includes": [
"componentName.imgdb.tgz",
"componentName.onetime.tgz"
]
},
{
"pcr": {
"index": 21,
"bank": "SHA256"
},
"eventlog_includes": [
"commandLine."
]
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should duplicate the flavor-templates (they will get out of date with the intel-secl repo). Let's just provide the tool/executable and require that the user of the converter to obtain the flavor-templates.

@ddhawal do you agree?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwtj43 Do we need to provide the flavor template in user command line instead of keeping it in the tools/flavor-convert/flavortemplates folder?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwtj43 Agree but as this is just a file, I doubt if we can import it. Variable can be imported.

@isteffyx Could you please check that up?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddhawal I have tried to import flavor template files from intel-secl repo. But I am getting "no such file or directory" error while reading.

"id": "f7e3ee4c-944b-4030-9d32-94d22773573d",
"label": "linux-tpm20-cbnt",
"condition": [
"//host_info/os_name//*[text()='RedHatEnterprise']",
"//host_info/hardware_features/TPM/meta/tpm_version//*[text()='2.0']",
"//host_info/hardware_features/CBNT/enabled//*[text()='true']"
],
"flavor_parts": {
"PLATFORM": {
"meta": {
"tpm_version": "2.0",
"cbnt_enabled": true
},
"pcr_rules": [
{
"pcr": {
"index": 0,
"bank": "SHA256"
},
"pcr_matches": true
},
{
"pcr": {
"index": 7,
"bank": "SHA256"
},
"pcr_matches": true
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"id": "aa30e267-1925-4790-bc90-ef28c6d21516",
"label": "linux-tpm20-suefi",
"condition": [
"//host_info/os_name//*[text()='RedHatEnterprise']",
"//host_info/hardware_features/TPM/meta/tpm_version//*[text()='2.0']",
"//host_info/hardware_features/UEFI/meta/secure_boot_enabled//*[text()='true']"
],
"flavor_parts": {
"PLATFORM": {
"meta": {
"tpm_version": "2.0",
"cbnt_enabled": true
},
"pcr_rules": [
{
"pcr": {
"index": 0,
"bank": "SHA256"
},
"pcr_matches": true
},
{
"pcr": {
"index": 1,
"bank": "SHA256"
},
"pcr_matches": true
},
{
"pcr": {
"index": 2,
"bank": "SHA256"
},
"pcr_matches": true
},
{
"pcr": {
"index": 3,
"bank": "SHA256"
},
"pcr_matches": true
},
{
"pcr": {
"index": 4,
"bank": "SHA256"
},
"pcr_matches": true
},
{
"pcr": {
"index": 5,
"bank": "SHA256"
},
"pcr_matches": true
},
{
"pcr": {
"index": 6,
"bank": "SHA256"
},
"pcr_matches": true
},
{
"pcr": {
"index": 7,
"bank": "SHA256"
},
"pcr_matches": true
}
]
}
}
}
Loading