8000 Add overridden_args and overridden_env_vars by jkl73 · Pull Request #208 · google/go-tpm-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add overridden_args and overridden_env_vars #208

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

Merged
merged 1 commit into from
Jun 15, 2022
Merged
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
14 changes: 14 additions & 0 deletions launcher/container_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,20 @@ func (r *ContainerRunner) measureContainerClaims(ctx context.Context) error {
return err
}
}

// Measure the input overridden Env Vars and Args separately, these should be subsets of the Env Vars and Args above.
envs := parseEnvVars(r.launchSpec.Envs)
for _, env := range envs {
if err := r.attestAgent.MeasureEvent(cel.CosTlv{EventType: cel.OverrideEnvType, EventContent: []byte(env)}); err != nil {
return err
}
}
for _, arg := range r.launchSpec.Cmd {
if err := r.attestAgent.MeasureEvent(cel.CosTlv{EventType: cel.OverrideArgType, EventContent: []byte(arg)}); err != nil {
return err
}
}

return nil
}

Expand Down
4 changes: 4 additions & 0 deletions proto/attest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ message ContainerState {
string image_id = 4;
repeated string args = 5;
map<string, string> env_vars = 6;
// Record operator input Env Vars and Args, should be subsets of the above
// Env Vars and Args.
repeated string overridden_args = 7;
map<string, string> overridden_env_vars = 8;
}

message SemanticVersion {
Expand Down
Loading
0