container-structure-test icon indicating copy to clipboard operation
container-structure-test copied to clipboard

mime type check

Open errordeveloper opened this issue 5 years ago • 1 comments

It'd be nice to be able to validate certain file types, e.g. shared objects, dynamically linked executables, static executables, and executables for different architectures. It's currently possible to do with file, but it's a big dependency to pull in and it's normally not present in minimal images.

Example:

fileContentTests:
- name: "bash is an executable binary"
   path: "/bin/bash"
   mimeType: 'application/x-executable'
   isExecutable: true

elfBinaryTests:
- name: "bash is dynamically linked arm64 binary"
   path: "/bin/bash"
   isDynamicallyLinked: true
   architecture: "amd64"

errordeveloper avatar Jun 22 '20 13:06 errordeveloper

@errordeveloper long time no see :) this seems like a reasonable thing to do, makes me wonder if there's other common file metadata we might want to be validating as well.

at the moment the project is in maintenance mode, and my hands are full with skaffold so I doubt I'll be implementing this any time soon. that said, if you feel motivated to submit a PR I'm around for code review!

nkubala avatar Jul 01 '20 19:07 nkubala