Open SCAP Library

xccdf_policy.h
Go to the documentation of this file.
1 /*
2 * Copyright 2009--2014 Red Hat Inc., Durham, North Carolina.
3 * All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 */
20
21
31 #ifndef XCCDF_POLICY_H_
32 #define XCCDF_POLICY_H_
33
34 #include <xccdf_benchmark.h>
35 #include <stdbool.h>
36 #include <time.h>
37 #include <oscap.h>
38
43 struct xccdf_policy_model;
44
49 struct xccdf_policy;
50
55 struct xccdf_value_binding;
56
57 struct xccdf_value_binding_iterator;
58
64 struct xccdf_policy_iterator;
65
70 typedef enum {
71 POLICY_ENGINE_QUERY_NAMES_FOR_HREF = 1,
72 } xccdf_policy_engine_query_t;
73
88 typedef void *(*xccdf_policy_engine_query_fn) (void *, xccdf_policy_engine_query_t, void *);
89
98 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);
99
100 /************************************************************/
101
111 struct xccdf_policy_model *xccdf_policy_model_new(struct xccdf_benchmark *benchmark);
112
119 struct xccdf_policy * xccdf_policy_new(struct xccdf_policy_model * model, struct xccdf_profile * profile);
120
126 struct xccdf_value_binding * xccdf_value_binding_new(void);
127
132 void xccdf_policy_model_free(struct xccdf_policy_model *);
133
138 void xccdf_policy_free(struct xccdf_policy *);
139
144 void xccdf_value_binding_free(struct xccdf_value_binding *);
145
161 bool xccdf_policy_model_set_tailoring(struct xccdf_policy_model *model, struct xccdf_tailoring *tailoring);
162
167 struct xccdf_tailoring *xccdf_policy_model_get_tailoring(struct xccdf_policy_model *model);
168
178 char *xccdf_policy_get_readable_item_title(struct xccdf_policy *policy, struct xccdf_item *item, const char *preferred_lang);
179
190 char *xccdf_policy_get_readable_item_description(struct xccdf_policy *policy, struct xccdf_item *item, const char *preferred_lang);
191
196 bool xccdf_policy_model_add_cpe_dict_source(struct xccdf_policy_model * model, struct oscap_source *source);
197
204 bool xccdf_policy_model_add_cpe_dict(struct xccdf_policy_model * model, const char * cpe_dict);
205
210 bool xccdf_policy_model_add_cpe_lang_model_source(struct xccdf_policy_model * model, struct oscap_source *source);
211
218 OSCAP_DEPRECATED(bool xccdf_policy_model_add_cpe_lang_model(struct xccdf_policy_model * model, const char *cpe_lang));
219
225 bool xccdf_policy_model_add_cpe_autodetect_source(struct xccdf_policy_model *model, struct oscap_source *source);
226
234 OSCAP_DEPRECATED(bool xccdf_policy_model_add_cpe_autodetect(struct xccdf_policy_model *model, const char *filepath));
235
240 struct oscap_htable_iterator *xccdf_policy_model_get_cpe_oval_sessions(struct xccdf_policy_model *model);
241
254 OSCAP_DEPRECATED(bool xccdf_policy_model_register_engine_callback(struct xccdf_policy_model * model, char * sys, void * func, void * usr));
255
266 bool xccdf_policy_model_register_engine_and_query_callback(struct xccdf_policy_model *model, char *sys, xccdf_policy_engine_eval_fn eval_fn, void *usr, xccdf_policy_engine_query_fn query_fn);
267
268 typedef int (*policy_reporter_output)(struct xccdf_rule_result *, void *);
269
278 bool xccdf_policy_model_register_output_callback(struct xccdf_policy_model * model, policy_reporter_output func, void * usr);
279
280 typedef int (*policy_reporter_start)(struct xccdf_rule *, void *);
281
290 bool xccdf_policy_model_register_start_callback(struct xccdf_policy_model * model, policy_reporter_start func, void * usr);
291
292 /************************************************************/
306 struct xccdf_policy_model * xccdf_policy_get_model(const struct xccdf_policy * policy);
307
314 struct xccdf_benchmark * xccdf_policy_model_get_benchmark(const struct xccdf_policy_model * item);
315
320 struct xccdf_value_binding_iterator * xccdf_policy_get_values(const struct xccdf_policy * item);
321
329 struct xccdf_policy_iterator * xccdf_policy_model_get_policies(const struct xccdf_policy_model *model);
330
339 int xccdf_policy_model_build_all_useful_policies(struct xccdf_policy_model *policy_model);
340
347 struct xccdf_select_iterator * xccdf_policy_get_selected_rules(struct xccdf_policy *);
348
354 struct xccdf_profile * xccdf_policy_get_profile(const struct xccdf_policy *);
355
361 struct xccdf_select_iterator * xccdf_policy_get_selects(const struct xccdf_policy *);
362
368 char * xccdf_value_binding_get_name(const struct xccdf_value_binding *);
369
375 char * xccdf_value_binding_get_value(const struct xccdf_value_binding *);
376
382 xccdf_value_type_t xccdf_value_binding_get_type(const struct xccdf_value_binding *);
383
389 xccdf_operator_t xccdf_value_binding_get_operator(const struct xccdf_value_binding *);
390
396 char * xccdf_value_binding_get_setvalue(const struct xccdf_value_binding *);
397
402 struct xccdf_result_iterator * xccdf_policy_get_results(const struct xccdf_policy * policy);
403
409 struct xccdf_result * xccdf_policy_get_result_by_id(struct xccdf_policy * policy, const char * id);
410
417 const char * xccdf_policy_get_id(struct xccdf_policy * policy);
418
426 struct xccdf_policy * xccdf_policy_model_get_policy_by_id(struct xccdf_policy_model * policy_model, const char * id);
427
428 /************************************************************/
431 /************************************************************/
444 bool xccdf_policy_model_add_policy(struct xccdf_policy_model *, struct xccdf_policy *);
445
451 bool xccdf_policy_add_select(struct xccdf_policy *, struct xccdf_select *);
452
460 OSCAP_DEPRECATED(
461 bool xccdf_policy_set_selected(struct xccdf_policy * policy, char * idref)
462 );
463
468 bool xccdf_policy_add_result(struct xccdf_policy * policy, struct xccdf_result * item);
469
475 bool xccdf_policy_add_value(struct xccdf_policy *, struct xccdf_value_binding *);
476
482 bool xccdf_policy_is_item_selected(struct xccdf_policy *policy, const char *id);
483
488 int xccdf_policy_get_selected_rules_count(struct xccdf_policy *policy);
489
495 struct xccdf_select * xccdf_policy_get_select_by_id(struct xccdf_policy * policy, const char *item_id);
496
497 /************************************************************/
500 /************************************************************/
524 struct xccdf_result * xccdf_policy_evaluate(struct xccdf_policy * policy);
525
534 bool xccdf_policy_resolve(struct xccdf_policy * policy);
535
546 int xccdf_policy_generate_fix(struct xccdf_policy *policy, struct xccdf_result *result, const char *sys, int output_fd);
547
555 OSCAP_DEPRECATED(struct xccdf_item * xccdf_policy_tailor_item(struct xccdf_policy * policy, struct xccdf_item * item));
556
560 struct oscap_file_entry;
561
563 struct oscap_file_entry *oscap_file_entry_new(void);
565 struct oscap_file_entry *oscap_file_entry_dup(struct oscap_file_entry* file_entry);
567 void oscap_file_entry_free(struct oscap_file_entry* entry);
569 const char* oscap_file_entry_get_system(struct oscap_file_entry* entry);
571 const char* oscap_file_entry_get_file(struct oscap_file_entry* entry);
572
576 struct oscap_file_entry_iterator;
577
579 const struct oscap_file_entry *oscap_file_entry_iterator_next(struct oscap_file_entry_iterator *it);
581 bool oscap_file_entry_iterator_has_more(struct oscap_file_entry_iterator *it);
583 void oscap_file_entry_iterator_free(struct oscap_file_entry_iterator *it);
585 void oscap_file_entry_iterator_reset(struct oscap_file_entry_iterator *it);
586
590 struct oscap_file_entry_list;
591
593 struct oscap_file_entry_list* oscap_file_entry_list_new(void);
595 void oscap_file_entry_list_free(struct oscap_file_entry_list* list);
597 struct oscap_file_entry_iterator* oscap_file_entry_list_get_files(struct oscap_file_entry_list* list);
598
607 struct oscap_file_entry_list * xccdf_policy_model_get_systems_and_files(struct xccdf_policy_model * policy_model);
608
616 struct oscap_file_entry_list * xccdf_item_get_systems_and_files(struct xccdf_item * item);
617
623 struct oscap_stringlist * xccdf_policy_model_get_files(struct xccdf_policy_model * policy_model);
624
630 struct oscap_stringlist * xccdf_item_get_files(struct xccdf_item * item);
631
637 xccdf_test_result_type_t xccdf_test_result_resolve_and_operation(xccdf_test_result_type_t A, xccdf_test_result_type_t B);
638
639 /************************************************************/
642 /************************************************************/
652 bool xccdf_policy_iterator_has_more(struct xccdf_policy_iterator *it);
653
658 struct xccdf_policy * xccdf_policy_iterator_next(struct xccdf_policy_iterator *it);
659
664 void xccdf_policy_iterator_free(struct xccdf_policy_iterator *it);
665
670 void xccdf_policy_iterator_reset(struct xccdf_policy_iterator *it);
671
676 bool xccdf_value_binding_iterator_has_more(struct xccdf_value_binding_iterator *it);
677
682 struct xccdf_value_binding * xccdf_value_binding_iterator_next(struct xccdf_value_binding_iterator *it);
683
688 void xccdf_value_binding_iterator_free(struct xccdf_value_binding_iterator *it);
689
694 void xccdf_value_binding_iterator_reset(struct xccdf_value_binding_iterator *it);
695
703 struct xccdf_score * xccdf_policy_get_score(struct xccdf_policy * policy, struct xccdf_result * test_result, const char * system);
704
711 int xccdf_policy_recalculate_score(struct xccdf_policy * policy, struct xccdf_result * test_result);
712
721 const char *xccdf_policy_get_value_of_item(struct xccdf_policy * policy, struct xccdf_item * item);
722
728 char* xccdf_policy_substitute(const char *text, struct xccdf_policy *policy);
729
730 /************************************************************/
736 #endif
737
738
oscap_file_entry_list::oscap_file_entry_list_get_files
struct oscap_file_entry_iterator * oscap_file_entry_list_get_files(struct oscap_file_entry_list *list)
Definition: xccdf_policy.c:1212
xccdf_policy_model::xccdf_policy_model_get_tailoring
struct xccdf_tailoring * xccdf_policy_model_get_tailoring(struct xccdf_policy_model *model)
Retrieves the Tailoring element used in this policy.
Definition: xccdf_policy.c:1475
xccdf_policy_model_get_systems_and_files
struct oscap_file_entry_list * xccdf_policy_model_get_systems_and_files(struct xccdf_policy_model *policy_model)
Return names of files that are used in checks of particular rules.
Definition: xccdf_policy.c:2226
xccdf_tailoring
Stores content from xccdf:Tailoring element which can be loaded from a separate file.
Definition: item.h:172
xccdf_policy::xccdf_policy_get_value_of_item
const char * xccdf_policy_get_value_of_item(struct xccdf_policy *policy, struct xccdf_item *item)
Get value of given value item in context of given policy.
Definition: xccdf_policy.c:2093
oscap_file_entry_iterator::oscap_file_entry_iterator_has_more
bool oscap_file_entry_iterator_has_more(struct oscap_file_entry_iterator *it)
Definition: xccdf_policy.c:1182
oscap_stringlist
A collection of strings.
Definition: oscap_text.h:59
xccdf_policy_model_set_tailoring
bool xccdf_policy_model_set_tailoring(struct xccdf_policy_model *model, struct xccdf_tailoring *tailoring)
Sets the Tailoring element to use in the policy.
Definition: xccdf_policy.c:1459
oscap.h
General OpenScap functions and types.
oscap_file_entry::oscap_file_entry_free
void oscap_file_entry_free(struct oscap_file_entry *entry)
Definition: xccdf_policy.c:1160
xccdf_policy::xccdf_policy_generate_fix
int xccdf_policy_generate_fix(struct xccdf_policy *policy, struct xccdf_result *result, const char *sys, int output_fd)
Generate remediation prescription (presumably a remediation script).
Definition: xccdf_policy_remediate.c:907
xccdf_value_binding::xccdf_value_binding_get_operator
xccdf_operator_t xccdf_value_binding_get_operator(const struct xccdf_value_binding *)
get Value operator from value bindings
oscap_file_entry_list
oscap_file_entry_list::oscap_file_entry_list_free
void oscap_file_entry_list_free(struct oscap_file_entry_list *list)
Definition: xccdf_policy.c:1207
xccdf_score
XCCDF score.
Definition: item.h:370
xccdf_policy_model::xccdf_policy_model_get_policies
struct xccdf_policy_iterator * xccdf_policy_model_get_policies(const struct xccdf_policy_model *model)
Get policies from Policy Model.
xccdf_policy_iterator
Iterate through policies.
Definition: xccdf_policy.h:57
oscap_htable_iterator
Definition: list.c:548
oscap_file_entry_list::oscap_file_entry_list_new
struct oscap_file_entry_list * oscap_file_entry_list_new(void)
Definition: xccdf_policy.c:1197
xccdf_operator_t
xccdf_operator_t
Operator to be applied on an xccdf_value.
Definition: xccdf_benchmark.h:100
xccdf_policy::xccdf_policy_free
void xccdf_policy_free(struct xccdf_policy *)
Destructor of Policy structure.
Definition: xccdf_policy.c:2259
xccdf_item_get_systems_and_files
struct oscap_file_entry_list * xccdf_item_get_systems_and_files(struct xccdf_item *item)
Return names of files that are used in checks of particular rules.
Definition: xccdf_policy.c:1284
xccdf_policy_model::xccdf_policy_model_build_all_useful_policies
int xccdf_policy_model_build_all_useful_policies(struct xccdf_policy_model *policy_model)
Build all policies that can be useful for user.
Definition: xccdf_policy_model.c:111
xccdf_policy_model::xccdf_policy_model_new
struct xccdf_policy_model * xccdf_policy_model_new(struct xccdf_benchmark *benchmark)
Constructor of Policy Model structure.
Definition: xccdf_policy.c:1638
OSCAP_DEPRECATED
#define OSCAP_DEPRECATED(func)
This macro will warn, when a deprecated function is used.
Definition: oscap.h:50
xccdf_policy_model_add_cpe_lang_model_source
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 XC...
Definition: xccdf_policy.c:1499
xccdf_policy::xccdf_policy_get_selected_rules
struct xccdf_select_iterator * xccdf_policy_get_selected_rules(struct xccdf_policy *)
Get selected rules from policy.
Definition: xccdf_policy.c:1845
xccdf_policy::xccdf_policy_get_selects
struct xccdf_select_iterator * xccdf_policy_get_selects(const struct xccdf_policy *)
Get rules from Policy.
xccdf_benchmark
Top level XCCDF structure containing profiles, rules, values and results.
xccdf_select
XCCDF select option usen in the profile.
Definition: item.h:254
xccdf_policy_model::xccdf_policy_model_register_start_callback
bool xccdf_policy_model_register_start_callback(struct xccdf_policy_model *model, policy_reporter_start func, void *usr)
Function to register start callback for checking system that will be called BEFORE each rule evaluati...
Definition: xccdf_policy.c:1594
xccdf_item_get_files
struct oscap_stringlist * xccdf_item_get_files(struct xccdf_item *item)
Return names of files that are used in checks of particular rules.
Definition: xccdf_policy.c:1393
xccdf_check_import_iterator
Check import iterator.
Definition: xccdf_benchmark.h:539
xccdf_policy_iterator::xccdf_policy_iterator_reset
void xccdf_policy_iterator_reset(struct xccdf_policy_iterator *it)
Reset the iterator structure (it will point to the first item in the list)
xccdf_policy_engine_query_fn
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.
Definition: xccdf_policy.h:88
xccdf_policy_model_get_files
struct oscap_stringlist * xccdf_policy_model_get_files(struct xccdf_policy_model *policy_model)
Return names of files that are used in checks of particular rules.
Definition: xccdf_policy.c:2231
xccdf_policy_model::xccdf_policy_model_register_output_callback
bool xccdf_policy_model_register_output_callback(struct xccdf_policy_model *model, policy_reporter_output func, void *usr)
Function to register output callback for checking system that will be called AFTER each rule evaluati...
Definition: xccdf_policy.c:1602
xccdf_select_iterator
Select iterator.
Definition: xccdf_benchmark.h:470
xccdf_policy_model
XCCDF policy model structure contains xccdf_benchmark as reference to Benchmark element in XML file a...
Definition: xccdf_policy_priv.h:39
xccdf_policy_model::xccdf_policy_model_free
void xccdf_policy_model_free(struct xccdf_policy_model *)
Destructor of Policy Model structure.
Definition: xccdf_policy.c:2246
xccdf_policy_model::benchmark
struct xccdf_benchmark * benchmark
Benchmark element (root element of XML file)
Definition: xccdf_policy_priv.h:41
xccdf_policy::xccdf_policy_resolve
bool xccdf_policy_resolve(struct xccdf_policy *policy)
Resolve benchmark by applying all refine_rules and refine_values to rules / values of benchmark...
Definition: xccdf_policy.c:1877
xccdf_value_binding
XCCDF value binding structure is binding between Refine values, Set values, Value element and Check e...
Definition: xccdf_policy.c:76
xccdf_result
Actual results of running a XCCDF test or profile.
Definition: xccdf_benchmark.h:232
xccdf_benchmark.h
Open-scap XCCDF library interface.
xccdf_policy::xccdf_policy_is_item_selected
bool xccdf_policy_is_item_selected(struct xccdf_policy *policy, const char *id)
Get the selection settings of the item.
Definition: xccdf_policy.c:589
xccdf_test_result_type_t
xccdf_test_result_type_t
Test result.
Definition: xccdf_benchmark.h:168
xccdf_policy_model_add_cpe_lang_model
bool xccdf_policy_model_add_cpe_lang_model(struct xccdf_policy_model *model, const char *cpe_lang)
Registers an additional CPE lang model for applicability testing The one embedded in the evaluated XC...
Definition: xccdf_policy.c:1507
xccdf_policy_model::xccdf_policy_get_result_by_id
struct xccdf_result * xccdf_policy_get_result_by_id(struct xccdf_policy *policy, const char *id)
Get XCCDF Result structure by it&#39;s idetificator if there is one.
Definition: xccdf_policy.c:1610
xccdf_policy::xccdf_policy_evaluate
struct xccdf_result * xccdf_policy_evaluate(struct xccdf_policy *policy)
Call the checking engine for each selected rule in given policy structure.
Definition: xccdf_policy.c:1990
xccdf_policy_model::xccdf_policy_model_get_policy_by_id
struct xccdf_policy * xccdf_policy_model_get_policy_by_id(struct xccdf_policy_model *policy_model, const char *id)
Get XCCDF Policy from Policy model by speciefied ID of Profile.
Definition: xccdf_policy.c:1859
xccdf_policy_model_add_cpe_autodetect_source
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 ...
Definition: xccdf_policy.c:1518
xccdf_policy::xccdf_policy_add_select
bool xccdf_policy_add_select(struct xccdf_policy *, struct xccdf_select *)
Add rule to Policy.
Definition: xccdf_policy.c:1719
oscap_file_entry_iterator::oscap_file_entry_iterator_reset
void oscap_file_entry_iterator_reset(struct oscap_file_entry_iterator *it)
Definition: xccdf_policy.c:1192
xccdf_policy::xccdf_policy_get_readable_item_description
char * xccdf_policy_get_readable_item_description(struct xccdf_policy *policy, struct xccdf_item *item, const char *preferred_lang)
Get human readable description of given XCCDF Item.
Definition: xccdf_policy.c:144
xccdf_policy_model::xccdf_policy_model_add_policy
bool xccdf_policy_model_add_policy(struct xccdf_policy_model *, struct xccdf_policy *)
Add Policy to Policy Model.
xccdf_policy_model::xccdf_policy_add_result
bool xccdf_policy_add_result(struct xccdf_policy *policy, struct xccdf_result *item)
Add result to XCCDF Policy Model.
xccdf_policy::xccdf_policy_get_model
struct xccdf_policy_model * xccdf_policy_get_model(const struct xccdf_policy *policy)
Get model from Policy (parent structure of Policy to access the benchmark)
xccdf_value_type_t
xccdf_value_type_t
Type of an xccdf_value.
Definition: xccdf_benchmark.h:93
xccdf_policy_model::xccdf_policy_model_register_engine_callback
bool xccdf_policy_model_register_engine_callback(struct xccdf_policy_model *model, char *sys, void *func, void *usr)
Function to register callback for checking system.
Definition: xccdf_policy.c:1563
xccdf_policy_get_score
struct xccdf_score * xccdf_policy_get_score(struct xccdf_policy *policy, struct xccdf_result *test_result, const char *system)
Get score of the XCCDF Benchmark.
Definition: xccdf_policy.c:2081
xccdf_policy_engine_eval_fn
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
xccdf_value_binding::xccdf_value_binding_get_name
char * xccdf_value_binding_get_name(const struct xccdf_value_binding *)
Get variable name from value bindings.
xccdf_policy_model::xccdf_policy_model_get_benchmark
struct xccdf_benchmark * xccdf_policy_model_get_benchmark(const struct xccdf_policy_model *item)
Get Benchmark from Policy Model.
oscap_source
Definition: oscap_source.c:62
xccdf_policy_model_add_cpe_dict_source
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 XC...
Definition: xccdf_policy.c:1480
xccdf_policy::xccdf_policy_new
struct xccdf_policy * xccdf_policy_new(struct xccdf_policy_model *model, struct xccdf_profile *profile)
Constructor of Policy structure.
Definition: xccdf_policy.c:1772
oscap_file_entry_iterator
oscap_file_entry::oscap_file_entry_get_file
const char * oscap_file_entry_get_file(struct oscap_file_entry *entry)
Definition: xccdf_policy.c:1172
xccdf_policy_substitute
char * xccdf_policy_substitute(const char *text, struct xccdf_policy *policy)
Perform textual substitution of cdf:sub elements with respect to given XCCDF policy.
Definition: xccdf_policy_substitute.c:211
xccdf_rule_result
XCCDF rule result.
Definition: item.h:345
xccdf_policy::xccdf_policy_get_readable_item_title
char * xccdf_policy_get_readable_item_title(struct xccdf_policy *policy, struct xccdf_item *item, const char *preferred_lang)
Get human readable title of given XCCDF Item.
Definition: xccdf_policy.c:132
xccdf_policy::xccdf_policy_get_select_by_id
struct xccdf_select * xccdf_policy_get_select_by_id(struct xccdf_policy *policy, const char *item_id)
Get select from policy by specified ID of XCCDF Item.
Definition: xccdf_policy.c:1838
xccdf_value_binding::xccdf_value_binding_new
struct xccdf_value_binding * xccdf_value_binding_new(void)
Constructor of structure with profile bindings - refine_rules, refine_values and set_values.
Definition: xccdf_policy.c:1814
xccdf_value_binding::xccdf_value_binding_get_type
xccdf_value_type_t xccdf_value_binding_get_type(const struct xccdf_value_binding *)
get variable type from value bindings
xccdf_policy::xccdf_policy_set_selected
bool xccdf_policy_set_selected(struct xccdf_policy *policy, char *idref)
Set a new selector to the Policy structure.
Definition: xccdf_policy.c:1852
xccdf_rule
XCCDF rule defines a test execution.
Definition: xccdf_benchmark.h:214
xccdf_policy_model_add_cpe_autodetect
bool xccdf_policy_model_add_cpe_autodetect(struct xccdf_policy_model *model, const char *filepath)
Registers an additional CPE resource (either dictionary or language) Autodetects given file and acts ...
Definition: xccdf_policy.c:1526
xccdf_policy::model
struct xccdf_policy_model * model
XCCDF Policy model.
Definition: xccdf_policy_priv.h:60
xccdf_policy::xccdf_policy_get_profile
struct xccdf_profile * xccdf_policy_get_profile(const struct xccdf_policy *)
Get XCCDF Profile from Policy.
xccdf_policy_iterator::xccdf_policy_iterator_free
void xccdf_policy_iterator_free(struct xccdf_policy_iterator *it)
Free the iterator structure (it makes no changes to the list structure)
xccdf_policy::xccdf_policy_get_values
struct xccdf_value_binding_iterator * xccdf_policy_get_values(const struct xccdf_policy *item)
Get Value Bindings from XCCDF Policy.
xccdf_policy_iterator::xccdf_policy_iterator_next
struct xccdf_policy * xccdf_policy_iterator_next(struct xccdf_policy_iterator *it)
Return the next xccdf_policy structure from the list and increment the iterator.
xccdf_value_binding::xccdf_value_binding_free
void xccdf_value_binding_free(struct xccdf_value_binding *)
Destructor of Value binding structure.
Definition: xccdf_policy.c:2280
oscap_file_entry_iterator::oscap_file_entry_iterator_next
const struct oscap_file_entry * oscap_file_entry_iterator_next(struct oscap_file_entry_iterator *it)
Definition: xccdf_policy.c:1177
xccdf_policy_model::xccdf_policy_get_results
struct xccdf_result_iterator * xccdf_policy_get_results(const struct xccdf_policy *policy)
Get results of all XCCDF Policy results.
xccdf_test_result_resolve_and_operation
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.
Definition: xccdf_policy.c:307
xccdf_profile
XCCDF profile is a set of tests and their settings in a compact package.
Definition: xccdf_benchmark.h:202
xccdf_policy_iterator::xccdf_policy_iterator_has_more
bool xccdf_policy_iterator_has_more(struct xccdf_policy_iterator *it)
Return true if the list is not empty, false otherwise.
oscap_file_entry::oscap_file_entry_new
struct oscap_file_entry * oscap_file_entry_new(void)
Definition: xccdf_policy.c:1143
xccdf_policy
XCCDF policy structure is abstract (class) structure of Profile element from benchmark.
Definition: xccdf_policy_priv.h:58
xccdf_policy_model_get_cpe_oval_sessions
struct oscap_htable_iterator * xccdf_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 h...
Definition: xccdf_policy.c:1534
xccdf_policy_recalculate_score
int xccdf_policy_recalculate_score(struct xccdf_policy *policy, struct xccdf_result *test_result)
Recalculate score of the XCCDF Benchmark.
Definition: xccdf_policy.c:2087
xccdf_policy_model::xccdf_policy_model_register_engine_and_query_callback
bool xccdf_policy_model_register_engine_and_query_callback(struct xccdf_policy_model *model, char *sys, xccdf_policy_engine_eval_fn eval_fn, void *usr, xccdf_policy_engine_query_fn query_fn)
Function to register callback for checking system.
Definition: xccdf_policy.c:1566
xccdf_policy_engine_query_t
xccdf_policy_engine_query_t
Type of a query over checking-engine data.
Definition: xccdf_policy.h:70
xccdf_policy_get_selected_rules_count
int xccdf_policy_get_selected_rules_count(struct xccdf_policy *policy)
Retrieves number of selected items in the policy.
Definition: xccdf_policy.c:602
xccdf_policy::xccdf_policy_add_value
bool xccdf_policy_add_value(struct xccdf_policy *, struct xccdf_value_binding *)
Add value binding to the Policy structure.
oscap_file_entry::oscap_file_entry_dup
struct oscap_file_entry * oscap_file_entry_dup(struct oscap_file_entry *file_entry)
Definition: xccdf_policy.c:1149
xccdf_value_binding::xccdf_value_binding_get_value
char * xccdf_value_binding_get_value(const struct xccdf_value_binding *)
Get value from value bindings.
xccdf_policy::profile
struct xccdf_profile * profile
Profile structure (from benchmark)
Definition: xccdf_policy_priv.h:61
oscap_file_entry::oscap_file_entry_get_system
const char * oscap_file_entry_get_system(struct oscap_file_entry *entry)
Definition: xccdf_policy.c:1167
xccdf_policy_model_add_cpe_dict
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 XC...
Definition: xccdf_policy.c:1488
xccdf_policy_tailor_item
struct xccdf_item * xccdf_policy_tailor_item(struct xccdf_policy *policy, struct xccdf_item *item)
Clone the item and tailor it against given policy (profile)
Definition: xccdf_policy.c:2155
xccdf_result_iterator
Result iterator.
Definition: xccdf_benchmark.h:456
xccdf_value_binding::xccdf_value_binding_get_setvalue
char * xccdf_value_binding_get_setvalue(const struct xccdf_value_binding *)
get Set Value from value bindings
xccdf_item
A base class for XCCDF items.
Definition: item.h:221
oscap_file_entry
Definition: xccdf_policy.c:1138
oscap_file_entry_iterator::oscap_file_entry_iterator_free
void oscap_file_entry_iterator_free(struct oscap_file_entry_iterator *it)
Definition: xccdf_policy.c:1187
xccdf_policy::xccdf_policy_get_id
const char * xccdf_policy_get_id(struct xccdf_policy *policy)
Get ID of XCCDF Profile that is implemented by XCCDF Policy.
Definition: xccdf_policy.c:1547