github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/pkg/scanners/cloudformation/parser/fn_base64.go (about) 1 package parser 2 3 import ( 4 "encoding/base64" 5 6 "github.com/khulnasoft-lab/defsec/pkg/scanners/cloudformation/cftypes" 7 ) 8 9 func ResolveBase64(property *Property) (*Property, bool) { 10 if !property.isFunction() { 11 return property, true 12 } 13 14 refValue := property.AsMap()["Fn::Base64"].AsString() 15 16 retVal := base64.StdEncoding.EncodeToString([]byte(refValue)) 17 18 return property.deriveResolved(cftypes.String, retVal), true 19 }