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

⭐ wire data queries to controls #841

Merged
merged 6 commits into from
Oct 18, 2023
Merged

Conversation

arlimus
Copy link
Member

@arlimus arlimus commented Oct 15, 2023

This creates the internal wiring to collect data queries for controls. It connects each datapoint that a query produces to all the reporting job of the control that it is mapped to.

Follow-up: I noticed that we don't do a decent job on printing just yet, e.g. we only print if a control passes or fails bound to its score. That's why there isn't a good place to add datapoints yet, considering we already print all data that is executed for a policy. Definitely looking to improve the CLI experience.

@tas50 @jaym @preslavgerchev

This creates the internal wiring to collect data queries for controls.
It connects each datapoint that a query produces to all the reporting
job of the control that it is mapped to.

Follow-up: I noticed that we don't do a decent job on printing just yet,
e.g. we only print if a control passes or fails bound to its score.
That's why there isn't a good place to add datapoints yet, considering
we already print all data that is executed for a policy. Definitely
looking to improve the CLI experience.

Signed-off-by: Dominik Richter <[email protected]>
@arlimus arlimus force-pushed the dom/control-query-map branch from 945498d to fd68be6 Compare October 16, 2023 00:47
Copy link
Contributor

@jaym jaym left a comment

Choose a reason for hiding this comment

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

this case should probably be added to the tests in resolver_test.go

@@ -19,6 +19,10 @@ policies:
title: SSH config editing should be limited to admins
mql: sshd.config.file.permissions.mode == 0644
impact: 100
queries:
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need do add query pack dependencies to support this in the maps?

similar to policy_dependencies but for query packs instead

Copy link
Member Author

Choose a reason for hiding this comment

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

oh good point! I'm not sure on the wiring we are using internally, but essentially we just want to point people to the MRN of the policy or querypack they want to activate at the end of the day

Copy link
Contributor

Choose a reason for hiding this comment

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

I added a query_pack_dependencies field to the proto. We use the policy/pack deps when compiling the framework maps to ensure that the policies/packs are in the bundle.

Note that packs come back as policies in the bundle but we only reference them by uid so that should be fine

policy/resolver.go Outdated Show resolved Hide resolved
@arlimus
Copy link
Member Author

arlimus commented Oct 18, 2023

Looks great, thank you for the updates!

@preslavgerchev preslavgerchev merged commit fb706c9 into main Oct 18, 2023
@preslavgerchev preslavgerchev deleted the dom/control-query-map branch October 18, 2023 07:22
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants