coreos / coreos/coreos-assembler

Fail test on SELinux denials and export audit.log if any found

Open
#3,837 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

jira
Dominant language
Go
Stars
393
Forks
193
Avg merge
17h 6m
Merged PRs (30d)
5

Description

The selinux-policy maintainers sometimes set new rules to permissive to give users time to report denials and fix those before flipping the switch to enforcing. We haven't been noticing the new denials until the switch to enforcing happens because we currently don't report tests with SELinux denials as failing. We should fix that.

Also, when reporting denials to the policy maintainers, it's helpful to them to include the audit logs. So we need to archive that information too alongside the console and journal.

There's a lot of discussions and code in https://github.com/coreos/coreos-assembler/pull/2067 related to this.

Briefly:

  1. after a test completes, export out audit.log from the machine
  2. in the same area we check for unit failures, also check for SELinux denials in the audit logs
  3. if denials are found, export out audit.log to the outputdir for that test and mark the test as failed
  4. add a new kola test tag that allows skipping selinux denial checking, and use it for tests that may purposely trigger them
  5. make it possible to skip only selinux denials via kola-denylist.yaml

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the discussion and code in coreos-assembler PR 2067, then trace the Kola test handling around unit failures and output archives. Inspect kola-denylist.yaml and the proposed Kola test tag behavior. Done means audit.log is exported, SELinux denials fail tests unless explicitly skipped, and the denylist supports skipping only denial checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
security, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.