Open SCAP Library
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
xccdf_policy.h File Reference

Open-scap XCCDF Policy library interface. More...

#include <xccdf_benchmark.h>
#include <stdbool.h>
#include <time.h>
#include <oscap.h>
#include "oscap_export.h"
#include "oval_definitions.h"
Include dependency graph for xccdf_policy.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void *(* xccdf_policy_engine_query_fn) (void *, xccdf_policy_engine_query_t, void *)
 Type of function which implements queries defined within xccdf_policy_engine_query_t.
 
typedef xccdf_test_result_type_t(* xccdf_policy_engine_eval_fn) (struct xccdf_policy *policy, const char *rule_id, const char *definition_id, const char *href_if, struct xccdf_value_binding_iterator *value_binding_it, struct xccdf_check_import_iterator *check_imports_it, void *user_data)
 Type of function which implements OpenSCAP checking engine.
 
typedef int(* policy_reporter_output) (struct xccdf_rule_result *, void *)
 
typedef int(* policy_reporter_start) (struct xccdf_rule *, void *)
 
typedef int(* policy_reporter_multicheck) (struct oval_definition *, void *)
 

Enumerations

enum  xccdf_policy_engine_query_t { POLICY_ENGINE_QUERY_NAMES_FOR_HREF = 1 , POLICY_ENGINE_QUERY_OVAL_DEFS_FOR_HREF = 2 }
 Type of a query over checking-engine data. More...
 

Functions

OSCAP_API bool xccdf_policy_model_set_tailoring (struct xccdf_policy_model *model, struct xccdf_tailoring *tailoring)
 Sets the Tailoring element to use in the policy.
 
OSCAP_API bool xccdf_policy_model_add_cpe_dict_source (struct xccdf_policy_model *model, struct oscap_source *source)
 Registers an additional CPE dictionary for applicability testing The one embedded in the evaluated XCCDF take precedence!
 
OSCAP_API bool xccdf_policy_model_add_cpe_dict (struct xccdf_policy_model *model, const char *cpe_dict)
 Registers an additional CPE dictionary for applicability testing The one embedded in the evaluated XCCDF take precedence!
 
OSCAP_API bool xccdf_policy_model_add_cpe_lang_model_source (struct xccdf_policy_model *model, struct oscap_source *source)
 Registers an additional CPE lang model for applicability testing The one embedded in the evaluated XCCDF take precedence!
 
OSCAP_API bool xccdf_policy_model_add_cpe_autodetect_source (struct xccdf_policy_model *model, struct oscap_source *source)
 Registers an additional CPE resource (either dictionary or language) Autodetects given file and acts accordingly.
 
OSCAP_API struct oscap_htable_iteratorxccdf_policy_model_get_cpe_oval_sessions (struct xccdf_policy_model *model)
 Retrieves an iterator of all OVAL sessions created for CPE applicability evaluation key is the OVAL href, value is the OVAL session itself (type oval_agent_session*)
 
Setters

For lists use add functions.

Parameters of set functions are duplicated in memory and need to be freed by caller.

OSCAP_API int xccdf_policy_get_selected_rules_count (struct xccdf_policy *policy)
 Retrieves number of selected items in the policy.
 
Evaluators
OSCAP_API struct oscap_file_entry_listxccdf_policy_model_get_systems_and_files (struct xccdf_policy_model *policy_model)
 Return names of files that are used in checks of particular rules.
 
OSCAP_API struct oscap_file_entry_listxccdf_item_get_systems_and_files (struct xccdf_item *item)
 Return names of files that are used in checks of particular rules.
 
OSCAP_API struct oscap_stringlistxccdf_policy_model_get_files (struct xccdf_policy_model *policy_model)
 Return names of files that are used in checks of particular rules.
 
OSCAP_API struct oscap_stringlistxccdf_item_get_files (struct xccdf_item *item)
 Return names of files that are used in checks of particular rules.
 
OSCAP_API xccdf_test_result_type_t xccdf_test_result_resolve_and_operation (xccdf_test_result_type_t A, xccdf_test_result_type_t B)
 Return result of the AND operation for two given attributes.
 
Iterators
OSCAP_API struct xccdf_scorexccdf_policy_get_score (struct xccdf_policy *policy, struct xccdf_result *test_result, const char *system)
 Get score of the XCCDF Benchmark.
 
OSCAP_API int xccdf_policy_recalculate_score (struct xccdf_policy *policy, struct xccdf_result *test_result)
 Recalculate score of the XCCDF Benchmark.
 
OSCAP_API char * xccdf_policy_substitute (const char *text, struct xccdf_policy *policy)
 Perform textual substitution of cdf:sub elements with respect to given XCCDF policy.
 

Detailed Description

Open-scap XCCDF Policy library interface.

Author
Maros Barabas mbara.nosp@m.bas@.nosp@m.redha.nosp@m.t.co.nosp@m.m
Dave Niemoller david.nosp@m..nie.nosp@m.molle.nosp@m.r@g2.nosp@m.-inc..nosp@m.com