Compare commits
4 Commits
v0.20.4
...
collect-se
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74d9a50923 | ||
|
|
d3465ca676 | ||
|
|
eb87d5d4e1 | ||
|
|
6963442a5e |
@@ -35,10 +35,10 @@ type message struct {
|
||||
|
||||
func (w SlackWriter) Write(rs ...models.ScanResult) (err error) {
|
||||
|
||||
channel := w.Cnf.Channel
|
||||
for _, r := range rs {
|
||||
w.lang, w.osFamily = r.Lang, r.Family
|
||||
if channel == "${servername}" {
|
||||
channel := w.Cnf.Channel
|
||||
if w.Cnf.Channel == "${servername}" {
|
||||
channel = fmt.Sprintf("#%s", r.ServerName)
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,9 @@ func writeToFile(cnf config.Config, path string) error {
|
||||
if cnf.Default.WordPress != nil && cnf.Default.WordPress.IsZero() {
|
||||
cnf.Default.WordPress = nil
|
||||
}
|
||||
if cnf.Default.PortScan != nil && cnf.Default.PortScan.IsZero() {
|
||||
cnf.Default.PortScan = nil
|
||||
}
|
||||
|
||||
c := struct {
|
||||
Saas *config.SaasConf `toml:"saas"`
|
||||
@@ -198,5 +201,11 @@ func cleanForTOMLEncoding(server config.ServerInfo, def config.ServerInfo) confi
|
||||
}
|
||||
}
|
||||
|
||||
if server.PortScan != nil {
|
||||
if server.PortScan.IsZero() || reflect.DeepEqual(server.PortScan, def.PortScan) {
|
||||
server.PortScan = nil
|
||||
}
|
||||
}
|
||||
|
||||
return server
|
||||
}
|
||||
|
||||
@@ -770,6 +770,22 @@ func AnalyzeLibraries(ctx context.Context, libFilemap map[string]LibFile, isOffl
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("Failed to convert libs. err: %w", err)
|
||||
}
|
||||
|
||||
found := false
|
||||
for _, a := range result.Applications {
|
||||
if a.FilePath == path {
|
||||
found = true
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
libscan = append(libscan, models.LibraryScanner{
|
||||
// TODO
|
||||
// Type: app.Type,
|
||||
LockfilePath: path,
|
||||
Libs: []models.Library{},
|
||||
})
|
||||
}
|
||||
|
||||
libraryScanners = append(libraryScanners, libscan...)
|
||||
}
|
||||
return libraryScanners, nil
|
||||
|
||||
Reference in New Issue
Block a user