-
Notifications
You must be signed in to change notification settings - Fork 578
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
Profile Checks #4643
Profile Checks #4643
Conversation
322279f
to
4054f63
Compare
590dd89
to
225909d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
etc/profile-checks/private-etc-always-required.sh etc/profile-checks/sort-disable-programs.sh etc/profile-checks/sort-firecfg.config.sh etc/profile-checks/sort.py
GitHub takes a while to load the PR review page (as this changes >200 files)
and the above files (which are the most relevant to this PR IMO) are kind of
lost in the middle of it, given the sort order of:
- profile-a-l
- profile-checks
- profile-m-z
I think it would make sense to put all ci-related files (including for linting
and error-checking) in their own base directory, such as a new ci/ dir.
Example:
ci/etc/private-etc-always-required.sh ci/etc/sort-disable-programs.sh ci/etc/sort-firecfg.config.sh ci/etc/sort.py
Misc: I put ci/etc/ in the example because firecfg.config is not a profile and
because we could also later add tests for things in etc/apparmor/ and whatever
else is in etc/.
As for the related pre-existing directories:
test/ would maybe also make sense for that, though it is composed solely of
tests related to firejail itself (AFAIK), and they are right at the root, so a
dir just for profile tests wouldn't be very apparent in there.
contrib/ is currently where sort.py is, though I think that it would make more
sense to put new such files in a separate directory instead, as they only deal
with files that are specific to firejail (and no other tool). I think contrib/
makes sense for things like shell completion, syntax highlighting and
distro-specific files (and possibly third-party scripts/helpers).
P.S. I'm writing some more review comments; this is just the main one.
There's a Commits tab 😉
👍 I think I will go with just ci/ (no etc) or ci-tests/. |
6b630a3
to
36908d8
Compare
36908d8
to
cbbe0ec
Compare
Before I forget, I'll say that these checks are very helpful for reviewing and I had tried doing that many months ago, but I got a little carried away with In any case, this could be merged as is by me. The following can be discussed @rusty-snake commented on Oct 27:
Nice, I didn't know reviews could be done from there directly.
I think something like plain ci/ would be nice to later keep other
Some scripts could be later integrated in githooks, to be able to automatically Shorter names would also make it easier to use from the cli (though I'd like to |
Makes sense, though I would put the test in a sub dir
|
@rusty-snake commented on Oct 29:
Sounds good.
The last one looks neat, but to be pedantic, by profile testing, what mostly
Then we could have something like:
And maybe later something like Or:
With e.g.: Or:
With e.g.: Alternatively, I think it would also make sense to put all in e.g.:
|
cbbe0ec
to
82ca80c
Compare
82ca80c
to
0aa6664
Compare
This check was broken by commit 34d0048 ("private-etc: corss-distro test for curl, gimp, inkscape, firefox, warzone2100", 2023-01-28). private-etc is currently being reworked and the files in question may no longer be required. Output of running the check: $ ./ci/check/profiles/private-etc-always-required.sh etc/inc/*.inc etc/{profile-a-l,profile-m-z}/*.profile etc/profile-a-l/curl.profile misses alternatives etc/profile-a-l/curl.profile misses ld.so.cache etc/profile-a-l/curl.profile misses ld.so.preload etc/profile-a-l/firefox-common.profile misses alternatives etc/profile-a-l/firefox-common.profile misses ld.so.cache etc/profile-a-l/firefox-common.profile misses ld.so.preload etc/profile-a-l/gimp.profile misses alternatives etc/profile-a-l/gimp.profile misses ld.so.cache etc/profile-a-l/gimp.profile misses ld.so.preload etc/profile-a-l/inkscape.profile misses alternatives etc/profile-a-l/inkscape.profile misses ld.so.cache etc/profile-a-l/inkscape.profile misses ld.so.preload etc/profile-m-z/warzone2100.profile misses alternatives etc/profile-m-z/warzone2100.profile misses ld.so.cache etc/profile-m-z/warzone2100.profile misses ld.so.preload Relates to #4643 #5610.
Currently the CI check does not consider certain special characters (such as `-`) when sorting due to `sort -d`. So remove `-d`, sort firecfg using `LC_ALL=C` and enforce that order. Also add `sort -u` to check for duplicates. This also allows the CI check to ignore normal comments (lines starting with `# `) anywhere in the file. Relates to netblue30#4643.
First three commits fix things so CI can pass:
The last commit (225909d) adds Profile Checks. For now I added four check but once we have this infrastructure for profile checks it is easier to add more in follow-up PRs.
private-etc
(ATOW that arealternatives ld.so.cache ld.so.preload
). It can not check redirect profiles, therefore some files are double allowed if both profile (redirect profile and redirected profile) contain aprivate-etc
line. Anyway nothing bad will happen.~/.cache
as this complicates sorting without advantages.Possible follow-up PRs:
whitelist ${HOME}/...
without wcprivate-etc
containing every necessary network files (for networking progrms)machine-id
but nonosound
cc @jose1711