Open SCAP Library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Data Fields
xccdf_session Struct Reference

A structure encapsulating the context of XCCDF operations. More...

#include <xccdf_session.h>

Collaboration diagram for xccdf_session:
[legend]

Public Types

enum  xccdf_session_loading_flags_t
 Loading flags for XCCDF sessionThe flags set which components will be loaded in XCCDF session.
 

Public Member Functions

OSCAP_API struct xccdf_sessionxccdf_session_new (const char *filename)
 Costructor of xccdf_session.
 
OSCAP_API struct xccdf_sessionxccdf_session_new_from_source (struct oscap_source *source)
 Costructor of xccdf_session.
 
OSCAP_API void xccdf_session_free (struct xccdf_session *session)
 Destructor of xccdf_session.
 
OSCAP_API void xccdf_session_result_reset (struct xccdf_session *session)
 Reset xccdf_session results.
 
OSCAP_API const char * xccdf_session_get_filename (const struct xccdf_session *session)
 Retrieves the filename the session was created with.
 
OSCAP_API bool xccdf_session_is_sds (const struct xccdf_session *session)
 Query if the session is based on Source DataStream.
 
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.
 
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 will be evaluated.
 
OSCAP_API void xccdf_session_skip_rule (struct xccdf_session *session, const char *rule)
 Skip rule during evaluation of the session.
 
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:
 
OSCAP_API void xccdf_session_set_signature_validation (struct xccdf_session *session, bool validate)
 Set XML signature validation.
 
OSCAP_API void xccdf_session_set_signature_enforcement (struct xccdf_session *session, bool enforce)
 Set XML signature enforcement.
 
OSCAP_API void xccdf_session_set_thin_results (struct xccdf_session *session, bool thin_result)
 Set whether the thin results override is enabled.
 
OSCAP_API void xccdf_session_set_datastream_id (struct xccdf_session *session, const char *datastream_id)
 Set requested datastream_id for this session.
 
OSCAP_API const char * xccdf_session_get_datastream_id (struct xccdf_session *session)
 Retrieves the datastream id.
 
OSCAP_API void xccdf_session_set_component_id (struct xccdf_session *session, const char *component_id)
 Set requested component_id for this session.
 
OSCAP_API const char * xccdf_session_get_component_id (struct xccdf_session *session)
 Retrieves the component id.
 
OSCAP_API void xccdf_session_set_benchmark_id (struct xccdf_session *session, const char *benchmark_id)
 Sets requested benchmark_id for this session.
 
OSCAP_API const char * xccdf_session_get_benchmark_id (struct xccdf_session *session)
 Retrieves the benchmark_id.
 
OSCAP_API const char * xccdf_session_get_result_id (struct xccdf_session *session)
 Retrieves the result id.
 
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.
 
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.
 
OSCAP_API void xccdf_session_set_user_tailoring_cid (struct xccdf_session *session, const char *user_tailoring_cid)
 Set ID of Tailoring component for the session.
 
OSCAP_API void xccdf_session_set_remote_resources (struct xccdf_session *session, bool allowed, download_progress_calllback_t callback)
 Set properties of remote content.
 
OSCAP_API void xccdf_session_configure_remote_resources (struct xccdf_session *session, bool allowed, const char *local_files, download_progress_calllback_t callback)
 Set properties of remote content.
 
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 void xccdf_session_set_custom_oval_files (struct xccdf_session *session, char **oval_filenames)
 Set custom oval files for this session.
 
OSCAP_API 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.
 
OSCAP_API bool xccdf_session_set_product_cpe (struct xccdf_session *session, const char *product_cpe)
 Set custom product CPE name.
 
OSCAP_API void xccdf_session_set_without_sys_chars_export (struct xccdf_session *session, bool without_sys_chars)
 Set whether the System Characteristics shall be exported in result files.
 
OSCAP_API 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.
 
OSCAP_API 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.
 
OSCAP_API 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.
 
OSCAP_API bool xccdf_session_set_xccdf_export (struct xccdf_session *session, const char *xccdf_file)
 Set where to export XCCDF file.
 
OSCAP_API bool xccdf_session_set_xccdf_stig_viewer_export (struct xccdf_session *session, const char *xccdf_stig_viewer_file)
 Set where to export STIG Viewer XCCDF file.
 
OSCAP_API bool xccdf_session_set_arf_export (struct xccdf_session *session, const char *arf_file)
 Set where to export ARF file.
 
OSCAP_API bool xccdf_session_set_report_export (struct xccdf_session *session, const char *report_file)
 Set where to export HTML Report file.
 
OSCAP_API bool xccdf_session_set_profile_id (struct xccdf_session *session, const char *profile_id)
 Select XCCDF Profile for evaluation.
 
OSCAP_API int xccdf_session_set_profile_id_by_suffix (struct xccdf_session *session, const char *profile_suffix)
 Select XCCDF Profile for evaluation with only profile suffix as input.
 
OSCAP_API const char * xccdf_session_get_profile_id (struct xccdf_session *session)
 Retrieves ID of the profile that we will evaluate with, or NULL.
 
OSCAP_API struct ds_sds_indexxccdf_session_get_sds_idx (struct xccdf_session *session)
 Get Source DataStream index of the session.
 
OSCAP_API int xccdf_session_load (struct xccdf_session *session)
 Load and parse all XCCDF structures needed to evaluate this session.
 
OSCAP_API int xccdf_session_load_xccdf (struct xccdf_session *session)
 Load and parse XCCDF file.
 
OSCAP_API int xccdf_session_load_cpe (struct xccdf_session *session)
 Load and parse CPE dictionaries.
 
OSCAP_API int xccdf_session_load_oval (struct xccdf_session *session)
 Load and parse OVAL definitions files for the XCCDF session.
 
OSCAP_API int xccdf_session_load_check_engine_plugin2 (struct xccdf_session *session, const char *plugin_name, bool quiet)
 Load extra check engine from a plugin of given name to the XCCDF session.
 
OSCAP_API int xccdf_session_load_check_engine_plugins (struct xccdf_session *session)
 Load extra check engines (if any are available) to the XCCDF session.
 
OSCAP_API int xccdf_session_load_tailoring (struct xccdf_session *session)
 Load Tailoring file (if applicable) to the XCCDF session.
 
OSCAP_API int xccdf_session_evaluate (struct xccdf_session *session)
 Evaluate XCCDF Policy.
 
OSCAP_API int xccdf_session_export_xccdf (struct xccdf_session *session)
 Export XCCDF file.
 
OSCAP_API int xccdf_session_export_oval (struct xccdf_session *session)
 Export OVAL (result and variables) files.
 
OSCAP_API int xccdf_session_export_check_engine_plugins (struct xccdf_session *session)
 Export results (if any) from any check engine plugins that are loaded.
 
OSCAP_API int xccdf_session_export_arf (struct xccdf_session *session)
 Export ARF (if enabled by xccdf_session_set_arf_export).
 
OSCAP_API struct xccdf_policy_modelxccdf_session_get_policy_model (const struct xccdf_session *session)
 Get policy_model of the session.
 
OSCAP_API struct xccdf_policyxccdf_session_get_xccdf_policy (const struct xccdf_session *session)
 Get xccdf_policy of the session.
 
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 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.
 
OSCAP_API 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.
 
OSCAP_API 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.
 
OSCAP_API struct xccdf_rule_result_iteratorxccdf_session_get_rule_results (const struct xccdf_session *session)
 Get rule results.
 
OSCAP_API int xccdf_session_remediate (struct xccdf_session *session)
 Run XCCDF Remediation.
 
OSCAP_API 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.
 
OSCAP_API int xccdf_session_add_report_from_source (struct xccdf_session *session, struct oscap_source *report_source)
 Load xccdf:TestResult to the session from oscap_source.
 

Data Fields

const char * filename
 File name of SCAP (SDS or XCCDF) file for this session.
 
struct oscap_listrules
 
struct oscap_listskip_rules
 
const char * reference_parameter
 
struct oscap_sourcesource
 Main source assigned with the main file (SDS or XCCDF)
 
char * temp_dir
 Temp directory used for decomposed component files.
 
struct { 
 
   struct oscap_source *   source 
 oscap_source representing the XCCDF file
 
   struct xccdf_policy_model *   policy_model 
 Active policy model.
 
   char *   profile_id 
 Last selected profile.
 
   struct xccdf_result *   result 
 XCCDF Result model.
 
   float   base_score 
 Basec score of the latest evaluation.
 
   struct oscap_source *   result_source 
 oscap_source for the exported XCCDF result
 
xccdf 
 
struct { 
 
   struct ds_sds_session *   session 
 SDS Registry abstract structure.
 
   char *   user_datastream_id 
 Datastream id requested by user (only applicable for sds).
 
   char *   user_component_id 
 Component id requested by user (only applicable for sds).
 
   char *   user_benchmark_id 
 Benchmark id requested by user (only applicable for sds).
 
ds 
 
struct { 
 
   bool   fetch_remote_resources 
 Allows download of remote resources (not applicable when user sets custom oval files)
 
   const char *   local_files 
 Path to the directory where local copies of remote components are located.
 
   download_progress_calllback_t   progress 
 Callback to report progress of download.
 
   struct oval_content_resource **   custom_resources 
 OVAL files required by user.
 
   struct oval_content_resource **   resources 
 OVAL files referenced from XCCDF.
 
   struct oval_agent_session **   agents 
 OVAL Agent Session.
 
   xccdf_policy_engine_eval_fn   user_eval_fn 
 Custom OVAL engine callback.
 
   char *   product_cpe 
 CPE of scanner product.
 
   struct oscap_source *   arf_report 
 ARF report.
 
   struct oscap_htable *   result_sources 
 mapping 'filepath' to oscap_source for OVAL results
 
   struct oscap_htable *   results_mapping 
 mapping OVAL filename to filepath for OVAL results
 
   struct oscap_htable *   arf_report_mapping 
 mapping OVAL filename to ARF report ID for OVAL results
 
oval 
 
struct { 
 
   char *   arf_file 
 Path to ARF file to export.
 
   char *   xccdf_file 
 Path to XCCDF file to export.
 
   char *   xccdf_stig_viewer_file 
 Path to STIG Viewer XCCDF file to export.
 
   char *   report_file 
 Path to HTML file to export.
 
   bool   oval_results 
 Shall be the OVAL results files exported?
 
   bool   oval_variables 
 Shall be the OVAL variable files exported?
 
   bool   check_engine_plugins_results 
 Shall the check engine plugins results be exported?
 
   bool   without_sys_chars 
 Shall system characteristics be exported?
 
   bool   thin_results 
 Shall OVAL/ARF results be exported as THIN? Default is FULL.
 
export 
 Settings of Session export.
 
char * user_cpe
 Path to CPE dictionary required by user.
 
struct { 
 
   struct oscap_source *   user_file 
 Tailoring file requested by the user.
 
   char *   user_component_id 
 Component ID of the Tailoring requested by the user.
 
tailoring 
 
bool validate
 False value indicates to skip any XSD validation.
 
bool full_validation
 True value indicates that every possible step will be validated by XSD.
 
bool validate_signature
 False value indicates to skip XML signature validation.
 
bool enforce_signature
 True value forces session to treat all XMLs without signature as invalid.
 
struct oscap_signature_ctxsignature_ctx
 Paths to public keys, certificates, signature related info.
 
struct oscap_listcheck_engine_plugins
 Extra non-OVAL check engines that may or may not have been loaded.
 
xccdf_session_loading_flags_t loading_flags
 Load referenced files while loading XCCDF.
 

Detailed Description

A structure encapsulating the context of XCCDF operations.

Field Documentation

◆ source

struct oscap_source* xccdf_session::source

Main source assigned with the main file (SDS or XCCDF)

oscap_source representing the XCCDF file

◆ user_component_id

char* xccdf_session::user_component_id

Component id requested by user (only applicable for sds).

Component ID of the Tailoring requested by the user.


The documentation for this struct was generated from the following files: