Compare commits

...

4 Commits

Author SHA1 Message Date
Kota Kanbe
74d9a50923 null -> empty slice 2022-10-14 06:49:01 +09:00
Kota Kanbe
d3465ca676 fix(java): collect self-bulid-Jar in ScanResult.libraries 2022-10-07 13:53:15 +09:00
Kota Kanbe
eb87d5d4e1 fix(saas): panic: runtime error: comparing uncomparable type config.PortScanConf (#1537) 2022-10-04 11:55:48 +09:00
tomofumi0003
6963442a5e fix(report): send report to each slack channel (#1530)
* fix send report to each slack channel

* fix(report): use w.Cnf.Channel instead of channel

Co-authored-by: MaineK00n <mainek00n.1229@gmail.com>
2022-09-29 16:08:36 +09:00
3 changed files with 27 additions and 2 deletions

View File

@@ -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)
}

View File

@@ -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
}

View File

@@ -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