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

validate-appconfig.py: Add further validations. #816

Merged
merged 9 commits into from
Oct 11, 2024

Conversation

pebenito
Copy link
Member

@pebenito pebenito commented Oct 4, 2024

New validations:

  • default_type
  • failsafe_context
  • default_contexts
  • seuser default_contexts

Additionally add GitHub annotations to logging.

@pebenito pebenito force-pushed the validate-appconfig-more branch 2 times, most recently from 065595f to 8916695 Compare October 5, 2024 12:16
Results in ouput such as:

Validating refpolicy appconfig.
tmp/appconfig/default_contexts: Warning: Invalid source domain: staff_r:staff_su_t:s0.
tmp/appconfig/default_contexts: Warning: Invalid source domain: user_r:user_su_t:s0.
tmp/appconfig/default_contexts: Warning: Invalid source domain: user_r:user_sudo_t:s0.
tmp/appconfig/user_u_default_contexts: Warning: No valid target domains for system_r:crond_t:s0
tmp/appconfig/user_u_default_contexts: Warning: Invalid source domain: user_r:user_su_t:s0.
tmp/appconfig/user_u_default_contexts: Warning: Invalid source domain: user_r:user_sudo_t:s0.
tmp/appconfig/root_default_contexts: Warning: No valid target domains for system_r:crond_t:s0
tmp/appconfig/root_default_contexts: Warning: Invalid source domain: staff_r:staff_su_t:s0.
tmp/appconfig/root_default_contexts: Warning: Invalid source domain: user_r:user_su_t:s0.
tmp/appconfig/staff_u_default_contexts: Warning: No valid target domains for system_r:crond_t:s0
tmp/appconfig/staff_u_default_contexts: Warning: Invalid source domain: staff_r:staff_su_t:s0.
tmp/appconfig/xguest_u_default_contexts: Warning: Invalid user xguest_u: Skipping validation.
tmp/appconfig/unconfined_u_default_contexts: Warning: No valid target domains for system_r:init_t:s0
tmp/appconfig/unconfined_u_default_contexts: Warning: Source domain system_r:initrc_t:s0 not in default_contexts.
tmp/appconfig/unconfined_u_default_contexts: Warning: No valid target domains for system_r:remote_login_t:s0
tmp/appconfig/unconfined_u_default_contexts: Warning: Source domain system_r:rshd_t:s0 not in default_contexts.
tmp/appconfig/unconfined_u_default_contexts: Warning: Invalid source domain: system_r:sysadm_su_t:s0.
tmp/appconfig/unconfined_u_default_contexts: Warning: Source domain system_r:unconfined_t:s0 not in default_contexts.
tmp/appconfig/xdm_default_contexts: Warning: No valid target domains for system_r:xdm_t:s0
tmp/appconfig/xdm_default_contexts: Error: No valid lines.
tmp/appconfig/guest_u_default_contexts: Warning: Invalid user guest_u: Skipping validation.
make: *** [Rules.monolithic:250: validate] Error 1

Signed-off-by: Chris PeBenito <[email protected]>
Add PYTHONPATH to the environment.  The PYTHONPATH manipulation done
by the Makefiles causes the pip install location to be lost from
the path, and the setools module won't load.

Signed-off-by: Chris PeBenito <[email protected]>
Remove unnecessary role definition in kernel.te.

Signed-off-by: Chris PeBenito <[email protected]>
Signed-off-by: Chris PeBenito <[email protected]>
@pebenito pebenito force-pushed the validate-appconfig-more branch 2 times, most recently from df53554 to 4bd1158 Compare October 5, 2024 18:11
@pebenito
Copy link
Member Author

pebenito commented Oct 8, 2024

@perfinion or @0xC0ncord can you try this out? I imagine binary distros wouldn't have a problem with (optionally) having setools during build, but as Gentoo is source...

Signed-off-by: Chris PeBenito <[email protected]>
This is not the code under test; only recompile when needed.

Signed-off-by: Chris PeBenito <[email protected]>
@pebenito pebenito force-pushed the validate-appconfig-more branch from 5c7a8ef to b6cd1ee Compare October 10, 2024 18:55
@pebenito pebenito merged commit 3d0b229 into SELinuxProject:main Oct 11, 2024
117 checks passed
@pebenito pebenito deleted the validate-appconfig-more branch October 11, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant