kolide/launcher

Ensure we capture file modtime in all checkups in flares

Closed this issue · 0 comments

I noticed a lot of files in our flares come up as having a date modified of November 30, 1979 -- i.e. we don't set metadata on these files before writing them. It would be useful if we could set this metadata on these files so that we can see that info at a glance.

We do have a utility function addFileToZip, which writes out a .flaremeta file containing modtime, create time, and mode -- this doesn't let us see the information at a glance, but does make sure we capture it. We should audit all of our checkups and make sure we are always using this function when writing files to zip. (The one I noticed isn't using addFileToZip is Logs, but there may be others.)

I think we also should be able to set this data on the file in the zip itself (via the FileHeader).

  • Audit all checkups that run for flares and make sure we use addFileToZip for any checkups that write a file from disk to the zip file
  • Update addFileToZip to set metadata (modtime, create time, mode) on the file in the zip