32#ifndef XCCDF_SESSION_H_
33#define XCCDF_SESSION_H_
36#include "oscap_download_cb.h"
37#include "oscap_export.h"
51 XCCDF_SESSION_LOAD_NONE = 0,
52 XCCDF_SESSION_LOAD_XCCDF = 1 << 0,
53 XCCDF_SESSION_LOAD_CPE = 1 << 1,
54 XCCDF_SESSION_LOAD_OVAL = 1 << 2,
55 XCCDF_SESSION_LOAD_CHECK_ENGINE_PLUGINS = 1 << 3,
56 XCCDF_SESSION_LOAD_ALL = XCCDF_SESSION_LOAD_XCCDF | XCCDF_SESSION_LOAD_CPE | XCCDF_SESSION_LOAD_OVAL | XCCDF_SESSION_LOAD_CHECK_ENGINE_PLUGINS
252OSCAP_API
void xccdf_session_set_user_tailoring_cid(
struct xccdf_session *session,
const char *user_tailoring_cid);
262OSCAP_API
OSCAP_DEPRECATED(
void xccdf_session_set_remote_resources(
struct xccdf_session *session,
bool allowed, download_progress_calllback_t callback));
276OSCAP_API
void xccdf_session_configure_remote_resources(
struct xccdf_session *session,
bool allowed,
const char *local_files, download_progress_calllback_t callback);
294OSCAP_API
void xccdf_session_set_custom_oval_files(
struct xccdf_session *session,
char **oval_filenames);
312OSCAP_API
bool xccdf_session_set_product_cpe(
struct xccdf_session *session,
const char *product_cpe);
320OSCAP_API
void xccdf_session_set_without_sys_chars_export(
struct xccdf_session *session,
bool without_sys_chars);
328OSCAP_API
void xccdf_session_set_oval_results_export(
struct xccdf_session *session,
bool to_export_oval_results);
336OSCAP_API
void xccdf_session_set_check_engine_plugins_results_export(
struct xccdf_session *session,
bool to_export_results);
344OSCAP_API
void xccdf_session_set_oval_variables_export(
struct xccdf_session *session,
bool to_export_oval_variables);
353OSCAP_API
bool xccdf_session_set_xccdf_export(
struct xccdf_session *session,
const char *xccdf_file);
362OSCAP_API
bool xccdf_session_set_xccdf_stig_viewer_export(
struct xccdf_session *session,
const char *xccdf_stig_viewer_file);
371OSCAP_API
bool xccdf_session_set_arf_export(
struct xccdf_session *session,
const char *arf_file);
380OSCAP_API
bool xccdf_session_set_report_export(
struct xccdf_session *session,
const char *report_file);
389OSCAP_API
bool xccdf_session_set_profile_id(
struct xccdf_session *session,
const char *profile_id);
399OSCAP_API
int xccdf_session_set_profile_id_by_suffix(
struct xccdf_session *session,
const char *profile_suffix);
406OSCAP_API
const char *xccdf_session_get_profile_id(
struct xccdf_session *session);
424OSCAP_API
int xccdf_session_load(
struct xccdf_session *session);
438OSCAP_API
int xccdf_session_load_xccdf(
struct xccdf_session *session);
447OSCAP_API
int xccdf_session_load_cpe(
struct xccdf_session *session);
455OSCAP_API
int xccdf_session_load_oval(
struct xccdf_session *session);
471OSCAP_API
int xccdf_session_load_check_engine_plugin2(
struct xccdf_session *session,
const char* plugin_name,
bool quiet);
472OSCAP_API
int xccdf_session_load_check_engine_plugin(
struct xccdf_session *session,
const char* plugin_name);
484OSCAP_API
int xccdf_session_load_check_engine_plugins(
struct xccdf_session *session);
492OSCAP_API
int xccdf_session_load_tailoring(
struct xccdf_session *session);
500OSCAP_API
int xccdf_session_evaluate(
struct xccdf_session *session);
508OSCAP_API
int xccdf_session_export_xccdf(
struct xccdf_session *session);
516OSCAP_API
int xccdf_session_export_oval(
struct xccdf_session *session);
526OSCAP_API
int xccdf_session_export_check_engine_plugins(
struct xccdf_session *session);
534OSCAP_API
int xccdf_session_export_arf(
struct xccdf_session *session);
567OSCAP_API
unsigned int xccdf_session_get_oval_agents_count(
const struct xccdf_session *session);
577OSCAP_API
unsigned int xccdf_session_get_cpe_oval_agents_count(
const struct xccdf_session *session);
585OSCAP_API
bool xccdf_session_contains_fail_result(
const struct xccdf_session *session);
607OSCAP_API
int xccdf_session_remediate(
struct xccdf_session *session);
619OSCAP_API
int xccdf_session_build_policy_from_testresult(
struct xccdf_session *session,
const char *testresult_id);
#define OSCAP_DEPRECATED(func)
This macro will warn, when a deprecated function is used.
Definition oscap.h:50
OSCAP_API 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:498
OSCAP_API bool xccdf_session_is_sds(const struct xccdf_session *session)
Query if the session is based on Source DataStream.
Definition xccdf_session.c:405
xccdf_session_loading_flags_t
Loading flags for XCCDF sessionThe flags set which components will be loaded in XCCDF session.
Definition xccdf_session.h:50
OSCAP_API struct xccdf_session * xccdf_session_new(const char *filename)
Costructor of xccdf_session.
Definition xccdf_session.c:185
OSCAP_API const char * xccdf_session_get_filename(const struct xccdf_session *session)
Retrieves the filename the session was created with.
Definition xccdf_session.c:400
OSCAP_API 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:448
OSCAP_API 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:476
OSCAP_API int xccdf_session_export_all(struct xccdf_session *session)
Export XCCDF results, ARF results and HTML report from the given XCCDF session based on values set in...
Definition xccdf_session.c:2023
OSCAP_API struct xccdf_session * xccdf_session_new_from_source(struct oscap_source *source)
Costructor of xccdf_session.
Definition xccdf_session.c:138
OSCAP_API void xccdf_session_free(struct xccdf_session *session)
Destructor of xccdf_session.
Definition xccdf_session.c:328
OSCAP_API void xccdf_session_set_validation(struct xccdf_session *session, bool validate, bool full_validation)
Set XSD validation level to one of three possibilities:
Definition xccdf_session.c:427
OSCAP_API void xccdf_session_set_signature_validation(struct xccdf_session *session, bool validate)
Set XML signature validation.
Definition xccdf_session.c:433
OSCAP_API void xccdf_session_set_loading_flags(struct xccdf_session *session, xccdf_session_loading_flags_t flags)
Disable or allow loading of depending content (OVAL, SCE, CPE)
OSCAP_API const char * xccdf_session_get_result_id(struct xccdf_session *session)
Retrieves the result id.
Definition xccdf_session.c:487
OSCAP_API void xccdf_session_set_rule(struct xccdf_session *session, const char *rule)
Set rule for session - if rule is not NULL, session will use only this one rule.
Definition xccdf_session.c:410
OSCAP_API const char * xccdf_session_get_datastream_id(struct xccdf_session *session)
Retrieves the datastream id.
Definition xccdf_session.c:454
OSCAP_API const char * xccdf_session_get_component_id(struct xccdf_session *session)
Retrieves the component id.
Definition xccdf_session.c:468
OSCAP_API void xccdf_session_set_reference_filter(struct xccdf_session *session, const char *reference_filter)
Set reference filter to the XCCDF session.
Definition xccdf_session.c:2072
OSCAP_API void xccdf_session_set_thin_results(struct xccdf_session *session, bool thin_result)
Set whether the thin results override is enabled.
Definition xccdf_session.c:443
OSCAP_API const char * xccdf_session_get_benchmark_id(struct xccdf_session *session)
Retrieves the benchmark_id.
Definition xccdf_session.c:482
OSCAP_API void xccdf_session_result_reset(struct xccdf_session *session)
Reset xccdf_session results.
Definition xccdf_session.c:384
OSCAP_API float xccdf_session_get_base_score(const struct xccdf_session *session)
Get the base score of the latest XCCDF evaluation in the session.
OSCAP_API int xccdf_session_generate_guide(struct xccdf_session *session, const char *outfile)
Generate HTML guide form a loaded XCCDF session.
Definition xccdf_session.c:1982
OSCAP_API void xccdf_session_set_signature_enforcement(struct xccdf_session *session, bool enforce)
Set XML signature enforcement.
Definition xccdf_session.c:438
OSCAP_API 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:462
OSCAP_API 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:492
OSCAP_API void xccdf_session_add_rule(struct xccdf_session *session, const char *rule)
Add specific rule for session - if at least one rule is added to the session, only the added rules wi...
Definition xccdf_session.c:417
OSCAP_API void xccdf_session_skip_rule(struct xccdf_session *session, const char *rule)
Skip rule during evaluation of the session.
Definition xccdf_session.c:422
OSCAP_API struct xccdf_policy_model * xccdf_session_get_policy_model(const struct xccdf_session *session)
Get policy_model of the session.
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:103
Retrieves iterator over all components inside the <extended-components> element.
Definition sds_index.c:209
Definition oscap_source.c:66
XCCDF policy model structure contains xccdf_benchmark as reference to Benchmark element in XML file a...
Definition xccdf_policy_priv.h:38
XCCDF policy structure is abstract (class) structure of Profile element from benchmark.
Definition xccdf_policy_priv.h:57
A structure encapsulating the context of XCCDF operations.
Definition xccdf_session.c:69
char * user_cpe
Path to CPE dictionary required by user.
Definition xccdf_session.c:115
bool full_validation
True value indicates that every possible step will be validated by XSD.
Definition xccdf_session.c:121
bool validate
False value indicates to skip any XSD validation.
Definition xccdf_session.c:120
const char * filename
File name of SCAP (SDS or XCCDF) file for this session.
Definition xccdf_session.c:70
struct oscap_source * source
Main source assigned with the main file (SDS or XCCDF)
Definition xccdf_session.c:74
struct ds_sds_session * session
SDS Registry abstract structure.
Definition xccdf_session.c:85
Open-scap XCCDF Policy library interface.