Skip to content

Divyang-Soni/deckoder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deckoder

Check files in docker image

fork from aquasecurity/fanal

Feature

  • Fetch target image data if there is no image in local
  • Check target condition files

Examples

ctx := context.Background()
var files extractor.FileMap

// Only check file path
filterFunc := func(h *tar.Header) (bool, error) {
    filePath := filepath.Clean(h.Name)
    fileName := filepath.Base(filePath)
    return StringInSlice(filePath, filenames) || StringInSlice(fileName, filenames), nil
}

files, err = analyzer.Analyze(ctx, imageName, filterFunc, dockerOption)
if err != nil {
	return nil, fmt.Errorf("failed to analyze image: %w", err)
}

// files => map[filename string]FileData{
//              Body     []byte      : file bytes
//              FileMode os.FileMode : file's mode
// }

Notes

When using latest tag, that image will be cached. After latest tag is updated, you need to clear cache.

About

Untar and Check file tool for Containers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 99.1%
  • Makefile 0.9%