Skip to content
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

kustomize: introduce secure FS implementation #262

Merged
merged 1 commit into from
Apr 15, 2022
Merged

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Apr 15, 2022

This implementation functions as a drop-in replacement for Kustomize's
own fsOnDisk, and asserts any path it handles to be inside root.

In essence, the whole file system is now restricted like
loader.RestrictionRootOnly would, but while allowing root to differ
from the top Kustomization directory.

The main reason to put the constraint in the file system implementation
is because the current Krusty API does not allow to configure a custom
load restrictor, but does allow injecting a custom FS.

@hiddeco hiddeco added enhancement New feature or request area/kustomize Kustomize related issues and pull requests labels Apr 15, 2022
@hiddeco hiddeco force-pushed the kustomize-filesys branch 2 times, most recently from e858f37 to 42fea1b Compare April 15, 2022 12:53
This implementation functions as a drop-in replacement for Kustomize's
own `fsOnDisk`, and asserts any path it handles to be inside root.

In essence, the whole file system is now restricted like
loader.RestrictionRootOnly would, but while allowing root to differ
from the top Kustomization directory.

The main reason to put the constraint in the file system implementation
is because the current Krusty API does not allow to configure a custom
load restrictor, but does allow injecting a custom FS.

Signed-off-by: Hidde Beydals <hello@hidde.co>
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @hiddeco 🥇

Copy link
Contributor

@darkowlzz darkowlzz left a comment

Choose a reason for hiding this comment

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

LGTM!

@hiddeco hiddeco merged commit c380964 into main Apr 15, 2022
@hiddeco hiddeco deleted the kustomize-filesys branch April 15, 2022 13:19
hiddeco added a commit to fluxcd/kustomize-controller that referenced this pull request Apr 15, 2022
For details, see: fluxcd/pkg#262

Signed-off-by: Hidde Beydals <hello@hidde.co>
hiddeco added a commit to fluxcd/kustomize-controller that referenced this pull request Apr 15, 2022
For details, see: fluxcd/pkg#262

Signed-off-by: Hidde Beydals <hello@hidde.co>
hiddeco added a commit to fluxcd/kustomize-controller that referenced this pull request Apr 15, 2022
For details, see: fluxcd/pkg#262

Signed-off-by: Hidde Beydals <hello@hidde.co>
hiddeco added a commit to fluxcd/kustomize-controller that referenced this pull request Apr 15, 2022
For details, see: fluxcd/pkg#262

Signed-off-by: Hidde Beydals <hello@hidde.co>
@pjbgf pjbgf added this to the GA milestone May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kustomize Kustomize related issues and pull requests enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants