Skip to content

Commit

Permalink
[bug] timestamp-UTC
Browse files Browse the repository at this point in the history
Signed-off-by: desmax74 <[email protected]>
  • Loading branch information
desmax74 committed Oct 24, 2023
1 parent f10b27a commit 4ce042e
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pkg/assembler/backends/arangodb/certifyVuln.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func setCertifyVulnMatchValues(arangoQueryBuilder *arangoQueryBuilder, certifyVu
}
if certifyVulnSpec.TimeScanned != nil {
arangoQueryBuilder.filter("certifyVuln", timeScannedStr, "==", "@"+timeScannedStr)
queryValues[timeScannedStr] = certifyVulnSpec.TimeScanned.UTC()
queryValues[timeScannedStr] = certifyVulnSpec.TimeScanned
}
if certifyVulnSpec.DbURI != nil {
arangoQueryBuilder.filter("certifyVuln", dbUriStr, "==", "@"+dbUriStr)
Expand Down
2 changes: 1 addition & 1 deletion pkg/assembler/backends/ent/backend/scorecard.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func toModelScorecard(record *ent.Scorecard) *model.Scorecard {
return &model.Scorecard{
Checks: record.Checks,
AggregateScore: record.AggregateScore,
TimeScanned: record.TimeScanned,
TimeScanned: record.TimeScanned.UTC(),
ScorecardVersion: record.ScorecardVersion,
ScorecardCommit: record.ScorecardCommit,
Origin: record.Origin,
Expand Down
2 changes: 1 addition & 1 deletion pkg/assembler/backends/ent/certifylegal.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/assembler/backends/ent/certifylegal_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/assembler/backends/ent/certifylegal_update.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/assembler/backends/ent/certifyvuln.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/assembler/backends/ent/certifyvuln_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/assembler/backends/ent/scorecard_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/assembler/backends/ent/scorecard_update.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/ingestor/parser/csaf/parser_csaf.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func (c *csafParser) GetPredicates(ctx context.Context) *assembler.IngestPredica

if status == "known_affected" || status == "under_investigation" {
vulnData := generated.ScanMetadataInput{
TimeScanned: c.csaf.Document.Tracking.CurrentReleaseDate,
TimeScanned: c.csaf.Document.Tracking.CurrentReleaseDate.UTC(),
}
cv := assembler.CertifyVulnIngest{
Pkg: vi.Pkg,
Expand All @@ -303,7 +303,7 @@ func (c *csafParser) GetPredicates(ctx context.Context) *assembler.IngestPredica
cvs = append(cvs, cv)
} else if status == "known_not_affected" || status == "fixed" {
vulnData := generated.ScanMetadataInput{
TimeScanned: c.csaf.Document.Tracking.CurrentReleaseDate,
TimeScanned: c.csaf.Document.Tracking.CurrentReleaseDate.UTC(),
}
noVuln := generated.VulnerabilityInputSpec{
Type: "NoVuln",
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingestor/parser/cyclonedx/parser_cyclonedx.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func (c *cyclonedxParser) getVulnerabilities(ctx context.Context) error {
cv := assembler.CertifyVulnIngest{
Vulnerability: vuln,
VulnData: &model.ScanMetadataInput{
TimeScanned: publishedTime,
TimeScanned: publishedTime.UTC(),
},
Pkg: v.Pkg,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingestor/parser/open_vex/parser_open_vex.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (c *openVEXParser) Parse(ctx context.Context, doc *processor.Document) erro

if s.Status == vex.StatusAffected || s.Status == vex.StatusUnderInvestigation {
vulnData := generated.ScanMetadataInput{
TimeScanned: *openVex.Metadata.Timestamp,
TimeScanned: openVex.Metadata.Timestamp.UTC(),
}
cv := assembler.CertifyVulnIngest{
Pkg: ingest.Pkg,
Expand Down
1 change: 1 addition & 0 deletions pkg/ingestor/parser/scorecard/parser_scorecard.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func (p *scorecardParser) getPredicates(s *sc.JSONScorecardResultV2) error {
return err
}
}
timeScanned = timeScanned.UTC()

p.vcsStrings = append(p.vcsStrings, s.Repo.Name)
p.srcPredicates = append(p.srcPredicates, &model.SourceInputSpec{
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingestor/parser/vuln/vuln.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func parseSubject(s *attestation_vuln.VulnerabilityStatement) ([]*generated.PkgI

func parseMetadata(s *attestation_vuln.VulnerabilityStatement) *generated.ScanMetadataInput {
return &generated.ScanMetadataInput{
TimeScanned: *s.Predicate.Metadata.ScannedOn,
TimeScanned: s.Predicate.Metadata.ScannedOn.UTC(),
DbUri: s.Predicate.Scanner.Database.Uri,
DbVersion: s.Predicate.Scanner.Database.Version,
ScannerUri: s.Predicate.Scanner.Uri,
Expand Down

0 comments on commit 4ce042e

Please sign in to comment.