HFScanHFScanCMD`cmd:"" name:"hf-scan" help:"Checks installed models for known security issues. WARNING: this is a best-effort feature and may not catch everything!"`
ModelsPathstring`env:"LOCALAI_MODELS_PATH,MODELS_PATH" type:"path" default:"${basepath}/models" help:"Path containing models used for inferencing" group:"storage"`
Galleriesstring`env:"LOCALAI_GALLERIES,GALLERIES" help:"JSON list of galleries" group:"models" default:"${galleries}"`
log.Info().Msg("No security warnings were detected for your installed models. Please note that this is a BEST EFFORT tool, and all issues may not be detected.")
}else{
log.Error().Err(err).Msg("! WARNING ! A known-vulnerable model is installed!")
}
returnerr
}else{
varerrserror=nil
for_,uri:=rangehfscmd.ToScan{
log.Info().Str("uri",uri).Msg("scanning specific uri")
log.Error().Err(err).Strs("clamAV",scanResults.ClamAVInfectedFiles).Strs("pickles",scanResults.DangerousPickles).Msg("! WARNING ! A known-vulnerable model is included in this repo!")
errs=errors.Join(errs,err)
}
}
iferrs!=nil{
returnerrs
}
log.Info().Msg("No security warnings were detected for your installed models. Please note that this is a BEST EFFORT tool, and all issues may not be detected.")