-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
User-defined variables are not replaced when Global Variables are used #3030
Comments
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/ |
This issue is related to another issue (or inconvenience, maybe?) - if values aren't supplied for all fact templates in an ability, then none of the values are substituted in. Depending on when/how the global facts are inserted, both of these issues could have the same solution. I suggest that the default behavior should be: any provided values should be substituted for the relevant fact template, regardless if values have been provided for all fact templates. To Reproduce Related Issue:
|
Right now, the only way to work with this 'inconvenience' is to supply all the related global variables with a value when executing the ability in an operation. E.g. for the variable #{server} you will give a value of "http://<server address>:8888" instead of leaving it blank. However, if we are to use the #{origin_link_id} for lateral movement, the link id is generated on-the-fly, and we won't know the link_id beforehand. So we won't be able to supply a value for it. P.S. realise the issue is lying on the frontend of the operations page. Sending a POST request to Caldera via curl/request does not have any such issues. |
Yikes, yea this an annoying 'inconvenience'. Looking at PR on magma repo from @d3vco now. |
merged @d3vco's fix. Reopen if still having problems. |
Describe the bug
User-defined variables are not populated when global variables are used in the ability execution inside an operation.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The command has an obfuscated and a plaintext version of the commands, with the command in obfuscated having the origin_link_id but the plaintext does not. The user-defined abilities are not defined in both cases.
Screenshots
Desktop (please complete the following information):
Additional context
In my screenshot, I am running my own custom ability. But the best default ability that fits this bug scenario is "Service Creation". The only user-defined ability is #{remote.host.fqdn} so recommended to modify it to add additional variables to make the reproduction realistic.
The text was updated successfully, but these errors were encountered: