Documentation ¶
Index ¶
- func AddFieldToValueFieldSetMap(m map[ssa.Value]*FieldSet, v ssa.Value, f *Field) bool
- func CalleeSet(callGraph *callgraph.Graph, callSite ssa.CallInstruction) (calleeSet []*ssa.Function)
- func FindSeedType(prog *ssa.Program, seedStr *string, pkgPath *string) *ssa.Type
- func FindSeedValues(prog *ssa.Program, seedType *string, pkgPath *string) []ssa.Value
- func GetAllTypes(prog *ssa.Program) []*ssa.Type
- func GetCalleeParamIndex(value ssa.Value, callee *ssa.Function) int
- func GetCallsiteArgIndices(value ssa.Value, call *ssa.CallCommon) []int
- func GetFieldNameFromJsonTag(tag string) string
- func GetReturnIndices(taintSource ssa.Value, returnInst *ssa.Return) []int
- func IsK8sUpdateCall(call *ssa.CallCommon) bool
- func IsPointerType(value ssa.Value) bool
- func MergeMaps(m1 map[ssa.Value]*FieldSet, m2 map[ssa.Value]*FieldSet)
- func TaintInvokeCallSiteArgFromCallee(callSite ssa.CallInstruction, calleeParamIndex int, ...) bool
- type Field
- type FieldSet
- func (fs *FieldSet) Add(f *Field) bool
- func (fs *FieldSet) Contain(f Field) bool
- func (fs *FieldSet) Delete(f *Field)
- func (fs *FieldSet) Extend(otherFs *FieldSet)
- func (fs *FieldSet) Fields() []Field
- func (fs *FieldSet) IsMetadata() bool
- func (fs *FieldSet) IsStatus() bool
- func (fs *FieldSet) IsTypeMeta() bool
- func (fs *FieldSet) String() string
- type IndexField
- type Set
- func (s *Set[T]) Add(items ...T)
- func (s *Set[T]) Contains(item T) bool
- func (s *Set[T]) Copy() *Set[T]
- func (s *Set[T]) Difference(others ...*Set[T]) *Set[T]
- func (s *Set[T]) Discard(items ...T)
- func (s *Set[T]) Equal(other *Set[T]) bool
- func (s *Set[T]) Intersection(others ...*Set[T]) *Set[T]
- func (s *Set[T]) IsDisjoint(other *Set[T]) bool
- func (s *Set[T]) IsEmpty() bool
- func (s *Set[T]) IsSubset(other *Set[T]) bool
- func (s *Set[T]) IsSuperset(other *Set[T]) bool
- func (s *Set[T]) Items() []T
- func (s *Set[T]) Len() int
- func (s *Set[T]) Pop() (T, error)
- func (s *Set[T]) Remove(item T) error
- func (s *Set[T]) String() string
- func (s *Set[T]) SymmetricDifference(other *Set[T]) *Set[T]
- func (s *Set[T]) Union(others ...*Set[T]) *Set[T]
- func (s *Set[T]) Update(others ...*Set[T])
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalleeSet ¶
func CalleeSet(callGraph *callgraph.Graph, callSite ssa.CallInstruction) (calleeSet []*ssa.Function)
returns all the possible callees at the callSite in the callGraph
func FindSeedType ¶
func FindSeedValues ¶
func GetCallsiteArgIndices ¶
func GetCallsiteArgIndices(value ssa.Value, call *ssa.CallCommon) []int
returns the list of parameter indices of the taint source
func GetFieldNameFromJsonTag ¶
func GetReturnIndices ¶
returns the list of return indices of the taint source
func IsK8sUpdateCall ¶
func IsK8sUpdateCall(call *ssa.CallCommon) bool
func IsPointerType ¶
returns if the value represent any pass by reference type
func TaintInvokeCallSiteArgFromCallee ¶
func TaintInvokeCallSiteArgFromCallee(callSite ssa.CallInstruction, calleeParamIndex int, taintedSet map[ssa.Value]bool) bool
This function taints the invoke callsite's arguments using the parameter index from a concrete callee This needs to be carefully handled because the concrete callee's parameter list would contain the receiver, but the invoke callsite's argument list does not contain the receiver
Types ¶
type Field ¶
type Field struct {
Path []string
}
func FieldFromString ¶
func NewIndexField ¶
func NewSubField ¶
type FieldSet ¶
type FieldSet struct {
// contains filtered or unexported fields
}
func MergeFieldSets ¶
func NewFieldSet ¶
func NewFieldSet() *FieldSet
func (*FieldSet) IsMetadata ¶
func (*FieldSet) IsTypeMeta ¶
type IndexField ¶
type IndexField []int
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
func FromSlice ¶
func FromSlice[T comparable](slice []T) *Set[T]
FromSlice returns a new Set with all the items of the slice.
func NewSet ¶
func NewSet[T comparable](items ...T) *Set[T]
func (*Set[T]) Difference ¶
Difference returns a new Set of all the items in the current Set that are not in any of the others
func (*Set[T]) Discard ¶
func (s *Set[T]) Discard(items ...T)
Discard removes item(s) from the Set if exist See also: Remove()
func (*Set[T]) Equal ¶
Equal returns whether the current Set contains the same items as the other one
func (*Set[T]) Intersection ¶
Intersection returns a new Set with the common items of the current set and all others.
func (*Set[T]) IsDisjoint ¶
IsDisjoint returns whether the two Sets have no item in common
func (*Set[T]) IsSubset ¶
IsSubset returns whether all the items of the current set exist in the other one
func (*Set[T]) IsSuperset ¶
IsSuperset returns whether all the items of the other set exist in the current one
func (*Set[T]) Pop ¶
Pop removes an arbitrary item from the Set and returns it. Returns error if the Set is empty
func (*Set[T]) Remove ¶
Remove removes a single item from the Set. Returns error if the item is not in the Set See also: Discard()
func (*Set[T]) SymmetricDifference ¶
SymmetricDifference returns all the items that exist in only one of the Sets