Skip to content

NOISSUE - Add path to expected PCR values#398

Merged
dborovcanin merged 6 commits into
ultravioletrs:mainfrom
danko-miladinovic:path
Mar 17, 2025
Merged

NOISSUE - Add path to expected PCR values#398
dborovcanin merged 6 commits into
ultravioletrs:mainfrom
danko-miladinovic:path

Conversation

@danko-miladinovic

Copy link
Copy Markdown
Contributor

What type of PR is this?

This is a feature, because this PR introduces an env variable to the Manager that points to the PCR expected values JSON file.

What does this do?

This PR introduces an env variable to the Manager that points to the PCR expected values JSON file.

Which issue(s) does this PR fix/relate to?

No issue.

Have you included tests for your changes?

Tests have been updated.

Did you document any new/modified feature?

Yes.

Notes

@@ -25,7 +25,12 @@ import (
const defGuestFeatures = 0x1

func (ms *managerService) FetchAttestationPolicy(_ context.Context, computationId string) ([]byte, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we write the output of the attestation policy bin to std out rather than json. that way manager can read and parse the command output and not worry about location of the output json fille

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, I will change this.

@codecov

codecov Bot commented Mar 12, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 63.04348% with 34 lines in your changes missing coverage. Please review.

Project coverage is 56.71%. Comparing base (33744a1) to head (5e7614a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
manager/attestation_policy.go 36.11% 22 Missing and 1 partial ⚠️
cli/attestation_policy.go 55.55% 2 Missing and 2 partials ⚠️
cli/attestation.go 80.00% 2 Missing and 1 partial ⚠️
manager/service.go 88.88% 1 Missing and 1 partial ⚠️
cli/sdk.go 0.00% 1 Missing ⚠️
pkg/attestation/cmdconfig/cmdconfig.go 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #398      +/-   ##
==========================================
+ Coverage   56.67%   56.71%   +0.04%     
==========================================
  Files          59       59              
  Lines        5078     5099      +21     
==========================================
+ Hits         2878     2892      +14     
- Misses       1900     1906       +6     
- Partials      300      301       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread cli/attestation.go Outdated
return fmt.Errorf("error: %s", outputString)
}

fmt.Println(outputString)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use cmd.Print

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment thread manager/README.md Outdated
@@ -12,6 +12,7 @@ The service is configured using the environment variables from the following tab
| COCOS_JAEGER_TRACE_RATIO | The ratio of traces to sample. | 1.0 |
| MANAGER_INSTANCE_ID | The instance ID for the manager service. | |
| MANAGER_ATTESTATION_POLICY_BINARY | The file path for the attestation policy and igvmmeassure binaries. | ../../build |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we can have an env var for each

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment thread manager/attestation_policy.go Outdated
stdout := bufio.NewWriter(&stdoutBuffer)
stderr := bufio.NewWriter(&stderrBuffer)

attestPolicyCmd, err := cmdconfig.NewCmdConfig("sudo", options, stderr, stdout)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

run returns output of stdout so no need to pass the buffer in the newmethod

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment thread manager/attestation_policy.go
Comment thread manager/attestation_policy.go
Comment thread cmd/manager/main.go Outdated
Comment on lines +45 to +46
AttestationPolicyBinary string `env:"MANAGER_ATTESTATION_POLICY_BINARY" envDefault:"../../build"`
IgvmMeasureBinary string `env:"MANAGER_IGVMMEASURE_BINARY" envDefault:"../../build"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
AttestationPolicyBinary string `env:"MANAGER_ATTESTATION_POLICY_BINARY" envDefault:"../../build"`
IgvmMeasureBinary string `env:"MANAGER_IGVMMEASURE_BINARY" envDefault:"../../build"`
AttestationPolicyBinary string `env:"MANAGER_ATTESTATION_POLICY_BINARY" envDefault:"../../build/attestation_policy"`
IgvmMeasureBinary string `env:"MANAGER_IGVMMEASURE_BINARY" envDefault:"../../build/igvmmeasure"`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@dborovcanin dborovcanin merged commit 293c65a into ultravioletrs:main Mar 17, 2025
@danko-miladinovic danko-miladinovic deleted the path branch August 8, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants