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

Do not traverse hidden policy directories #254

Merged
merged 1 commit into from
May 14, 2024
Merged

Conversation

jnschaeffer
Copy link
Contributor

@jnschaeffer jnschaeffer commented May 10, 2024

Traversing the policy directory recursively in Kubernetes results in duplicate policies being read, as Kubernetes ConfigMaps store all files as symlinks to a ..data directory inside the actual volume.

To mitigate this issue, this PR prevents hidden directories below the top level directory from being visited.

@jnschaeffer jnschaeffer requested review from a team as code owners May 10, 2024 19:43
internal/iapl/policy.go Outdated Show resolved Hide resolved
Traversing the policy directory recursively in Kubernetes results in
duplicate policies being read, as Kubernetes ConfigMaps store all
files as symlinks to a `..data` data inside the actual volume.

To mitigate this issue, this commit prevents directories that begin
with `.` from being visited.

Signed-off-by: John Schaeffer <[email protected]>
@jnschaeffer jnschaeffer changed the title Do not recursively traverse policy directory Do not traverse hidden policy directories May 14, 2024
@jnschaeffer jnschaeffer merged commit 17e68d5 into main May 14, 2024
5 checks passed
@jnschaeffer jnschaeffer deleted the no-directory-recursion branch May 14, 2024 19:01
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.

2 participants