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.
POC for #10.
The idea would be to generate a random valid manifest in order to fuzz the admission control. Not in a traditional fuzzing sense, like finding crashes and bugs in the implementation of the admission, but finding loopholes in the admission rules.
It uses
google/gofuzz
and custom fuzzing functions to generate a random but somehow validv1.SecurityContext
that can be injected into a pod's manifest.This POC should be extended to support more fields, like stated in the original idea issue:
In order to test this POC, checkout to the
fuzz
branch, compile withmake
and generate random SecurityContext with./kdigger gen -f
. You can generate multiples with something like that for example:You can check against the API server if they are valid with:
./kdigger gen -f | kubectl apply --dry-run=server -f -
And by the way, I need to do an update on the main branch to scan the admission control with
--dry-run
by default.