github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/pkg/scanners/cloudformation/parser/fn_not.go (about) 1 package parser 2 3 import "github.com/khulnasoft-lab/defsec/pkg/scanners/cloudformation/cftypes" 4 5 func ResolveNot(property *Property) (resolved *Property, success bool) { 6 if !property.isFunction() { 7 return property, true 8 } 9 10 refValue := property.AsMap()["Fn::Not"].AsList() 11 12 if len(refValue) != 1 { 13 return abortIntrinsic(property, "Fn::No should have at only 1 values, returning original Property") 14 } 15 16 funcToInvert, _ := refValue[0].resolveValue() 17 18 if funcToInvert.IsBool() { 19 return property.deriveResolved(cftypes.Bool, !funcToInvert.AsBool()), true 20 } 21 22 return property, false 23 }