Skip to content

Conversation

DJensen94
Copy link
Contributor

update risky host calculation to not use views

🗣 Description

Previously the vuln scan summary risky host dictionary was created using the materialized view to identify the domain_id. This PR calculates the id without referencing the view so the summary can run independently.

The Summary now references the tickets ip_id and then checks to see if there is a linked domain via the ips_subs table, if there is it will pass the domains id

💭 Motivation and context

This will allow us to parallelize view and summary creation, speeding up our VS data ingestion significantly

🧪 Testing

Tested locally with various differen scenarios: no domains, one domain, many domains. Through these tests I ensured that the vuln scan domain id matches the materialized view domain_id ensuring linking will be maintainted.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

update risky host calculation to not use views
@DJensen94 DJensen94 changed the title Update Vuln Scan Summary to not use any views Update Vuln Scan Summary to not use any views: CRASM-3170 Sep 26, 2025
@aloftus23 aloftus23 marked this pull request as ready for review September 29, 2025 14:11
Copy link
Contributor

@Matthew-Grayson Matthew-Grayson left a comment

Choose a reason for hiding this comment

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

Looks clean

Copy link
Collaborator

@rapidray12 rapidray12 left a comment

Choose a reason for hiding this comment

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

I think we need to get away from using embedded strings strewn throughout the code and use "STRING CONSTANTS" instead

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.

4 participants