Skip to content

Add paw to existing Fact only if Fact wasn't used in Link command#2432

Merged
mchan143 merged 3 commits into
masterfrom
seeded-fact-bug
Jan 7, 2022
Merged

Add paw to existing Fact only if Fact wasn't used in Link command#2432
mchan143 merged 3 commits into
masterfrom
seeded-fact-bug

Conversation

@mchan143
Copy link
Copy Markdown
Contributor

@mchan143 mchan143 commented Jan 6, 2022

Description

Follow up bug fix to #2397. This change proposes that paws are only added to a Fact's collected_by if they were not used in the command, which resolves the issue when relationships are created for seeded facts and seeded facts go through the save_fact process. Seeded facts should not be updated to show they have been collected by an agent if they were only used in the command.

The proposed change also resolves the scenario where an operation started with a seeded fact (say domain.user.name) and further discovery actions by an agent led to the re-discovery of the same fact. The paw will be added to a Fact's collected_by in this case.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Ran an operation against two agents that used seeded facts and learned facts. Ensured that the agent paws were not added to the seeded facts' collected_by.
  • Added a test for the scenario mentioned above

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • [N/A] I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@mchan143 mchan143 added the bug Indicates an unexpected problem or unintended behavior label Jan 6, 2022
Copy link
Copy Markdown
Contributor

@ArtificialErmine ArtificialErmine left a comment

Choose a reason for hiding this comment

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

LGTM, nice use of the existing data structures to filter out what already has been processed.

Copy link
Copy Markdown
Contributor

@cmagone cmagone left a comment

Choose a reason for hiding this comment

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

LGTM

@mchan143
Copy link
Copy Markdown
Contributor Author

mchan143 commented Jan 7, 2022

@cmagone if all looks good, I can merge once you approve the proposed changes. Thanks!

Copy link
Copy Markdown
Contributor

@cmagone cmagone left a comment

Choose a reason for hiding this comment

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

I re-ran the check workflow because one failed, but it was an artifact of the test, not a problem with the code.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jan 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@mchan143 mchan143 merged commit 8719bcb into master Jan 7, 2022
@mchan143 mchan143 deleted the seeded-fact-bug branch January 7, 2022 18:37
navnitan-7 added a commit to navnitan-7/caldera that referenced this pull request Mar 30, 2026
Mirror upstream jQuery apachegh-2432 fix in vendored ajaxConvert: skip automatic
script conversion on cross-domain responses unless dataType was explicit.

Refs: jquery/jquery@2546bb3
Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Indicates an unexpected problem or unintended behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants