Skip to content

Always set SECURITY_POLICY env var, even for open door policy.#1397

Merged
anmaxvl merged 3 commits intomicrosoft:masterfrom
anmaxvl:security-policy-env
Jun 24, 2022
Merged

Always set SECURITY_POLICY env var, even for open door policy.#1397
anmaxvl merged 3 commits intomicrosoft:masterfrom
anmaxvl:security-policy-env

Conversation

@anmaxvl
Copy link
Copy Markdown
Contributor

@anmaxvl anmaxvl commented May 13, 2022

Previously SECURITY_POLICY env var was set for container init process
only when StandardSecurityPolicyEnforcer was in use, however the
environment variable is useful even with OpenDoor enforcer.

Address this gap by updating enforcers and adding an accessor
method.

The SECURITY_POLICY environment variable will be set only when
the appropriate annotation says so:
"io.microsoft.virtualmachine.lcow.securitypolicy.env"

Signed-off-by: Maksim An [email protected]

@anmaxvl anmaxvl requested a review from a team as a code owner May 13, 2022 02:18
@anmaxvl anmaxvl force-pushed the security-policy-env branch from 2eee901 to 90ba716 Compare May 13, 2022 05:43
Comment thread pkg/securitypolicy/securitypolicyenforcer.go
@anmaxvl anmaxvl force-pushed the security-policy-env branch from 90ba716 to 95ced2b Compare May 26, 2022 06:02
@anmaxvl anmaxvl force-pushed the security-policy-env branch 2 times, most recently from 45f78c2 to d79e3d2 Compare June 15, 2022 22:32
Comment thread internal/guest/runtime/hcsv2/uvm.go Outdated
Copy link
Copy Markdown

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

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

Small nit otherwise LGTM

anmaxvl added 3 commits June 24, 2022 07:40
Previously SECURITY_POLICY env var was set for container init process
only when StandardSecurityPolicyEnforcer was in use, however the
environment variable is useful even with OpenDoor enforcer.

Address this gap by updating enforcers and adding an accessor
method.

Signed-off-by: Maksim An <[email protected]>
@anmaxvl anmaxvl force-pushed the security-policy-env branch from 1a97584 to 77eab4d Compare June 24, 2022 14:40
@SeanTAllen
Copy link
Copy Markdown
Contributor

@anmaxvl can we get this merged?

@anmaxvl anmaxvl merged commit 9d94ed9 into microsoft:master Jun 24, 2022
@anmaxvl anmaxvl deleted the security-policy-env branch June 24, 2022 17:10
kiashok pushed a commit to kiashok/hcsshim that referenced this pull request Jul 11, 2022
…soft#1397)

Previously SECURITY_POLICY env var was set for container init process
only when StandardSecurityPolicyEnforcer was in use, however the
environment variable is useful even with OpenDoor enforcer.

Address this gap by updating enforcers and adding an accessor
method.

Add annotation to set SECURITY_POLICY env for containers.

Export oci.ParseAnnotationsBool

Update tests

Signed-off-by: Maksim An <[email protected]>
anmaxvl added a commit that referenced this pull request Feb 7, 2023
princepereira pushed a commit to princepereira/hcsshim that referenced this pull request Aug 29, 2024
…soft#1397)

Previously SECURITY_POLICY env var was set for container init process
only when StandardSecurityPolicyEnforcer was in use, however the
environment variable is useful even with OpenDoor enforcer.

Address this gap by updating enforcers and adding an accessor
method.

Add annotation to set SECURITY_POLICY env for containers.

Export oci.ParseAnnotationsBool

Update tests

Signed-off-by: Maksim An <[email protected]>
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.

4 participants