Skip to content
Merged
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
12 changes: 11 additions & 1 deletion cfbs/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,17 @@ def to_json_dict(self):
return json_dict


DEFAULT_IGNORED_PATH_COMPONENTS = [".git/", ".gitignore", ".gitattributes", ".github/"]
DEFAULT_IGNORED_PATH_COMPONENTS = [
# VCS files - Git:
".git/",
".gitignore",
".gitattributes",
# infrastructure configuration files - GitHub:
".github/",
# CFEngine policy distribution generated files:
"cf_promises_release_id",
"cf_promises_validated",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, those file are generated. But, in fact I would call this out as a warning I guess.

If those files are present in /var/cfengine/masterfiles on an installed host fine, expected. But, if those files are for example in the root of your repo and you were deploying it to hosts then it would cause an active problem with policy distribution and updates.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. But how can we tell? Normally, I'd say "check for these files, if they are present, it's a live set on a hub" 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, probably a bit difficult / out of scope for cfbs analyze. Just looking at you using it yesterday, you copied the folder to a tmp dir before running analyze, so not really a good way of knowing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the only place that they are expected is WORKDIR/masterfiles. So, cfbs could try to call cf-promises or something to drive where workdir is (and assume /var/cfengine/mastefiles or I guess perhaps /etc/cfengine/masterfiles would be the FHS location).

It's really unlikely for that to happen in a cfbs managed policy set, we can let it go. cfbs convert when it exists won't make them part of the policy set.

]


def analyze_policyset(
Expand Down