bottlerocket-os / bottlerocket-os/bottlerocket-core-kit

Cannot build selinux policy extensions from the bottlerocket main policy package

Open
#332 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
34
Forks
77
Avg merge
2d 23h
Merged PRs (30d)
23

Description

**What I expected to happen:**
I expected to be able to depend on the bottlerocket `selinux-policy` package to extend and add policies.

**What actually happened:**
Since `selinux-policy` installs `/etc/selinux` it conflicts with the `libsemanage` package that is already installed in the SDK.

```
#13 0.221 --repofrompath=bottlerocket-bottlerocket-core-kit,/bypass/build/external-kits/bottlerocket/bottlerocket-core-kit/x86_64 --enablerepo bottlerocket-bottlerocket-core-kit --repofrompath=bottlerocket-bottlerocket-kernel-kit,/bypass/build/external-kits/bottlerocket/bottlerocket-kernel-kit/x86_64 --enablerepo bottlerocket-bottlerocket-kernel-kit
#13 0.483 Added repo repo from ./rpmbuild/RPMS
#13 0.483 Added bottlerocket-bottlerocket-core-kit repo from /bypass/build/external-kits/bottlerocket/bottlerocket-core-kit/x86_64
#13 0.483 Added bottlerocket-bottlerocket-kernel-kit repo from /bypass/build/external-kits/bottlerocket/bottlerocket-kernel-kit/x86_64
#13 0.546 repo 44 kB/s | 241 B 00:00
#13 0.558 bottlerocket-bottlerocket-core-kit 19 MB/s | 127 kB 00:00
#13 0.611 bottlerocket-bottlerocket-kernel-kit 19 MB/s | 132 kB 00:00
#13 0.928 Package secilc-3.5-2.fc39.x86_64 is already installed.
#13 0.947 Dependencies resolved.
#13 0.955 ==================================================================================================================
#13 0.955 Package Arch Version Repository Size
#13 0.955 ==================================================================================================================
#13 0.955 Installing:
#13 0.955 bottlerocket-selinux-policy x86_64 1:0.0-1.1734718075.9b8be026.br1 bottlerocket-bottlerocket-core-kit 52 k
#13 0.955
#13 0.955 Transaction Summary
#13 0.955 ==================================================================================================================
#13 0.955 Install 1 Package
#13 0.955
#13 0.955 Total size: 52 k
#13 0.956 Installed size: 159 k
#13 0.956 Downloading Packages:
#13 0.956 Running transaction check
#13 0.960 Transaction check succeeded.
#13 0.960 Running transaction test
#13 0.991 Error: Transaction test error:
#13 0.991 file /etc/selinux from install of bottlerocket-selinux-policy-1:0.0-1.1734718075.9b8be026.br1.x86_64 conflicts with file from package libsemanage-3.5-4.fc39.x86_64
```

**How to reproduce the problem:**
Try building a package that has a `BuildRequires` on `selinux-policy` and it will fail on conflicting file on `/etc/selinux`.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure by building a package with a BuildRequires on selinux-policy in the Bottlerocket SDK. Inspect the selinux-policy and libsemanage package contents, then verify that the package can be installed without a /etc/selinux conflict and that the dependent policy extension builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
build-system, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.