Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENT-12099] Initial implementation of an experimental feature of policy set analysis #218

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jakub-nt
Copy link
Contributor

No description provided.

@cf-bottom
Copy link

Thanks for submitting a PR! Maybe @craigcomstock can review this?

@olehermanse olehermanse self-requested a review January 23, 2025 17:08
Copy link
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

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

a few questions/comments, all looks good-to-go except maybe moving the release-information checksum into a separate file, that might be a nice change for maintenance purposes.

fetch_archive(RI_ARCHIVE_URL, RI_SHA1_CHECKSUM, with_index=False)
# TODO the release information checksum needs to be updated on each new release
# currently, if the checksum is not manually updated, the old, already downloaded files will continue to be used
# and if the old files have not already been downloaded, the download from GitHub will fail
Copy link
Contributor

Choose a reason for hiding this comment

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

Right. So when we release we need to update this.
We need to add instructions to this template ticket for releases: https://northerntech.atlassian.net/browse/ENT-12575

Copy link
Contributor

Choose a reason for hiding this comment

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

I added a note already referring to line 83 above but we should update it after merging this PR to the "real" location/URL. Maybe it would be better to externalize this checksum in a single file for easier maintenance so folks could just "edit file" in github and make a PR without having to search through analyze.py?

Copy link
Member

Choose a reason for hiding this comment

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

@craigcomstock @jakub-nt no, we should not do it like this. As it's implemented here, cfbs analyze essentially stops working in all versions of cfbs when we release something new in release-information, and we have to release a new version of cfbs to fix it.

Keep in mind that HTTPS already has signatures and thus integrity checking, and so should be protected against corrupt downloads / MITM attacks. So what we are doing here is an additional check, to protect against for example a compromised user having access to edit the data in GitHub.

The correct way to do this is via some form of "releases". Either GH releases, with a download zip and a checksums.txt - assuming that they are a bit better protected, i.e. fewer people have access to edit releases. Or to avoid the single point of failure in GitHub, we could put the checksums.txt in another place, like our cfengine.com website, via the releases.json.

cfbs/analyze.py Outdated Show resolved Hide resolved
cfbs/analyze.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants