diff --git a/common/common.go b/common/common.go index 6693f3a9d85465caef54fef725354ddeb52a6508..52bd155c1d3e8c682242be77aa41bea9a39d5004 100644 --- a/common/common.go +++ b/common/common.go @@ -5,6 +5,7 @@ import ( "github.com/astaxie/beego" "github.com/astaxie/beego/config" "github.com/astaxie/beego/logs" + "os" "strings" "time" ) @@ -432,3 +433,13 @@ func GetSpecialDate(beforeDate int) string { } return startDate } + +func CreateDir(Dir string) error{ + _, err := os.Stat(Dir) + if err != nil{ + if os.IsNotExist(err){ + os.Mkdir(Dir, 0777) + } + } + return err +} diff --git a/conf/app.conf b/conf/app.conf index 218c75991c762caa96cc3d3415b1f9bd52552493..c8a4ae4d070ebb2a9d323aa90a0080a970f7f37d 100644 --- a/conf/app.conf +++ b/conf/app.conf @@ -22,8 +22,8 @@ labelFixed = "CVE/FIXED" labelUnFix = "CVE/UNFIXED" labeUnaffected = "CVE/UNAFFECTED" fileDir = "download" -# release package download url -rpUrl = "http://119.3.219.20:88/mkb/obs_update_info/openEuler-20.03-LTS.csv" +# release package download url http://119.3.219.20:88/mkb/obs_update_info/openEuler-20.03-LTS.csv +rpUrl = "https://gitee.com/unsunghero/obs_pkg_rpms/raw/master/latest_rpm/openEuler-20.03-LTS.csv" [mysql] @@ -48,11 +48,11 @@ maxsize=204800 ymalflag = 2 getymal = 0 0 1 * * 1 cveflag = 2 -getcve = 0 4 16 * * * +getcve = 0 14 11 * * * oricveflag = 2 oricvecheck = 0 16 19 * * * getissueflag = 2 -getissue = 0 57 15 * * * +getissue = 0 50 10 * * * issueflag = 2 createissue = 0 7 16 * * * test = 0/10 * * * * * @@ -62,7 +62,7 @@ genexcelflag = 2 genexcel = 0 0/10 * * * * days = -30 prcnum = 50 -printlogflag = 1 +printlogflag = 2 printlog = 0 0/20 * * * * unlockflag = 2 unlock = 0 30 19 * * * @@ -75,7 +75,7 @@ exceptcve = 0 3 19 * * * gensaflag = 2 gensa = 0 3 19 * * * issuestatisticflag = 2 -issuestatistic = 0 53 15 * * * +issuestatistic = 0 11 10 * * * cvecredflag = 2 cvecredit = 0 53 14 * * * urgenttaskflag = 2 @@ -149,7 +149,7 @@ snsuffix = 1002 # Version package excel download address # example: openEuler-20.03-LTS@http://119.3.219.20:88/mkb/obs_update_info/openEuler-20.03-LTS.csv; # openEuler-20.03-LTS-SP1@http://119.3.219.20:88/mkb/obs_update_info/openEuler-20.03-LTS-SP1.csv -v_pack_20_03_url = "openEuler-20.03-LTS@http://119.3.219.20:88/mkb/obs_update_info/openEuler-20.03-LTS.csv;openEuler-20.03-LTS-SP1@http://119.3.219.20:88/mkb/obs_update_info/openEuler-20.03-LTS-SP1.csv" +v_pack_20_03_url = "openEuler-20.03-LTS@https;openEuler-20.03-LTS-SP1@https" # Time difference in different time zones sa_timestamp_zone = 28800 diff --git a/conf/product_app.conf b/conf/product_app.conf index 6ebdb554ab21a13175080d6f6961bc8be33fd58a..6d95624642a4b3b770a04e716fe2eca27138f290 100644 --- a/conf/product_app.conf +++ b/conf/product_app.conf @@ -23,7 +23,7 @@ labelUnFix = "CVE/UNFIXED" labeUnaffected = "CVE/UNAFFECTED" fileDir = "download" # release package download url -rpUrl = "http://119.3.219.20:88/mkb/obs_update_info/openEuler-20.03-LTS.csv" +rpUrl = "https://gitee.com/unsunghero/obs_pkg_rpms/raw/master/latest_rpm/openEuler-20.03-LTS.csv" @@ -76,7 +76,7 @@ exceptcve = 0 0 4 * * * gensaflag = 1 gensa = 0 1 0 * * * issuestatisticflag = 1 -issuestatistic = 0 35 8 * * * +issuestatistic = 0 1 10 * * 1,3,5 cvecredflag = 1 cvecredit = 0 0 5 * * * urgenttaskflag = 1 @@ -145,7 +145,7 @@ snsuffix = 1002 # Version package excel download address # example: openEuler-20.03-LTS@http://119.3.219.20:88/mkb/obs_update_info/openEuler-20.03-LTS.csv; # openEuler-20.03-LTS-SP1@http://119.3.219.20:88/mkb/obs_update_info/openEuler-20.03-LTS-SP1.csv -v_pack_20_03_url = "openEuler-20.03-LTS@http://119.3.219.20:88/mkb/obs_update_info/openEuler-20.03-LTS.csv;openEuler-20.03-LTS-SP1@http://119.3.219.20:88/mkb/obs_update_info/openEuler-20.03-LTS-SP1.csv" +v_pack_20_03_url = "openEuler-20.03-LTS@https://openEuler-20.03-LTS.csv;openEuler-20.03-LTS-SP1@https://openEuler-20.03-LTS-SP1.csv" # Time difference in different time zones sa_timestamp_zone = 28800 diff --git a/controllers/file.go b/controllers/file.go index 81af0e43d4a12fb5794e3af08cc32c8f22d0e239..b4b9ea0c81cbecd94f82e7e6d337d5f4326deb1c 100644 --- a/controllers/file.go +++ b/controllers/file.go @@ -25,10 +25,7 @@ type FileController struct { // @router /lastExcel [get] func (f *FileController) DownloadLastExcel() { fd := beego.AppConfig.DefaultString("fileDir", "download") - err := util.MakeDir(fd) - if err != nil { - logs.Error(err) - } + err := common.CreateDir(fd) er := models.ExportRecord{} err = er.QueryLast() if err != nil { @@ -45,6 +42,7 @@ func (f *FileController) DownloadLastExcel() { //@router /downloadExcel func (f *FileController) DownLoadExcelByFileCode() { fd := beego.AppConfig.DefaultString("fileDir", "download") + common.CreateDir(fd) fc := f.GetString("fileCode") if fc == "" { _ = f.Ctx.Output.Body([]byte("err: fileCode is a required parameter ")) @@ -120,12 +118,13 @@ func (f *FileController) TriggerCveData() { cvrfFileList := make(map[string][]string) cvrfFileMap := make(map[string]taskhandler.CvrfSa) affectBranchSlice := make([]string, 0) - du := "openEuler-20.03-LTS@http://119.3.219.20:88/mkb/obs_update_info/openEuler-20.03-LTS.csv" + du := "openEuler-20.03-LTS@https://gitee.com/unsunghero/obs_pkg_rpms/raw/master/latest_rpm/openEuler-20.03-LTS.csv" //du := beego.AppConfig.String("excel::v_pack_20_03_url") du = beego.AppConfig.DefaultString("excel::v_pack_20_03_url", du) csvPathList := strings.Split(du, ";") if len(csvPathList) > 0 { for _, csvP := range csvPathList { + time.Sleep(time.Second) openBranchx := strings.Split(csvP, "@") if len(openBranchx) == 2 { affectBranch := openBranchx[0] @@ -143,7 +142,7 @@ func (f *FileController) TriggerCveData() { // return the success notice // Need to be executed sequentially wgCrvf.Add(1) - go taskhandler.GenerateExcelTrigger(&wgCrvf, en, startTime, fileCode, affectBranch, + taskhandler.GenerateExcelTrigger(&wgCrvf, en, startTime, fileCode, affectBranch, csvDownPath, dir, cvrfFileList, componentMap, cvrfFileMap) // Return the result first, continue processing the data f.Ctx.WriteString(fmt.Sprintf("Success:The name of the excel file generated this time is: %s. "+ @@ -167,6 +166,7 @@ func GenAndUploadCvrf(cvrfFileMap map[string]taskhandler.CvrfSa, // taskhandler.WriteCvrfXml(cvrfKey, &cvrfVule) // } //} + common.CreateDir(dir) writeCvrfSlice := make([]string, 0) totalFileSlice := make([]string, 0) if len(componentMap) > 0 { @@ -183,12 +183,15 @@ func GenAndUploadCvrf(cvrfFileMap map[string]taskhandler.CvrfSa, if isEque { cvrfFileName := componentMap[comKey].CvrfFileName cvrfVule := cvrfFileMap[cvrfFileName] - if !taskhandler.QueryCveMd5(componentMap[comKey].CveNum, componentMap[comKey].OwnedComponent, - componentMap[comKey].OpenEulerSANum, taskhandler.FIXEDFLAGE) { - taskhandler.WriteCvrfXml(cvrfFileName, &cvrfVule) - writeCvrfSlice = append(writeCvrfSlice, cvrfFileName) - } else { - UpdateOpenEulerSaNumStatus(comValue.OpenEulerSANum) + md5Ok, tmpOpenEulerSANum := taskhandler.QueryCveMd5(componentMap[comKey].CveNum, componentMap[comKey].OwnedComponent, + componentMap[comKey].OpenEulerSANum, taskhandler.FIXEDFLAGE) + taskhandler.WriteCvrfXml(cvrfFileName, &cvrfVule) + writeCvrfSlice = append(writeCvrfSlice, cvrfFileName) + if md5Ok { + UpdateOpenEulerSaNumStatus(tmpOpenEulerSANum) + var saf models.SaFileList + saf.FileName = "cvrf-" + tmpOpenEulerSANum + ".xml" + models.DeleteCvrfFileName(&saf, "FileName") } for _, br := range comValue.CveNumMap { UpdateOpenEulerSaNumStatus(br.OpenEulerSANum) @@ -197,12 +200,15 @@ func GenAndUploadCvrf(cvrfFileMap map[string]taskhandler.CvrfSa, for _, br := range comValue.CveNumMap { cvrfFileName := br.CvrfFileName cvrfVule := cvrfFileMap[br.CvrfFileName] - if !taskhandler.QueryCveMd5(br.CveNumSlice, componentMap[comKey].OwnedComponent, - br.OpenEulerSANum, taskhandler.FIXEDFLAGE) { - taskhandler.WriteCvrfXml(cvrfFileName, &cvrfVule) - writeCvrfSlice = append(writeCvrfSlice, cvrfFileName) - } else { - UpdateOpenEulerSaNumStatus(br.OpenEulerSANum) + md5Ok, tmpOpenEulerSANum := taskhandler.QueryCveMd5(br.CveNumSlice, componentMap[comKey].OwnedComponent, + br.OpenEulerSANum, taskhandler.FIXEDFLAGE) + taskhandler.WriteCvrfXml(cvrfFileName, &cvrfVule) + writeCvrfSlice = append(writeCvrfSlice, cvrfFileName) + if md5Ok { + UpdateOpenEulerSaNumStatus(tmpOpenEulerSANum) + var saf models.SaFileList + saf.FileName = "cvrf-" + tmpOpenEulerSANum + ".xml" + models.DeleteCvrfFileName(&saf, "FileName") } } UpdateOpenEulerSaNumStatus(comValue.OpenEulerSANum) @@ -210,12 +216,15 @@ func GenAndUploadCvrf(cvrfFileMap map[string]taskhandler.CvrfSa, } else { cvrfFileName := componentMap[comKey].CvrfFileName cvrfVule := cvrfFileMap[cvrfFileName] - if !taskhandler.QueryCveMd5(componentMap[comKey].CveNum, componentMap[comKey].OwnedComponent, - componentMap[comKey].OpenEulerSANum, taskhandler.FIXEDFLAGE) { - taskhandler.WriteCvrfXml(cvrfFileName, &cvrfVule) - writeCvrfSlice = append(writeCvrfSlice, cvrfFileName) - } else { - UpdateOpenEulerSaNumStatus(comValue.OpenEulerSANum) + md5Ok, tmpOpenEulerSANum := taskhandler.QueryCveMd5(componentMap[comKey].CveNum, componentMap[comKey].OwnedComponent, + componentMap[comKey].OpenEulerSANum, taskhandler.FIXEDFLAGE) + taskhandler.WriteCvrfXml(cvrfFileName, &cvrfVule) + writeCvrfSlice = append(writeCvrfSlice, cvrfFileName) + if md5Ok { + UpdateOpenEulerSaNumStatus(tmpOpenEulerSANum) + var saf models.SaFileList + saf.FileName = "cvrf-" + tmpOpenEulerSANum + ".xml" + models.DeleteCvrfFileName(&saf, "FileName") } for _, br := range comValue.CveNumMap { UpdateOpenEulerSaNumStatus(br.OpenEulerSANum) @@ -257,9 +266,10 @@ func uploadCvrfFile(cvrfFileList map[string][]string, totalFileSlice []string, d sfl := models.GetCvrfAllFile() indexFilePath := filepath.Join(dir, "index.txt") updateFilePath := filepath.Join(dir, "update_fixed.txt") + curYears := strconv.Itoa(time.Now().Year()) if len(sfl) > 0 { for _, l := range sfl { - totalSlice = append(totalSlice, l.FileName) + totalSlice = append(totalSlice, curYears+"/"+l.FileName) } //totalSlice = append(totalSlice, subFileSlice...) readErr := taskhandler.ReadWriteFile(indexFilePath, totalSlice) diff --git a/cve-py/issue_statistics/to_email.xlsx b/cve-py/issue_statistics/to_email.xlsx index 9d5ced369808b0b11e80745974ad2b0704fd1326..9575d691e239b399e5aebc2902998f8554c91e7e 100644 Binary files a/cve-py/issue_statistics/to_email.xlsx and b/cve-py/issue_statistics/to_email.xlsx differ diff --git a/models/cve.go b/models/cve.go index 0fc67d1c7290d521091499142452f169040ba912..109707e3422534dcacec091e6867aaa9b2366b29 100644 --- a/models/cve.go +++ b/models/cve.go @@ -936,7 +936,8 @@ d.affect_product,d.reference_link,d.affect_status, e.public_date,e.openeuler_sa_num,a.cve_level,b.organizate_id FROM cve_issue_template a RIGHT JOIN -(SELECT (SELECT COUNT(*) FROM cve_vuln_center WHERE cve_num = ?) num ,bc.cve_id,bc.cve_num,bc.organizate_id +(SELECT (SELECT COUNT(*) FROM cve_vuln_center WHERE cve_num = ? AND is_export = 3) num , +bc.cve_id,bc.cve_num,bc.organizate_id FROM cve_vuln_center bc WHERE bc.cve_num = ? AND bc.is_export = 3 ) b ON a.cve_id = b.cve_id LEFT JOIN cve_score c diff --git a/models/excel.go b/models/excel.go index 9d144be0bf6368a1dccbaff6faac8398d6d09252..d4f330807457e5f66434fe109178de5b41753c59 100644 --- a/models/excel.go +++ b/models/excel.go @@ -120,3 +120,9 @@ func UpdateCvrfFileName(afl *SaFileList, fields ...string) error { _, err := o.Update(afl, fields...) return err } + +func DeleteCvrfFileName(afl *SaFileList, fields ...string) error { + o := orm.NewOrm() + _, err := o.Delete(afl, fields...) + return err +} diff --git a/taskhandler/cve.go b/taskhandler/cve.go index 6d4ed78c78252e2aa32b527b92a1cba46c906ab6..4a39365f64ca7ee6dd812c85eba4d3fd5023ab45 100644 --- a/taskhandler/cve.go +++ b/taskhandler/cve.go @@ -4,13 +4,13 @@ import ( "cvevulner/common" "cvevulner/models" "cvevulner/util" + "encoding/base64" "encoding/json" "errors" "fmt" "github.com/astaxie/beego" "github.com/astaxie/beego/config" "github.com/astaxie/beego/logs" - "io" "io/ioutil" "net/http" "net/url" @@ -1983,7 +1983,7 @@ func GenerateExcelTrigger(wgx *sync.WaitGroup, fileName, startTime, fileCode, af } fileName = filepath.Join(dir, fileName) localPath := filepath.Join(dir, affectBranch+"_release-package.CSV") - err = downloadPackageFile(localPath, csvDownPath) + err = downloadPackageFile(localPath, csvDownPath, affectBranch) if err != nil { logs.Error(err) fr.State = 2 @@ -2007,7 +2007,6 @@ func GenerateExcelTrigger(wgx *sync.WaitGroup, fileName, startTime, fileCode, af fr.State = 1 } _ = fr.Update("state") - // zip file zipFileList := []string{fileName, filePath} //zipFileList := []string{"download/cve与安全公告openEuler-20.03-LTS_1607081986.xlsx", "download/updateinfo.xml"} @@ -2031,29 +2030,53 @@ func GenerateExcelTrigger(wgx *sync.WaitGroup, fileName, startTime, fileCode, af logs.Info(affectBranch, ", GenerateExcelTrigger: end") } -func downloadPackageFile(localPath, url string) error { - resp, err := http.Get(url) +func downloadPackageFile(localPath, url, affectBranch string) error { + logs.Info("The csv file currently being downloaded is: ", url) + pkgLock.Lock() + err := GiteeDownCsv(localPath, affectBranch) + pkgLock.Unlock() + return err +} + +func GiteeDownCsv(localPath, branch string) (error) { + accessToken := os.Getenv("GITEE_TOKEN") + owner := "unsunghero" + repo := "obs_pkg_rpms" + path := fmt.Sprintf("latest_rpm/%v.csv", branch) + gitUrl := fmt.Sprintf("https://gitee.com/api/v5/repos/%v/%v/contents/%v?access_token=%v", owner, repo, path, accessToken) + resp, err := http.Get(gitUrl) if err != nil { + logs.Error("get error, url:", gitUrl, "error: ", err) return err } defer resp.Body.Close() - if resp.StatusCode == http.StatusOK { - pkgLock.Lock() - defer pkgLock.Unlock() - if ex, _ := util.IsExistPath(localPath); ex { - err := os.Remove(localPath) - if err != nil { - logs.Error(err) - } - } - out, err := os.Create(localPath) - if err != nil { - return err - } - defer out.Close() - _, err = io.Copy(out, resp.Body) + body, err := ioutil.ReadAll(resp.Body) + if err != nil || body == nil { + logs.Error(err) + return err + } + logs.Info("body: \n", string(body), "url: ", gitUrl) + var contents map[string]interface{} + err = json.Unmarshal(body, &contents) + if err != nil { + logs.Error(err) return err + } + f, ferr := os.Create(localPath) + if ferr != nil { + logs.Error(ferr) + return ferr + } + fileType := contents["type"].(string) + encoding := contents["encoding"].(string) + content := contents["content"].(string) + if fileType == "file" && encoding == "base64" { + data, baseErr := base64.StdEncoding.DecodeString(content) + if baseErr == nil { + f.Write(data) + } } else { - return errors.New("download file request fail") + f.WriteString(content) } + return nil } diff --git a/taskhandler/cvrf.go b/taskhandler/cvrf.go index 83b8d02310c1782e0507b2bef28b69cf65984fa9..5a8e21f090a9f76332854e1ab604440a2fcfeb76 100644 --- a/taskhandler/cvrf.go +++ b/taskhandler/cvrf.go @@ -260,6 +260,7 @@ type BrachCveInfo struct { OpenEulerSANum string CvrfFileName string CveNumSlice []string + OpenEulerScore []float64 } type ComponentInfo struct { @@ -516,7 +517,7 @@ func BranchExist(affectBranch string, cvrfFileList map[string][]string) []string func BuilddocumentNotes(cvrfsa *CvrfSa, v models.ExcelExport, introduction, topic, affectBranch string, componentMap map[string]ComponentInfo, - branchList []string) { + branchList []string, branchFlag int) { documentNotes := cvrfsa.DocumentNotes if documentNotes == nil || cvrfsa.DocumentNotes.Note == nil || len(cvrfsa.DocumentNotes.Note) == 0 { @@ -595,32 +596,53 @@ func BuilddocumentNotes(cvrfsa *CvrfSa, v models.ExcelExport, te.Note = te.Note } if te.Title == "Topic" { - vcn := strings.Join(componentInfo.CveNum, ";\n") - theme, err := models.GetCanExportTheme(vcn, v.InfluenceComponent, affectBranch) - if err == nil && len(theme) > 1 { - theme = strings.ReplaceAll(theme, "\n\n", "\r\n\r\n") - if branchCount <= 1 { + vcn := "" + if branchFlag == 1 { + vcn = strings.Join(componentInfo.CveNum, ";\n") + theme, err := models.GetCanExportTheme(vcn, v.InfluenceComponent, affectBranch) + if err == nil && len(theme) > 1 { + theme = strings.ReplaceAll(theme, "\n\n", "\r\n\r\n") + if branchCount <= 1 { + te.Note = theme + } else if branchCount == 2 { + te.Note = strings.ReplaceAll(theme, affectBranch, strings.Join(branchList, " and ")) + } else { + reBanch := strings.Join(branchList[:len(branchList)-1], ",") + " and " + branchList[len(branchList)-1] + te.Note = strings.ReplaceAll(theme, affectBranch, reBanch) + } + } + } else { + vcn = strings.Join(componentInfo.CveNumMap[affectBranch].CveNumSlice, ";\n") + theme, err := models.GetCanExportTheme(vcn, v.InfluenceComponent, affectBranch) + if err == nil && len(theme) > 1 { + theme = strings.ReplaceAll(theme, "\n\n", "\r\n\r\n") te.Note = theme - } else if branchCount == 2 { - te.Note = strings.ReplaceAll(theme, affectBranch, strings.Join(branchList, " and ")) - } else { - reBanch := strings.Join(branchList[:len(branchList)-1], ",") + " and " + branchList[len(branchList)-1] - te.Note = strings.ReplaceAll(theme, affectBranch, reBanch) } } } if te.Title == "Summary" { - if branchCount <= 1 { - te.Note = v.Introduction - } else if branchCount == 2 { - te.Note = strings.ReplaceAll(v.Introduction, affectBranch, strings.Join(branchList, " and ")) + if branchFlag == 1 { + if branchCount <= 1 { + te.Note = v.Introduction + } else if branchCount == 2 { + te.Note = strings.ReplaceAll(v.Introduction, affectBranch, strings.Join(branchList, " and ")) + } else { + reBanch := strings.Join(branchList[:len(branchList)-1], ",") + " and " + branchList[len(branchList)-1] + te.Note = strings.ReplaceAll(v.Introduction, affectBranch, reBanch) + } } else { - reBanch := strings.Join(branchList[:len(branchList)-1], ",") + " and " + branchList[len(branchList)-1] - te.Note = strings.ReplaceAll(v.Introduction, affectBranch, reBanch) + te.Note = v.Introduction } + } if te.Title == "Severity" { - openEulerScoreSlice := componentInfo.OpenEulerScore + var openEulerScoreSlice []float64 + if branchFlag == 1 { + openEulerScoreSlice = componentInfo.OpenEulerScore + } else { + openEulerScoreSlice = componentInfo.CveNumMap[affectBranch].OpenEulerScore + } + if len(openEulerScoreSlice) > 1 { sort.Float64s(openEulerScoreSlice) } @@ -637,22 +659,38 @@ func BuilddocumentNotes(cvrfsa *CvrfSa, v models.ExcelExport, func BuildDocumentTitle(cvrfsa *CvrfSa, v models.ExcelExport, affectBranch string, cvrfFileList map[string][]string, componentMap map[string]ComponentInfo, - curDate string, branchList []string) { + curDate string, branchList []string, branchFlag int) { var documt DocumentTitle introduction := "" topic := "" branchCount := len(branchList) - if branchCount <= 1 { + ownedComponent := "" + if len(v.InfluenceComponent) > 1 { + ownedComponent = v.InfluenceComponent + } else { + ownedComponent = v.OwnedComponent + } + componentInfo := componentMap[ownedComponent] + localOpenEulerSANum := "" + if branchFlag == 1 { + localOpenEulerSANum = componentInfo.OpenEulerSANum + if branchCount <= 1 { + introduction = v.Introduction + topic = v.Theme + } else if branchCount == 2 { + introduction = strings.ReplaceAll(v.Introduction, affectBranch, strings.Join(branchList, " and ")) + topic = strings.ReplaceAll(v.Theme, affectBranch, strings.Join(branchList, " and ")) + } else { + reBanch := strings.Join(branchList[:len(branchList)-1], ",") + " and " + branchList[len(branchList)-1] + introduction = strings.ReplaceAll(v.Introduction, affectBranch, reBanch) + topic = strings.ReplaceAll(v.Theme, affectBranch, reBanch) + } + } else { introduction = v.Introduction topic = v.Theme - } else if branchCount == 2 { - introduction = strings.ReplaceAll(v.Introduction, affectBranch, strings.Join(branchList, " and ")) - topic = strings.ReplaceAll(v.Theme, affectBranch, strings.Join(branchList, " and ")) - } else { - reBanch := strings.Join(branchList[:len(branchList)-1], ",") + " and " + branchList[len(branchList)-1] - introduction = strings.ReplaceAll(v.Introduction, affectBranch, reBanch) - topic = strings.ReplaceAll(v.Theme, affectBranch, reBanch) + localOpenEulerSANum = componentInfo.CveNumMap[affectBranch].OpenEulerSANum } + if len(introduction) > 1 { documt.DocumentTitle = introduction[:len(introduction)-1] } else { @@ -668,14 +706,7 @@ func BuildDocumentTitle(cvrfsa *CvrfSa, v models.ExcelExport, affectBranch strin cvrfsa.DocumentPublisher = &documentPublisher var documentTracking DocumentTracking var identification Identification - ownedComponent := "" - if len(v.InfluenceComponent) > 1 { - ownedComponent = v.InfluenceComponent - } else { - ownedComponent = v.OwnedComponent - } - componentInfo := componentMap[ownedComponent] - identification.Id = componentInfo.OpenEulerSANum + identification.Id = localOpenEulerSANum documentTracking.Identification = &identification documentTracking.Status = "Final" documentTracking.Version = "1.0" @@ -713,11 +744,21 @@ func BuildDocumentTitle(cvrfsa *CvrfSa, v models.ExcelExport, affectBranch strin documentTracking.Generator = &generator cvrfsa.DocumentTracking = &documentTracking BuilddocumentNotes(cvrfsa, v, introduction, topic, - affectBranch, componentMap, branchList) + affectBranch, componentMap, branchList, branchFlag) } -func BuildDocumentRef(cvrfsa *CvrfSa, v models.ExcelExport, componentMap map[string]ComponentInfo) { +func BuildDocumentRef(cvrfsa *CvrfSa, v models.ExcelExport, + componentMap map[string]ComponentInfo, branchFlag int, affectBranch string) { componentInfo, comOk := componentMap[v.InfluenceComponent] + localOpenEulerSANum := "" + localCveNum := []string{} + if branchFlag == 1 { + localOpenEulerSANum = componentInfo.OpenEulerSANum + localCveNum = componentInfo.CveNum + } else { + localOpenEulerSANum = componentInfo.CveNumMap[affectBranch].OpenEulerSANum + localCveNum = componentInfo.CveNumMap[affectBranch].CveNumSlice + } if comOk { if cvrfsa.DocumentReferences != nil && len(cvrfsa.DocumentReferences.CveReference) > 0 { cveReference := cvrfsa.DocumentReferences.CveReference @@ -758,14 +799,14 @@ func BuildDocumentRef(cvrfsa *CvrfSa, v models.ExcelExport, componentMap map[str var cveReference0 CveReference cveUrlSlice0 := make([]CveUrl, 0) var cveUrl0 CveUrl - cveUrl0.Url = "https://openeuler.org/en/security/safety-bulletin/detail.html?id=" + componentInfo.OpenEulerSANum + cveUrl0.Url = "https://openeuler.org/en/security/safety-bulletin/detail.html?id=" + localOpenEulerSANum cveUrlSlice0 = append(cveUrlSlice0, cveUrl0) cveReference0.Type = "Self" cveReference0.CveUrl = cveUrlSlice0 cveReferenceSlice = append(cveReferenceSlice, cveReference0) var cveReference1 CveReference cveUrlSlice1 := make([]CveUrl, 0) - for _, cveNum := range componentInfo.CveNum { + for _, cveNum := range localCveNum { var cveUrl1 CveUrl cveUrl1.Url = "https://openeuler.org/en/security/cve/detail.html?id=" + cveNum cveUrlSlice1 = append(cveUrlSlice1, cveUrl1) @@ -775,7 +816,7 @@ func BuildDocumentRef(cvrfsa *CvrfSa, v models.ExcelExport, componentMap map[str cveReferenceSlice = append(cveReferenceSlice, cveReference1) var cveReference2 CveReference cveUrlSlice2 := make([]CveUrl, 0) - for _, cveNum := range componentInfo.CveNum { + for _, cveNum := range localCveNum { var cveUrl2 CveUrl cveUrl2.Url = "https://nvd.nist.gov/vuln/detail/" + cveNum cveUrlSlice2 = append(cveUrlSlice2, cveUrl2) @@ -789,8 +830,9 @@ func BuildDocumentRef(cvrfsa *CvrfSa, v models.ExcelExport, componentMap map[str } } -func BuildProductTree(cvrfsa *CvrfSa, v models.ExcelExport, pkg []models.Package, affectBranch string) { - if cvrfsa.ProductTree != nil && len(cvrfsa.ProductTree.OpenEulerBranch) > 0 { +func BuildProductTree(cvrfsa *CvrfSa, v models.ExcelExport, pkg []models.Package, + affectBranch string, branchFlag int) { + if cvrfsa.ProductTree != nil && len(cvrfsa.ProductTree.OpenEulerBranch) > 0 && branchFlag == 1 { affectBranchListx := strings.Split(affectBranch, "-") cpe := fmt.Sprintf("cpe:/a:%v:%v:%v", affectBranchListx[0], affectBranchListx[0], strings.Join(affectBranchListx[1:], "-")) @@ -1004,7 +1046,7 @@ func BuildProductTree(cvrfsa *CvrfSa, v models.ExcelExport, pkg []models.Package } func BuildVulnerability(vlLenth int, v models.ExcelExport, - componentMap map[string]ComponentInfo, cpe string) []Vulnerability { + componentMap map[string]ComponentInfo, cpe string, branchFlag int) []Vulnerability { vulnerabilitySlice := make([]Vulnerability, 0) var vulnerability Vulnerability vulnerability.Xmlns = "http://www.icasi.org/CVRF/schema/vuln/1.1" @@ -1054,7 +1096,13 @@ func BuildVulnerability(vlLenth int, v models.ExcelExport, ownedComponent = v.OwnedComponent } componentInfo := componentMap[ownedComponent] - remediation.Url = "https://openeuler.org/en/security/safety-bulletin/detail.html?id=" + componentInfo.OpenEulerSANum + localOpenEulerSANum := "" + if branchFlag == 1 { + localOpenEulerSANum = componentInfo.OpenEulerSANum + } else { + localOpenEulerSANum = componentInfo.CveNumMap[cpe].OpenEulerSANum + } + remediation.Url = "https://openeuler.org/en/security/safety-bulletin/detail.html?id=" + localOpenEulerSANum remediations.Remediation = &remediation vulnerability.Remediations = &remediations vulnerabilitySlice = append(vulnerabilitySlice, vulnerability) @@ -1062,7 +1110,7 @@ func BuildVulnerability(vlLenth int, v models.ExcelExport, } func BuildVulnerabilitySlice(vulnerability []Vulnerability, v models.ExcelExport, - affectBranch string, componentMap map[string]ComponentInfo) []Vulnerability { + affectBranch string, componentMap map[string]ComponentInfo, branchFlag int) []Vulnerability { //affectBranchListx := strings.Split(affectBranch, "-") //cpe := fmt.Sprintf("cpe:/a:%v:%v:%v", // affectBranchListx[0], affectBranchListx[0], strings.Join(affectBranchListx[1:], "-")) @@ -1081,7 +1129,14 @@ func BuildVulnerabilitySlice(vulnerability []Vulnerability, v models.ExcelExport if !cpeExist { var productId ProductId productId.ProductId = cpe - vl.ProductStatuses.Status.ProductId = append(vl.ProductStatuses.Status.ProductId, productId) + if branchFlag == 1 { + vl.ProductStatuses.Status.ProductId = append(vl.ProductStatuses.Status.ProductId, productId) + } else { + productIdSlice := make([]ProductId, 0) + productIdSlice = append(productIdSlice, productId) + vl.ProductStatuses.Status.ProductId = productIdSlice + } + } cveExist = true break @@ -1089,21 +1144,21 @@ func BuildVulnerabilitySlice(vulnerability []Vulnerability, v models.ExcelExport } if !cveExist { vlLenth := len(vulnerability) + 1 - vulnerabilitySlice := BuildVulnerability(vlLenth, v, componentMap, cpe) + vulnerabilitySlice := BuildVulnerability(vlLenth, v, componentMap, cpe, branchFlag) if len(vulnerabilitySlice) > 0 { vulnerability = append(vulnerability, vulnerabilitySlice...) } } } else { vlLenth := 1 - vulnerabilitySlice := BuildVulnerability(vlLenth, v, componentMap, cpe) + vulnerabilitySlice := BuildVulnerability(vlLenth, v, componentMap, cpe, branchFlag) vulnerability = append(vulnerability, vulnerabilitySlice...) } return vulnerability } func BuildVulnerabilitySet(cvrfsa *CvrfSa, v models.ExcelExport, - affectBranch string, componentMap map[string]ComponentInfo) { + affectBranch string, componentMap map[string]ComponentInfo, branchFlag int) { vulnerability := make([]Vulnerability, 0) if cvrfsa.Vulnerability != nil && len(cvrfsa.Vulnerability) > 0 { for _, vuln := range cvrfsa.Vulnerability { @@ -1111,27 +1166,28 @@ func BuildVulnerabilitySet(cvrfsa *CvrfSa, v models.ExcelExport, } } vulnerabilityx := BuildVulnerabilitySlice(vulnerability, v, - affectBranch, componentMap) + affectBranch, componentMap, branchFlag) cvrfsa.Vulnerability = vulnerabilityx } func BuildCvrfXml(cvrfsa *CvrfSa, v models.ExcelExport, affectBranch string, cvrfFileList map[string][]string, componentMap map[string]ComponentInfo, - pkg []models.Package) { + pkg []models.Package, branchFlag int) { curDate := common.GetCurDate() - v.Description = strings.ReplaceAll(v.Description, "\n\n", " ") - v.Theme = strings.ReplaceAll(v.Theme, "\n\n", " ") + //v.Description = strings.ReplaceAll(v.Description, "\n\n", " ") + //v.Theme = strings.ReplaceAll(v.Theme, "\n\n", " ") branchList := BranchExist(affectBranch, cvrfFileList) cvrfsa.Xmlns = "http://www.icasi.org/CVRF/schema/cvrf/1.1" cvrfsa.XmlnsCvrf = "http://www.icasi.org/CVRF/schema/cvrf/1.1" - BuildDocumentTitle(cvrfsa, v, affectBranch, cvrfFileList, componentMap, curDate, branchList) - BuildDocumentRef(cvrfsa, v, componentMap) - BuildProductTree(cvrfsa, v, pkg, affectBranch) - BuildVulnerabilitySet(cvrfsa, v, affectBranch, componentMap) + BuildDocumentTitle(cvrfsa, v, affectBranch, cvrfFileList, componentMap, curDate, branchList, branchFlag) + BuildDocumentRef(cvrfsa, v, componentMap, branchFlag, affectBranch) + BuildProductTree(cvrfsa, v, pkg, affectBranch, branchFlag) + BuildVulnerabilitySet(cvrfsa, v, affectBranch, componentMap, branchFlag) } -func QueryCveMd5(cveNum []string, OwnedComponent, openEulerSANum string, fixFlag int8) bool { +func QueryCveMd5(cveNum []string, OwnedComponent, openEulerSANum string, fixFlag int8) (bool, string) { sort.Strings(cveNum) + tmpOpenEulerSANum := "" cveStr := strings.Join(cveNum, ",") cveStrx := cveStr + "," + OwnedComponent fileMd5 := common.EncryptMd5(cveStrx) @@ -1139,7 +1195,21 @@ func QueryCveMd5(cveNum []string, OwnedComponent, openEulerSANum string, fixFlag cfr.Md5 = fileMd5 tbErr := models.GetCvrfRecord(&cfr, "cur_md5") if tbErr == nil { - return true + tmpOpenEulerSANum = cfr.OpenEulerSANum + cfr.UpdateTime = common.GetCurTime() + cfr.Md5 = fileMd5 + cfr.OpenEulerSANum = openEulerSANum + cfr.Status = 1 + cfr.IsExport = 1 + cfr.CveNum = cveStr + cfr.PackName = OwnedComponent + cfr.AffectFlag = fixFlag + updateErr := models.UpdateCvrfRecord(&cfr, "UpdateTime", + "OpenEulerSANum", "Status", "IsExport", "CveNum", "PackName", "AffectFlag") + if updateErr != nil { + logs.Error("UpdateCvrfRecord, ", updateErr) + } + return true, tmpOpenEulerSANum } else { cfr.CreateTime = common.GetCurTime() cfr.Md5 = fileMd5 @@ -1153,7 +1223,7 @@ func QueryCveMd5(cveNum []string, OwnedComponent, openEulerSANum string, fixFlag if iErr != nil || num == 0 { logs.Error("InsertCvrfRecord, ", iErr) } - return false + return false, tmpOpenEulerSANum } } diff --git a/taskhandler/excel.go b/taskhandler/excel.go index bfd875ed2d8e051d881a4dfd6d7a9fd5f23c6145..053c20cb0dfd15a329fa7e6463fb5ddc644de6ae 100644 --- a/taskhandler/excel.go +++ b/taskhandler/excel.go @@ -516,6 +516,7 @@ func procUnaffectCvrfData(v models.ExcelExport, affectBranch string, cvrfFileList map[string][]string, componentMap map[string]ComponentInfo) { fileDir := beego.AppConfig.String("fileDir") + common.CreateDir(fileDir) cvrffileName := filepath.Join(fileDir, "cvrf-unaffected-cve-"+common.GetCurDate()+".xml") cvrfFileSlice, cvrfOk := cvrfFileList[UNAFFECTCVRFKEY] if cvrfOk && len(cvrfFileSlice) > 0 { @@ -544,6 +545,7 @@ func (ec *CveExcel) handleWriteContentSync(list []models.ExcelExport, lz := len(list) if lz > 0 { for _, v := range list { + logs.Info("handleWriteContentSync, v====>", v) if v.OrganizateId == 2 { logs.Error("opengauss, data: ", v) continue @@ -716,13 +718,14 @@ func StoreComponentInfo(componentMap map[string]ComponentInfo, repFlag := false influenceComponent := "" fileDir := beego.AppConfig.String("fileDir") + common.CreateDir(fileDir) if len(v.InfluenceComponent) > 1 { influenceComponent = v.InfluenceComponent } else { influenceComponent = v.OwnedComponent } packNameStruct, pOk := componentMap[influenceComponent] - if !pOk && len(packNameStruct.OpenEulerSANum) < 1 { + if !pOk || len(packNameStruct.OpenEulerSANum) < 3 { var coponentInfo ComponentInfo openEulerSANum := GetOpenEulerSaNum() if openEulerSANum == "" { @@ -746,6 +749,7 @@ func StoreComponentInfo(componentMap map[string]ComponentInfo, brachCveInfo.OpenEulerSANum = openEulerSANum1 brachCveInfo.CvrfFileName = filepath.Join(fileDir, "cvrf-"+openEulerSANum1+".xml") brachCveInfo.CveNumSlice = cveNumSlice + brachCveInfo.OpenEulerScore = openEulerScoreSlice branchCve[affectBranch] = brachCveInfo coponentInfo.CveNumMap = branchCve coponentInfo.CveNum = cveNumSlice @@ -776,7 +780,8 @@ func StoreComponentInfo(componentMap map[string]ComponentInfo, if branchCvex, brOk := packNameStruct.CveNumMap[affectBranch]; !brOk { cveNumSlice := make([]string, 0) cveNumSlice = append(cveNumSlice, v.CveNum) - branchCve := make(map[string]BrachCveInfo) + openEulerScoreSlice := make([]float64, 0) + openEulerScoreSlice = append(openEulerScoreSlice, v.OpenEulerScore) var brachCveInfo BrachCveInfo openEulerSANum1 := GetOpenEulerSaNum() if openEulerSANum1 == "" { @@ -785,8 +790,8 @@ func StoreComponentInfo(componentMap map[string]ComponentInfo, brachCveInfo.OpenEulerSANum = openEulerSANum1 brachCveInfo.CvrfFileName = filepath.Join(fileDir, "cvrf-"+openEulerSANum1+".xml") brachCveInfo.CveNumSlice = cveNumSlice - branchCve[affectBranch] = brachCveInfo - packNameStruct.CveNumMap = branchCve + brachCveInfo.OpenEulerScore = openEulerScoreSlice + packNameStruct.CveNumMap[affectBranch] = brachCveInfo } else { for _, cve := range branchCvex.CveNumSlice { if cve == v.CveNum { @@ -796,6 +801,7 @@ func StoreComponentInfo(componentMap map[string]ComponentInfo, } if !repFlag { branchCvex.CveNumSlice = append(branchCvex.CveNumSlice, v.CveNum) + branchCvex.OpenEulerScore = append(branchCvex.OpenEulerScore, v.OpenEulerScore) packNameStruct.CveNumMap[affectBranch] = branchCvex } } @@ -803,6 +809,8 @@ func StoreComponentInfo(componentMap map[string]ComponentInfo, branchCve := make(map[string]BrachCveInfo) cveNumSlice := make([]string, 0) cveNumSlice = append(cveNumSlice, v.CveNum) + openEulerScoreSlice := make([]float64, 0) + openEulerScoreSlice = append(openEulerScoreSlice, v.OpenEulerScore) var brachCveInfo BrachCveInfo openEulerSANum1 := GetOpenEulerSaNum() if openEulerSANum1 == "" { @@ -811,6 +819,7 @@ func StoreComponentInfo(componentMap map[string]ComponentInfo, brachCveInfo.OpenEulerSANum = openEulerSANum1 brachCveInfo.CvrfFileName = filepath.Join(fileDir, "cvrf-"+openEulerSANum1+".xml") brachCveInfo.CveNumSlice = cveNumSlice + brachCveInfo.OpenEulerScore = openEulerScoreSlice branchCve[affectBranch] = brachCveInfo packNameStruct.CveNumMap = branchCve } @@ -868,10 +877,12 @@ func BranchCvrfData(v models.ExcelExport, componentMap[v.InfluenceComponent] = componentInfo } } - BuildCvrfXml(&cvrfsa, v, affectBranch, cvrfFileList, componentMap, pkg) + BuildCvrfXml(&cvrfsa, v, affectBranch, cvrfFileList, componentMap, pkg, branchFlag) cvfrFileMap[cvrffileName] = cvrfsa + logs.Info("xxxx1====>", cvrfsa, v, affectBranch, cvrfFileList, componentMap, pkg) } else { - BuildCvrfXml(&branchCvrfSaStruct, v, affectBranch, cvrfFileList, componentMap, pkg) + BuildCvrfXml(&branchCvrfSaStruct, v, affectBranch, cvrfFileList, componentMap, pkg, branchFlag) + logs.Info("xxxx2====>", branchCvrfSaStruct, v, affectBranch, cvrfFileList, componentMap, pkg) cvfrFileMap[cvrffileName] = branchCvrfSaStruct } saveCvrfName(cvrfFileList, cvrffileName, CVRFFKEY) @@ -1080,7 +1091,9 @@ func ExtractPackageData(lp string) (pkgList []models.ExcelPackage, err error) { } else if err != nil { return pkgList, err } - pkgList = append(pkgList, models.ExcelPackage{PubTime: line[0], Repo: line[1], Packages: line[2]}) + if len(line) >= 3 && len(line[0]) > 3 { + pkgList = append(pkgList, models.ExcelPackage{PubTime: line[0], Repo: line[1], Packages: line[2]}) + } } return } @@ -1098,6 +1111,7 @@ func getDateByGite(pkgList []models.ExcelPackage, startTime string, c chan<- []I st := util.TimeStrToInt(startTime, "2006-01-02") chData := make([]IssueAndPkg, 0) for _, v := range pkgList { + logs.Info("excel, v===>", v) rt := util.TimeStrToInt(v.PubTime, "20060102 15-04-05") + saTimeStampZone // 查询当前需要处理的issue issueTemp, err := models.GetIssueNumber(v.Repo) @@ -1130,6 +1144,7 @@ func (ec *CveExcel) handleGiteData(c <-chan []IssueAndPkg, affectBranch string, data := <-c var pkgList []string for _, v := range data { + logs.Info("v====>", v) //parse package string to list pkgList = strings.Split(v.IssuePkg, " ") if len(pkgList) == 0 { @@ -1206,7 +1221,7 @@ func getRepoIssueAllPR(affectBranch, token, owner, repo string, startTime, mt := util.TimeStrToInt(closedAt[:19], "2006-01-02T15:04:05") mergedAt := v["merged_at"].(string) ct := util.TimeStrToInt(mergedAt[:19], "2006-01-02T15:04:05") - //logs.Info("******, pr: ", v, ",mt: ", mt, ", startTime: ", startTime, ",releaseTime: ", releaseTime, ":ct:", ct) + logs.Info("******, pr: ", v, ",mt: ", mt, ", startTime: ", startTime, ",releaseTime: ", releaseTime, ":ct:", ct, ",repo:", repo) //ct := v["merged_at"].(string).(time.Time).Local().Unix() var pt int64 if mt > 0 && ct > 0 { @@ -1227,6 +1242,7 @@ func getRepoIssueAllPR(affectBranch, token, owner, repo string, startTime, pr.CveNumber = isTemp.CveNum pr.Repo = repo prList = append(prList, pr) + logs.Info("prList====>", prList) } } } diff --git a/taskhandler/issuestatistics.go b/taskhandler/issuestatistics.go index 27c852859b3375f98cfeee17ac08a7a06621bebb..67587284b70bc1862a84f0d00e437fe7f7f70027 100644 --- a/taskhandler/issuestatistics.go +++ b/taskhandler/issuestatistics.go @@ -29,6 +29,7 @@ func GetIssueData(beforeDate, prcnum int, templateId int64) ([]models.IssueTempl func createExcel() (string, string) { // File storage directory dir := beego.AppConfig.String("fileDir") + common.CreateDir(dir) excelName := "CVE_ISSUE_" + common.GetCurDate() + ".xlsx" excelPath := filepath.Join(dir, excelName) xlsx := excelize.NewFile() @@ -58,6 +59,7 @@ func createExcel() (string, string) { func CveCredExcel() (string, string) { // File storage directory dir := beego.AppConfig.String("fileDir") + common.CreateDir(dir) excelName := "CVE_Low_Credibility_" + common.GetCurDate() + ".xlsx" excelPath := filepath.Join(dir, excelName) xlsx := excelize.NewFile() @@ -93,7 +95,7 @@ func procCredData(org models.OriginUpstream, desc models.OriginUpstreamDesc) []i func ReadWriteExcel(excelPath, owner string, iss []models.IssueTemplate, is *IssueStr) (int64, error) { file, openErr := excelize.OpenFile(excelPath) if openErr != nil { - logs.Error("fail to open the file, ", excelPath) + logs.Error("fail to open the file, excelPath: ", excelPath, ", openErr: ", openErr) return iss[len(iss)-1].TemplateId, openErr } var templateId = int64(0) diff --git a/taskhandler/sendemail.go b/taskhandler/sendemail.go index 5c6623e4d29544389038e1826529454f26f85de7..569756518c498b423e9caa8bc28be1d7d6e8ed26 100644 --- a/taskhandler/sendemail.go +++ b/taskhandler/sendemail.go @@ -61,6 +61,11 @@ func ZipFiles(filename string, files []string, oldform, newform string) error { zipWriter := zip.NewWriter(newZipFile) defer zipWriter.Close() for _, file := range files { + fisExist, _ := PathExists(file) + if !fisExist { + logs.Error("ZipFiles, not exist, file: ", file) + continue + } zipfile, err := os.Open(file) if err != nil { return err @@ -108,12 +113,12 @@ func SendEmail(attchStr string, flag int, cBody, subject string) error { mail = &SendMail{user: emailName, password: emailPwd, host: emailHost, port: emailPort} if flag == 1 { message := Message{from: emailName, - to: toEmailName, - cc: []string{}, - bcc: []string{}, - subject: "The file name of the cvrf format currently to be manually reviewed is as follows.date: " + common.GetCurTime(), - body: fmt.Sprintf("hi all: \r\n The list of cvrf format files that have been " + - "uploaded to the file server is as follows: \r\n" + strings.ReplaceAll(attchStr,"download/", "")), + to: toEmailName, + cc: []string{}, + bcc: []string{}, + subject: "The file name of the cvrf format currently to be manually reviewed is as follows.date: " + common.GetCurTime(), + body: fmt.Sprintf("hi all: \r\n The list of cvrf format files that have been " + + "uploaded to the file server is as follows: \r\n" + strings.ReplaceAll(attchStr, "download/", "")), contentType: "text/plain;charset=utf-8", attachment: Attachment{ name: attchStr, diff --git a/util/http.go b/util/http.go index c94762e3bbd0600ba8df4e9b48d653207fa4327d..fc8d02378fe39f0834d7daac6eac272ba788fd07 100644 --- a/util/http.go +++ b/util/http.go @@ -195,7 +195,6 @@ func HTTPGet(url string) ([]map[string]interface{}, error) { //HTTPGetCom common get request func HTTPGetCom(urls string) ([]byte, error) { - logs.Info("httpgetcom: ", urls) resp, err := http.Get(urls) if err != nil { logs.Error("get error, url:", urls, "error: ", err)