-
Notifications
You must be signed in to change notification settings - Fork 3
Added the flavor conversion code #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pkumarex
wants to merge
11
commits into
v3.3.1/develop
Choose a base branch
from
flavorconvert
base: v3.3.1/develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ca7c238
Added the flavor conversion code
kvijay1918 7f70011
Addressed the comments provided
kvijay1918 e1a62de
Addressed the review comments
kvijay1918 6485429
Addressed flavor template comments
kvijay1918 d2073cb
Addressed the review comments
kvijay1918 b989674
Addressed review comments
isteffyx f685c0e
Updated flavor template path
isteffyx 5e04bed
Addressed the review comment
isteffyx d14ff4f
Added esxi templates
isteffyx 0ac87ce
Updated version in go.mod
isteffyx 2ce22dd
Modified go.mod file
isteffyx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,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
79
tools/flavor-convert/flavortemplates/default-esxi-tpm12.json
This file contains hidden or 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,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
104
tools/flavor-convert/flavortemplates/default-esxi-tpm20.json
This file contains hidden or 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,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." | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
33 changes: 33 additions & 0 deletions
33
tools/flavor-convert/flavortemplates/linux_tpm20_cbnt.template.json
This file contains hidden or 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,33 @@ | ||
| { | ||
| "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 | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
75 changes: 75 additions & 0 deletions
75
tools/flavor-convert/flavortemplates/linux_tpm20_suefi.template.json
This file contains hidden or 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,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 | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.