Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert "severity_date" value to seconds since epoch #412

Merged
merged 2 commits into from
Oct 21, 2020

Conversation

jjnicola
Copy link
Member

What:
The tag names "severity_date" is treated special

Why:
For consistency, the severity_date date format value is the same as for creation_date and last_modification. Internally is expected to be a seconds since epoch value.

How:
Add the following tags to a script

  script_tag(name:"severity_vector", value:"CVSS:3.0/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:L");
  script_tag(name:"severity_origin", value:"greenbone");
  script_tag(name:"severity_date", value:"2009-03-26 19:23:59 +0100 (Thu, 26 Mar 2009)");

Check in redis cache, that the severity date for the modified script is seconds since epoch.

redis /tmp/redis.sock[1]> lrange nvt:1.3.6.1.4.1.25623.1.0.100081 0 -1
 1) "auth_enabled.nasl"
 2) ""
 3) ""
 4) ""
 5) ""
 6) "Services/auth, 113"
 7) "find_service.nasl"
 8) "last_modification=1549632112|creation_date=1238091839|cvss_base_vector=AV:N/AC:L/Au:N/C:P/I:N/A:N|severity_vector=CVSS:3.0/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:L|severity_origin=greenbone|severity_date=1238091839|summary=The remote host is running an ident daemon.\n\n  The Ident Protocol is designed to work as a server daemon, on a user's\n  comp

Checklist:

@jjnicola jjnicola requested a review from mattmundell as a code owner October 21, 2020 12:02
@jjnicola jjnicola changed the title Convert "severity_date" value seconds since epoch Convert "severity_date" value to seconds since epoch Oct 21, 2020
@mattmundell mattmundell self-requested a review October 21, 2020 12:06
Copy link
Contributor

@mattmundell mattmundell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine except for the little formatting issue.

@jjnicola jjnicola requested a review from mattmundell October 21, 2020 12:17
@mattmundell mattmundell merged commit f37f1a5 into greenbone:master Oct 21, 2020
@jjnicola jjnicola deleted the severity-date-format branch October 21, 2020 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants