32 #ifndef XCCDF_SESSION_H_
33 #define XCCDF_SESSION_H_
void xccdf_session_set_custom_oval_eval_fn(struct xccdf_session *session, xccdf_policy_engine_eval_fn eval_fn)
Set custom OVAL eval function to register with each OVAL session.
Definition: xccdf_session.c:308
int xccdf_session_load_sce(struct xccdf_session *session)
Definition: xccdf_session.c:815
void xccdf_session_free(struct xccdf_session *session)
Destructor of xccdf_session.
Definition: xccdf_session.c:197
int xccdf_session_load_tailoring(struct xccdf_session *session)
Load Tailoring file (if applicable) to the XCCDF session.
Definition: xccdf_session.c:820
bool xccdf_session_is_sds(const struct xccdf_session *session)
Query if the session is based on Source DataStream.
Definition: xccdf_session.c:233
A structure encapsulating the context of XCCDF operations.
Definition: xccdf_session.c:63
void xccdf_session_set_datastream_id(struct xccdf_session *session, const char *datastream_id)
Set requested datastream_id for this session.
Definition: xccdf_session.c:244
const char * xccdf_session_get_component_id(struct xccdf_session *session)
Retrieves the component id.
Definition: xccdf_session.c:264
Open-scap XCCDF Policy library interface.
float xccdf_session_get_base_score(const struct xccdf_session *session)
Get the base score of the latest XCCDF evaluation in the session.
#define OSCAP_DEPRECATED(func)
This macro will warn, when a deprecated function is used.
Definition: oscap.h:50
int xccdf_session_load(struct xccdf_session *session)
Load and parse all XCCDF structures needed to evaluate this session.
Definition: xccdf_session.c:399
char * profile_id
Last selected profile.
Definition: xccdf_session.c:70
int xccdf_session_export_check_engine_plugins(struct xccdf_session *session)
Export results (if any) from any check engine plugins that are loaded.
Definition: xccdf_session.c:1229
char * xccdf_file
Path to XCCDF file to export.
Definition: xccdf_session.c:93
void(* download_progress_calllback_t)(bool warning, const char *format,...)
Type of the function used to report progress of download.
Definition: xccdf_session.h:42
void xccdf_session_set_sce_results_export(struct xccdf_session *session, bool to_export_sce_results)
Set that SCE reult files shall be exported.
Definition: xccdf_session.c:335
XCCDF policy model structure contains xccdf_benchmark as reference to Benchmark element in XML file a...
Definition: xccdf_policy_priv.h:39
int xccdf_session_export_xccdf(struct xccdf_session *session)
Export XCCDF file.
Definition: xccdf_session.c:989
char * report_file
Path to HTML file to eport.
Definition: xccdf_session.c:94
int xccdf_session_load_check_engine_plugin(struct xccdf_session *session, const char *plugin_name)
Load extra check engine from a plugin of given name to the XCCDF session.
Definition: xccdf_session.c:768
void xccdf_session_set_user_cpe(struct xccdf_session *session, const char *user_cpe)
Set path to custom CPE dictionary for the session.
Definition: xccdf_session.c:283
void xccdf_session_set_check_engine_plugins_results_export(struct xccdf_session *session, bool to_export_results)
Set that check engine plugin's result files shall be exported.
Definition: xccdf_session.c:330
const char * xccdf_session_get_datastream_id(struct xccdf_session *session)
Retrieves the datastream id.
Definition: xccdf_session.c:250
bool xccdf_session_set_profile_id(struct xccdf_session *session, const char *profile_id)
Select XCCDF Profile for evaluation.
Definition: xccdf_session.c:361
Represents element - the root element of each source datastream.
Definition: sds_index.c:214
int xccdf_session_export_oval(struct xccdf_session *session)
Export OVAL (result and variables) files.
Definition: xccdf_session.c:1176
bool xccdf_session_set_product_cpe(struct xccdf_session *session, const char *product_cpe)
Set custom product CPE name.
Definition: xccdf_session.c:313
char * user_cpe
Path to CPE dictionary required by user.
Definition: xccdf_session.c:99
int xccdf_session_build_policy_from_testresult(struct xccdf_session *session, const char *testresult_id)
Load xccdf:TestResult to the session from file and prepare session for remediation.
Definition: xccdf_session.c:1379
const char * xccdf_session_get_benchmark_id(struct xccdf_session *session)
Retrieves the benchmark_id.
Definition: xccdf_session.c:278
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.
Definition: xccdf_policy.h:98
struct xccdf_policy * xccdf_session_get_xccdf_policy(const struct xccdf_session *session)
Get xccdf_policy of the session.
Definition: xccdf_session.c:1305
bool xccdf_session_set_report_export(struct xccdf_session *session, const char *report_file)
Set where to export HTML Report file.
Definition: xccdf_session.c:354
int xccdf_session_evaluate(struct xccdf_session *session)
Evaluate XCCDF Policy.
Definition: xccdf_session.c:869
struct xccdf_policy_model * xccdf_session_get_policy_model(const struct xccdf_session *session)
Get policy_model of the session.
int xccdf_session_export_arf(struct xccdf_session *session)
Export ARF (if enabled by xccdf_session_set_arf_export).
Definition: xccdf_session.c:1258
bool xccdf_session_set_arf_export(struct xccdf_session *session, const char *arf_file)
Set where to export ARF file.
Definition: xccdf_session.c:340
int xccdf_session_load_oval(struct xccdf_session *session)
Load and parse OVAL definitions files for the XCCDF session.
Definition: xccdf_session.c:701
void xccdf_session_set_user_tailoring_cid(struct xccdf_session *session, const char *user_tailoring_cid)
Set ID of Tailoring component for the session.
Definition: xccdf_session.c:296
int xccdf_session_load_check_engine_plugins(struct xccdf_session *session)
Load extra check engines (if any are available) to the XCCDF session.
Definition: xccdf_session.c:780
int xccdf_session_remediate(struct xccdf_session *session)
Run XCCDF Remediation.
Definition: xccdf_session.c:1358
void xccdf_session_set_custom_oval_files(struct xccdf_session *session, char **oval_filenames)
Set custom oval files for this session.
Definition: xccdf_session.c:561
const char * filename
File name of SCAP (SDS or XCCDF) file for this session.
Definition: xccdf_session.c:64
void xccdf_session_set_component_id(struct xccdf_session *session, const char *component_id)
Set requested component_id for this session.
Definition: xccdf_session.c:258
void xccdf_session_set_validation(struct xccdf_session *session, bool validate, bool full_validation)
Set XSD validation level.
Definition: xccdf_session.c:238
int xccdf_session_load_cpe(struct xccdf_session *session)
Load and parse CPE dictionaries.
Definition: xccdf_session.c:482
char * arf_file
Path to ARF file to export.
Definition: xccdf_session.c:92
XCCDF policy structure is abstract (class) structure of Profile element from benchmark.
Definition: xccdf_policy_priv.h:58
int xccdf_session_load_xccdf(struct xccdf_session *session)
Load and parse XCCDF file.
Definition: xccdf_session.c:420
struct xccdf_session * xccdf_session_new(const char *filename)
Costructor of xccdf_session.
Definition: xccdf_session.c:118
void xccdf_session_set_benchmark_id(struct xccdf_session *session, const char *benchmark_id)
Sets requested benchmark_id for this session.
Definition: xccdf_session.c:272
int xccdf_session_export_sce(struct xccdf_session *session)
Export SCE files (if enabled by xccdf_session_set_sce_results_export).
Definition: xccdf_session.c:1253
struct ds_sds_index * xccdf_session_get_sds_idx(struct xccdf_session *session)
Get Source DataStream index of the session.
Definition: xccdf_session.c:391
bool full_validation
True value indicates that every possible step will be validated by XSD.
Definition: xccdf_session.c:105
char * product_cpe
CPE of scanner product.
Definition: xccdf_session.c:88
void xccdf_session_set_oval_results_export(struct xccdf_session *session, bool to_export_oval_results)
Set whether the OVAL result files shall be exported.
Definition: xccdf_session.c:320
bool validate
False value indicates to skip any XSD validation.
Definition: xccdf_session.c:104
bool xccdf_session_contains_fail_result(const struct xccdf_session *session)
Query if the result of evaluation contains FAIL, ERROR, or UNKNOWN rule-result elements.
Definition: xccdf_session.c:1341
bool xccdf_session_set_xccdf_export(struct xccdf_session *session, const char *xccdf_file)
Set where to export XCCDF file.
Definition: xccdf_session.c:347
void xccdf_session_set_remote_resources(struct xccdf_session *session, bool allowed, download_progress_calllback_t callback)
Set properties of remote content.
Definition: xccdf_session.c:302
void xccdf_session_set_user_tailoring_file(struct xccdf_session *session, const char *user_tailoring_file)
Set path to custom Tailoring file for the session.
Definition: xccdf_session.c:289
void xccdf_session_set_oval_variables_export(struct xccdf_session *session, bool to_export_oval_variables)
Set whether the OVAL variables files shall be exported.
Definition: xccdf_session.c:325
unsigned int xccdf_session_get_oval_agents_count(const struct xccdf_session *session)
Get count of OVAL agent sessions not used for CPE in the xccdf_session.
Definition: xccdf_session.c:1314
const char * xccdf_session_get_profile_id(struct xccdf_session *session)
Retrieves ID of the profile that we will evaluate with, or NULL.
Definition: xccdf_session.c:370
unsigned int xccdf_session_get_cpe_oval_agents_count(const struct xccdf_session *session)
Get count of OVAL agent sessions for CPE in the xccdf_session.
Definition: xccdf_session.c:1323
struct ds_sds_session * session
SDS Registry abstract structure.
Definition: xccdf_session.c:76
const char * xccdf_session_get_filename(const struct xccdf_session *session)
Retrieves the filename the session was created with.
Definition: xccdf_session.c:228