Skip to content
Closed

CFE4708 #3203

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions cfe_internal/update/update_policy.cf
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,18 @@ bundle agent cfe_internal_update_policy_cpv
comment => "Directory containing CFEngine modules",
handle => "cfe_internal_update_policy_vars_modules_dir";

windows::
"cfbs_dir_source"
string => "/var/cfengine/masterfiles/services/cfbs",
comment => "Directory containing currently deployed cfbs-project",
handle => "cfe_internal_update_policy_vars_cfbs_dir_windows";

!windows::
"cfbs_dir_source"
string => translatepath("$(master_location)/services/cfbs"),
comment => "Directory containing currently deployed cfbs-project",
handle => "cfe_internal_update_policy_vars_cfbs_dir";

any::
"file_check"
string => translatepath("$(inputs_dir)/promises.cf"),
Expand Down Expand Up @@ -273,6 +285,14 @@ bundle agent cfe_internal_update_policy_cpv
depth_search => u_recurse("inf"),
action => u_immediate;

# Note: similarly for files inside a cfbs-project
"$(inputs_dir)/services/cfbs"
comment => "Copy any files from cfbs-project on policy server if a new validation was acquired",
handle => "cfe_internal_update_policy_files_cfbs_dir",
copy_from => u_rcp("$(cfbs_dir_source)", @(update_def.policy_servers)),
depth_search => u_recurse("inf"),
action => u_immediate;

update_inputs_not_kept::
"$(inputs_dir)/cf_promises_validated" -> { "CFE-2587" }
delete => u_tidy,
Expand Down Expand Up @@ -546,12 +566,13 @@ body file_select u_cf3_files

#########################################################
body file_select u_input_files
# @brief Select files by extension that we should include when updating inputs
# @brief Select files by extension, or explicit path, that we should include when updating inputs
{
leaf_name => {
@(update_def.input_name_patterns), @(update_def.input_name_patterns_extra)
};
file_result => "leaf_name";
path_name => { @(update_def.input_paths_extra) };
file_result => "leaf_name|path_name";
}

#########################################################
Expand Down
9 changes: 9 additions & 0 deletions controls/update_def.cf.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ bundle common update_def
comment => "Additional filename patterns to copy during policy update.",
if => not( isvariable( "input_name_patterns_extra" ) );

"input_paths_extra" -> { "CFE-4708" }
slist => {},
comment => "Additional file paths (regex, matched against the full
path via file_select's path_name) to copy during policy
update, regardless of input_name_patterns[_extra]. Lets a
specific file be included without widening the
extension-based patterns for the whole policy set.",
if => not( isvariable( "input_paths_extra" ) );

# the permissions for your masterfiles files (not dirs), which will propagate to inputs
"masterfiles_perms_mode_not_dir" -> { "CFE-951" }
string => "0600",
Expand Down
Loading