-
Notifications
You must be signed in to change notification settings - Fork 259
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
Working directory enforcement #1305
Merged
anmaxvl
merged 7 commits into
microsoft:master
from
anmaxvl:working-directory-enforcement
Mar 7, 2022
Merged
Working directory enforcement #1305
anmaxvl
merged 7 commits into
microsoft:master
from
anmaxvl:working-directory-enforcement
Mar 7, 2022
Conversation
This file contains 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
msscotb
reviewed
Feb 28, 2022
anmaxvl
force-pushed
the
working-directory-enforcement
branch
from
February 28, 2022 22:12
fb7695b
to
5608c26
Compare
@microsoft/containerplat anyone else can take a look? Thanks. |
dcantah
reviewed
Mar 2, 2022
dcantah
reviewed
Mar 2, 2022
dcantah
reviewed
Mar 2, 2022
dcantah
approved these changes
Mar 2, 2022
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.
lgtm, couple things
The working directory can be set as part of container image by WORKINGDIR Dockerfile directive or could be explicitly set inside CRI container config. Changing the CWD of container can change the expected behavior of a container. If the working_dir config is not present or empty inside the policy config, this information will be gathered from container image spec. Add logic to enforce CWD enforcement inside GCS and extend policy dev tool and policy structure to support this scenario. The enforcement is an exact string match between what's in the policy and what's in the generated container spec. If the paths don't match, the container will fail to start. Signed-off-by: Maksim An <maksiman@microsoft.com>
Add a utility funcion that picks a random container from an array and generates a valid/invalid overlay for that container. Refactor tests to use the new utility function. Signed-off-by: Maksim An <maksiman@microsoft.com>
Signed-off-by: Maksim An <maksiman@microsoft.com>
Signed-off-by: Maksim An <maksiman@microsoft.com>
Signed-off-by: Maksim An <maksiman@microsoft.com>
Signed-off-by: Maksim An <maksiman@microsoft.com>
Signed-off-by: Maksim An <maksiman@microsoft.com>
anmaxvl
force-pushed
the
working-directory-enforcement
branch
from
March 4, 2022 20:05
e4ca154
to
d9dfbee
Compare
msscotb
approved these changes
Mar 6, 2022
lgtm |
princepereira
pushed a commit
to princepereira/hcsshim
that referenced
this pull request
Aug 29, 2024
* Add current working directory enforcement. The working directory can be set as part of container image by WORKINGDIR Dockerfile directive or could be explicitly set inside CRI container config. Changing the CWD of container can change the expected behavior of a container. If the working_dir config is not present or empty inside the policy config, this information will be gathered from container image spec. Add logic to enforce CWD enforcement inside GCS and extend policy dev tool and policy structure to support this scenario. The enforcement is an exact string match between what's in the policy and what's in the generated container spec. If the paths don't match, the container will fail to start. * Minor refactor of securitypolicy_test Add a utility funcion that picks a random container from an array and generates a valid/invalid overlay for that container. Refactor tests to use the new utility function. * Add unit tests for enforcing working directory Signed-off-by: Maksim An <maksiman@microsoft.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The working directory can be set as part of container image
by WORKINGDIR Dockerfile directive or could be explicitly
set inside CRI container config. Changing the CWD of container
can change the expected behavior of a container.
If the working_dir config is not present or empty inside the
policy config, this information will be gathered from container
image spec.
Add logic to enforce CWD enforcement inside GCS and extend
policy dev tool and policy structure to support this scenario.
The enforcement is an exact string match between what's in the
policy and what's in the generated container spec. If the paths
don't match, the container will fail to start.
Add a utility funcion that picks a random container from an array
and generates a valid/invalid overlay for that container. Refactor
tests to use the new utility function