File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ class SCAPolicy
30
30
31
31
// / @brief Runs the policy check
32
32
// / @return Awaitable void
33
- boost::asio::awaitable<void > Run ();
33
+ boost::asio::awaitable<void >
34
+ Run (std::function<void (const std::string&, const std::string&, bool )> reportCheckResult);
34
35
35
36
// / @brief Stops the policy check
36
37
void Stop ();
Original file line number Diff line number Diff line change @@ -51,7 +51,12 @@ void SecurityConfigurationAssessment::Run()
51
51
{
52
52
for (auto & policy : m_policies)
53
53
{
54
- EnqueueTask (policy.Run ());
54
+ EnqueueTask (policy.Run (
55
+ [this ](const std::string& policyId, const std::string& checkId, bool result)
56
+ {
57
+ const SCAEventHandler eventHandler (m_agentUUID, m_dBSync, m_pushMessage);
58
+ eventHandler.ReportCheckResult (policyId, checkId, result);
59
+ }));
55
60
}
56
61
m_ioContext.run ();
57
62
}
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ SCAPolicy::SCAPolicy(SCAPolicy&& other) noexcept
21
21
{
22
22
}
23
23
24
- boost::asio::awaitable<void > SCAPolicy::Run ()
24
+ boost::asio::awaitable<void >
25
+ SCAPolicy::Run (std::function<void (const std::string&, const std::string&, bool )> reportCheckResult)
25
26
{
26
27
while (m_keepRunning)
27
28
{
@@ -50,7 +51,9 @@ boost::asio::awaitable<void> SCAPolicy::Run()
50
51
resultEvaluator.AddResult (rule->Evaluate () == RuleResult::Found);
51
52
}
52
53
53
- [[maybe_unused]] auto result = resultEvaluator.Result ();
54
+ const auto result = resultEvaluator.Result ();
55
+
56
+ reportCheckResult (m_id, check.id .value (), result);
54
57
}
55
58
}
56
59
You can’t perform that action at this time.
0 commit comments