This commit is contained in:
knqyf263 2019-07-27 09:08:36 +09:00
parent d8aefa6015
commit 085755aea4
2 changed files with 68 additions and 48 deletions

View File

@ -19,9 +19,13 @@ stages:
- 'Debian OVAL'
- 'Ubuntu CVE Tracker'
- 'Red Hat Security Data API 2019-2020'
- 'Red Hat Security Data API 2017-2018'
- 'Red Hat Security Data API 2015-2016'
- 'Red Hat Security Data API 2012-2014'
- 'Red Hat Security Data API 2018'
- 'Red Hat Security Data API 2017'
- 'Red Hat Security Data API 2016'
- 'Red Hat Security Data API 2015'
- 'Red Hat Security Data API 2014'
- 'Red Hat Security Data API 2013'
- 'Red Hat Security Data API 2012'
- 'Red Hat Security Data API 2009-2011'
- 'Red Hat Security Data API 2003-2008'
- 'Red Hat Security Data API 1996-2002'
@ -66,18 +70,34 @@ jobs:
if: type = cron
script:
- go run main.go -target redhat -years 2009,2010,2011
- stage: 'Red Hat Security Data API 2012-2014'
- stage: 'Red Hat Security Data API 2012'
if: type = cron
script:
- go run main.go -target redhat -years 2012,2013,2014
- stage: 'Red Hat Security Data API 2015-2016'
- go run main.go -target redhat -years 2012
- stage: 'Red Hat Security Data API 2013'
if: type = cron
script:
- go run main.go -target redhat -years 2015,2016
- stage: 'Red Hat Security Data API 2017-2018'
- go run main.go -target redhat -years 2013
- stage: 'Red Hat Security Data API 2014'
if: type = cron
script:
- go run main.go -target redhat -years 2017,2018
- go run main.go -target redhat -years 2014
- stage: 'Red Hat Security Data API 2015'
if: type = cron
script:
- go run main.go -target redhat -years 2015
- stage: 'Red Hat Security Data API 2016'
if: type = cron
script:
- go run main.go -target redhat -years 2016
- stage: 'Red Hat Security Data API 2017'
if: type = cron
script:
- go run main.go -target redhat -years 2017
- stage: 'Red Hat Security Data API 2018'
if: type = cron
script:
- go run main.go -target redhat -years 2018
- stage: 'Red Hat Security Data API 2019-2020'
if: type = cron
script:

View File

@ -52,45 +52,45 @@ func Update() (err error) {
return xerrors.Errorf("failed to clone alpine repository: %w", err)
}
lastUpdated, err := utils.GetLastUpdatedDate(dist)
if err != nil {
return xerrors.Errorf("failed to get last updated date: %w", err)
}
log.Println("Fetching Alpine Security Issues...")
var issueURLs []string
for _, statusID := range []int{3, 5} {
for page := 1; ; page++ {
log.Printf("status_id: %d, page %d\n", statusID, page)
url := constructListURL(statusID, page, lastUpdated)
res, err := utils.FetchURL(url, "", retry)
if err != nil {
return xerrors.Errorf("failed to fetch Alpine issues: %w", err)
}
tracker := IssueList{}
if err = json.Unmarshal(res, &tracker); err != nil {
return err
}
if len(tracker.Issues) == 0 {
break
}
for _, issue := range tracker.Issues {
if strings.Index(issue.Subject, "(") < 0 {
continue
}
issueURLs = append(issueURLs, constructDetailURL(issue.ID))
}
}
}
if len(issueURLs) == 0 {
log.Println("No updated issue")
} else {
if err = retrieveIssue(issueURLs); err != nil {
return err
}
}
//lastUpdated, err := utils.GetLastUpdatedDate(dist)
//if err != nil {
// return xerrors.Errorf("failed to get last updated date: %w", err)
//}
//
//log.Println("Fetching Alpine Security Issues...")
//var issueURLs []string
//for _, statusID := range []int{3, 5} {
// for page := 1; ; page++ {
// log.Printf("status_id: %d, page %d\n", statusID, page)
// url := constructListURL(statusID, page, lastUpdated)
// res, err := utils.FetchURL(url, "", retry)
// if err != nil {
// return xerrors.Errorf("failed to fetch Alpine issues: %w", err)
// }
// tracker := IssueList{}
// if err = json.Unmarshal(res, &tracker); err != nil {
// return err
// }
// if len(tracker.Issues) == 0 {
// break
// }
//
// for _, issue := range tracker.Issues {
// if strings.Index(issue.Subject, "(") < 0 {
// continue
// }
// issueURLs = append(issueURLs, constructDetailURL(issue.ID))
// }
// }
//}
//
//if len(issueURLs) == 0 {
// log.Println("No updated issue")
//} else {
// if err = retrieveIssue(issueURLs); err != nil {
// return err
// }
//}
// Extract secfixes in all APKBUILD
log.Println("Extracting Alpine secfixes...")