Skip to content

Commit

Permalink
Merge pull request #2021 from 0intro/session-get-rule-results
Browse files Browse the repository at this point in the history
Implement xccdf_session_get_rule_results function in XCCDF session API
  • Loading branch information
jan-cerny authored Sep 15, 2023
2 parents 8325ad5 + aace930 commit 73d957d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/XCCDF/public/xccdf_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,18 @@ OSCAP_API unsigned int xccdf_session_get_cpe_oval_agents_count(const struct xccd
*/
OSCAP_API bool xccdf_session_contains_fail_result(const struct xccdf_session *session);

/**
* @struct xccdf_rule_result_iterator
*/
struct xccdf_rule_result_iterator;

/**
* Get rule results.
* @memberof xccdf_session
* @param session XCCDF Session
*/
OSCAP_API struct xccdf_rule_result_iterator *xccdf_session_get_rule_results(const struct xccdf_session *session);

/**
* Run XCCDF Remediation. It uses XCCDF Policy and XCCDF TestResult from the session
* and modifies the TestResult. This also drops and recreate OVAL Agent Session, thus
Expand Down
5 changes: 5 additions & 0 deletions src/XCCDF/xccdf_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -1863,6 +1863,11 @@ bool xccdf_session_contains_fail_result(const struct xccdf_session *session)
return false;
}

struct xccdf_rule_result_iterator *xccdf_session_get_rule_results(const struct xccdf_session *session)
{
return xccdf_result_get_rule_results(session->xccdf.result);
}

int xccdf_session_remediate(struct xccdf_session *session)
{
int res = 0;
Expand Down

0 comments on commit 73d957d

Please sign in to comment.