feat(report): Include dependencies into scan result and cyclondex for supply chain security on Integration with GitHub Security Alerts (#1584)
* feat(report): Enhance scan result and cyclondex for supply chain security on Integration with GitHub Security Alerts * derive ecosystem/version from dependency graph * fix vars name && fetch manifest info on GSA && arrange ghpkgToPURL structure * fix miscs * typo in error message * fix ecosystem equally to trivy * miscs * refactoring * recursive dependency graph pagination * change var name && update comments * omit map type of ghpkgToPURL in signatures * fix vars name * goimports * make fmt * fix comment Co-authored-by: MaineK00n <mainek00n.1229@gmail.com>
This commit is contained in:
		@@ -62,7 +62,7 @@ const sudo = true
 | 
			
		||||
// noSudo is Const value for normal user mode
 | 
			
		||||
const noSudo = false
 | 
			
		||||
 | 
			
		||||
//  Issue commands to the target servers in parallel via SSH or local execution.  If execution fails, the server will be excluded from the target server list(servers) and added to the error server list(errServers).
 | 
			
		||||
// Issue commands to the target servers in parallel via SSH or local execution.  If execution fails, the server will be excluded from the target server list(servers) and added to the error server list(errServers).
 | 
			
		||||
func parallelExec(fn func(osTypeInterface) error, timeoutSec ...int) {
 | 
			
		||||
	resChan := make(chan osTypeInterface, len(servers))
 | 
			
		||||
	defer close(resChan)
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@ func newBsd(c config.ServerInfo) *bsd {
 | 
			
		||||
	return d
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//https://github.com/mizzy/specinfra/blob/master/lib/specinfra/helper/detect_os/freebsd.rb
 | 
			
		||||
// https://github.com/mizzy/specinfra/blob/master/lib/specinfra/helper/detect_os/freebsd.rb
 | 
			
		||||
func detectFreebsd(c config.ServerInfo) (bool, osTypeInterface) {
 | 
			
		||||
	// Prevent from adding `set -o pipefail` option
 | 
			
		||||
	c.Distro = config.Distro{Family: constant.FreeBSD}
 | 
			
		||||
 
 | 
			
		||||
@@ -801,7 +801,7 @@ func (o *redhatBase) parseNeedsRestarting(stdout string) (procs []models.NeedRes
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//TODO refactor
 | 
			
		||||
// TODO refactor
 | 
			
		||||
// procPathToFQPN returns Fully-Qualified-Package-Name from the command
 | 
			
		||||
func (o *redhatBase) procPathToFQPN(execCommand string) (string, error) {
 | 
			
		||||
	execCommand = strings.Replace(execCommand, "\x00", " ", -1) // for CentOS6.9
 | 
			
		||||
 
 | 
			
		||||
@@ -603,7 +603,7 @@ func Test_redhatBase_parseRpmQfLine(t *testing.T) {
 | 
			
		||||
		{
 | 
			
		||||
			name:   "valid line",
 | 
			
		||||
			fields: fields{base: base{}},
 | 
			
		||||
			args: args{line: "Percona-Server-shared-56	1	5.6.19	rel67.0.el6 x86_64"},
 | 
			
		||||
			args:   args{line: "Percona-Server-shared-56	1	5.6.19	rel67.0.el6 x86_64"},
 | 
			
		||||
			wantPkg: &models.Package{
 | 
			
		||||
				Name:    "Percona-Server-shared-56",
 | 
			
		||||
				Version: "1:5.6.19",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user