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

tenable_sc: add tenable_sc.vulnerability.age field #7210

Merged
merged 1 commit into from Aug 2, 2023

Conversation

efd6
Copy link
Contributor

@efd6 efd6 commented Aug 1, 2023

What does this PR do?

Retains a calculated vulnerability age in days from the first and last seen dates.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@elasticmachine
Copy link

elasticmachine commented Aug 1, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-08-02T01:03:31.053+0000

  • Duration: 20 min 31 sec

Test stats 🧪

Test Results
Failed 0
Passed 19
Skipped 0
Total 19

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Retain a calculated vulnerability age in days from the first and last
seen dates.
@elasticmachine
Copy link

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (3/3) 💚
Files 100.0% (3/3) 💚 5.0
Classes 100.0% (3/3) 💚 5.0
Methods 100.0% (45/45) 💚 12.923
Lines 96.978% (1123/1158) 👍 10.715
Conditionals 100.0% (0/0) 💚

@efd6 efd6 marked this pull request as ready for review August 2, 2023 01:42
@efd6 efd6 requested a review from a team as a code owner August 2, 2023 01:42
@elasticmachine
Copy link

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

Copy link
Contributor

@chemamartinez chemamartinez left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@chrisberkhout chrisberkhout left a comment

Choose a reason for hiding this comment

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

Looks good!

For me it is counterintuitive that a vulnerability doesn't "age" unless it continues to be seen. I might have called it "exposure_duration" or "days_observed" or something. However, "age" was requested by someone who knows Tenable SC and the domain better than I do so I assume it'll be fine. Also the field description is clear.

@chemamartinez
Copy link
Contributor

For me it is counterintuitive that a vulnerability doesn't "age" unless it continues to be seen. I might have called it "exposure_duration" or "days_observed" or something. However, "age" was requested by someone who knows Tenable SC and the domain better than I do so I assume it'll be fine. Also the field description is clear.

Probably when this event arises it is because the vulnerability was detected in the last scan performed, so in theory it would still exist.

@efd6
Copy link
Contributor Author

efd6 commented Aug 2, 2023

@jgreene-TrappTech Are you able to comment on the concerns above?

@jgreene-TrappTech
Copy link

jgreene-TrappTech commented Aug 2, 2023

Certainly. We have no attachment to age vs duration or another field. All that we seek is to have this as a calculated field via the pipeline so that we are not modifying the default pipelines or adding to them.

Typically, Vulnerability SLA's mandate that after a vulnerability is discovered, the product owner has N number of days to remediate. So the selection of age or vulnerability.age was derived from that language. As the SLA's vary between compliance initiatives, we simply represent days between first and last seen in the end user's reporting.

Currently we are using tenable_sc.vulnerability.age as a positive integer to indicate the time in days since first_seen and last_seen.

Hope that helps.

@efd6
Copy link
Contributor Author

efd6 commented Aug 2, 2023

Thanks, the second part of the concern is whether events ever come through without a last seen, but with a first seen. Is this ever the case?

For the language and unit choice, I think days is the best given that it matches other fields in the tenable documents.

@jgreene-TrappTech
Copy link

jgreene-TrappTech commented Aug 2, 2023

First time seen and last time seen appear to be in every tenable_sc.vulnerability document. Where the vulnerability is seen for the first time, the first and last time seen are set to the time that the scan was completed. In a one week look back for one data_stream.namespace there were 4,260,444 hits and zero documents without both last_seen and first_seen populated.

Here is an example:

image

@efd6
Copy link
Contributor Author

efd6 commented Aug 2, 2023

Thanks

@efd6 efd6 merged commit 76ef9c1 into elastic:main Aug 2, 2023
4 checks passed
@elasticmachine
Copy link

Package tenable_sc - 1.13.0 containing this change is available at https://epr.elastic.co/search?package=tenable_sc

1 similar comment
@elasticmachine
Copy link

Package tenable_sc - 1.13.0 containing this change is available at https://epr.elastic.co/search?package=tenable_sc

gizas pushed a commit that referenced this pull request Sep 5, 2023
Retain a calculated vulnerability age in days calculated from the first and
last seen dates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tenable SC (vulnerability) pipeline feature request: tenable_sc.vulnerability.age
5 participants