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

Manually created facts not recognized by requirements #3149

Open
gitonglue opened this issue Mar 4, 2025 · 2 comments
Open

Manually created facts not recognized by requirements #3149

gitonglue opened this issue Mar 4, 2025 · 2 comments
Assignees
Labels

Comments

@gitonglue
Copy link

Describe the bug
When using plugins.stockpile.app.requirements.paw_provenance to verify if the specified variable exists in source facts, it does not recognize manually created fact. It results in two unexpected behavior.

1st unexpected behavior – marking fact as not collected, despite there is a fact created

  • nmap.targets is defined in fact source
    Image
  • Adversary profile still warn nmap.targets is not collected
    Image

2nd unexpected behavior - Adversary operation does not run

  • the ability never runs in operation. indicated by 0 decision | 4 min ago
    Image

To Reproduce
Steps to reproduce the behavior:

  1. Create new fact source which set nmap.targets to 127.0.0.1
    Image

  2. Create an ability which run nmap commands with fact-defined targets
    Image

  3. Create a Linux executor inside the ability with requirement to verify nmap.targets exists

  • command: nmap -T4 -Pn #{nmap.targets}
  • requirement module: plugins.stockpile.app.requirements.paw_provenance
  • requirement source: nmap.targets
    Image
  1. Create an Adversary that uses the created ability
    Image

  2. Refresh the page and select the newly created Adversary again

  • A warning is shown One or more of the abilities have unmet requirements, which may result in a failed operation if ran sequentially.. However, the fact is actually created in step 1

Image

  1. Proceed to create operation with the adversary created in step 4
  • Adversary: name of the adversary profile created in step 4
  • Fact source: name of the fact source created in step 1
    Image
  1. Let the operation runs for a few minutes. There will not be any ability run
  • the ability never runs in operation. indicated by 0 decision | 4 min ago
    Image

Expected behavior
Two expectation

1st expectation - no warning in Adversary profile

  • If the variable can be located in any fact sources, it should not throw warning

2nd expectation – ability successfully run in operation

  • Since the variable is retrievable from the selected fact source, it should be able to run

  • Secondly, if we manually select potential link, it can actually show the variable.

Image

Desktop (please complete the following information):

  • OS: MacOS Sonoma 14.3.1
  • Browser: Firefox, Chrome

Backend

  • Caldera version
    git rev-parse HEAD: 6d3d853
  • OS: Ubuntu 24.04.2 LTS
Copy link

github-actions bot commented Mar 4, 2025

Looks like your first issue -- we aim to respond to issues as quickly as possible. In the meantime, check out our documentation here: http://caldera.readthedocs.io/

@gitonglue
Copy link
Author

gitonglue commented Mar 4, 2025

Apologies for the issue submission — I overlooked the manual and didn’t fully understand the purpose of plugins.stockpile.app.requirements.paw_provenance. This module verifies that an agent has collected facts itself before execution; any fact not collected by the agent is not considered fulfilled.

I plan to submit a separate PR to Stockpile for enabling a plugin that checks whether a variable is not null. So far, I haven’t found an existing plugin that does this. If one already exists, please let me know so I can avoid re-inventing the wheel.

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants