fuzzer

package
v1.14.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
	return []interface{}{
		func(s *policy.PodDisruptionBudgetStatus, c fuzz.Continue) {
			c.FuzzNoCustom(s)
			s.PodDisruptionsAllowed = int32(c.Rand.Intn(2))
		},
		func(psp *policy.PodSecurityPolicySpec, c fuzz.Continue) {
			c.FuzzNoCustom(psp)

			runAsUserRules := []policy.RunAsUserStrategy{
				policy.RunAsUserStrategyMustRunAsNonRoot,
				policy.RunAsUserStrategyMustRunAs,
				policy.RunAsUserStrategyRunAsAny,
			}
			psp.RunAsUser.Rule = runAsUserRules[c.Rand.Intn(len(runAsUserRules))]

			runAsGroupRules := []policy.RunAsGroupStrategy{
				policy.RunAsGroupStrategyMustRunAs,
				policy.RunAsGroupStrategyRunAsAny,
				policy.RunAsGroupStrategyMayRunAs,
			}
			psp.RunAsGroup = &policy.RunAsGroupStrategyOptions{}
			psp.RunAsGroup.Rule = runAsGroupRules[c.Rand.Intn(len(runAsGroupRules))]
			seLinuxRules := []policy.SELinuxStrategy{
				policy.SELinuxStrategyMustRunAs,
				policy.SELinuxStrategyRunAsAny,
			}
			psp.SELinux.Rule = seLinuxRules[c.Rand.Intn(len(seLinuxRules))]

			supplementalGroupsRules := []policy.SupplementalGroupsStrategyType{
				policy.SupplementalGroupsStrategyRunAsAny,
				policy.SupplementalGroupsStrategyMayRunAs,
				policy.SupplementalGroupsStrategyMustRunAs,
			}
			psp.SupplementalGroups.Rule = supplementalGroupsRules[c.Rand.Intn(len(supplementalGroupsRules))]

			fsGroupRules := []policy.FSGroupStrategyType{
				policy.FSGroupStrategyMustRunAs,
				policy.FSGroupStrategyMayRunAs,
				policy.FSGroupStrategyRunAsAny,
			}
			psp.FSGroup.Rule = fsGroupRules[c.Rand.Intn(len(fsGroupRules))]
		},
	}
}

Funcs returns the fuzzer functions for the policy api group.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL