macOS
brew install libselinuxlocal Homebrew formula metadata
安装
brew install libselinuxlocal Homebrew formula metadata
sudo apk add libselinuxAlpine Linux edge package indexes · libselinux · 来源: dl-cdn.alpinelinux.org
sudo dnf install libselinuxFedora Rawhide package metadata · libselinux · 来源: dl.fedoraproject.org
nix profile install nixpkgs#libselinuxnixpkgs package indexes · pkgs/by-name/li/libselinux/package.nix · 来源: api.github.com
sudo apt install libselinux1Debian stable package indexes · libselinux1 · 来源: deb.debian.org
sudo zypper install libselinux-developenSUSE Tumbleweed package metadata · libselinux-devel · 来源: download.opensuse.org
概览
SELinux library and simple utilities
历史
libselinux is the runtime library and small utility layer used by SELinux-aware programs to talk to SELinux kernel APIs, inspect labels, and perform access-control checks. In package terms it is the userland ABI that turns SELinux from a kernel feature into something daemons, init systems, login tools, package scripts, and administrators can actually use.
SELinux began as a National Security Agency research effort around flexible mandatory access control for Linux. NSA documentation from 2001 describes the original SELinux kernel patch for Linux 2.2 and the later Linux Security Module implementation. The modern SELinuxProject userspace repository collects the libraries and tools that complement the kernel feature, including libselinux, libsepol, libsemanage, policycoreutils, and related utilities.
Within that stack, libselinux became the runtime interface for applications that need SELinux context and policy services. The upstream userspace package notes describe libselinux as providing library functions for SELinux kernel APIs such as getcon(), plus support functions such as getseuserbyname(), and note that it may use libsepol when loading policy.
The upstream SELinux README describes SELinux as present in many major Linux distributions and says the userspace libraries and tools are packaged by Alpine, Debian and Ubuntu, Gentoo, Fedora and RHEL, SLES and openSUSE, Yocto, and others. That made libselinux a quiet but widely depended-on system library rather than an application users install for its own UI.
The userspace packages wiki points to package-manager reverse dependency queries for libselinux as a way to find SELinux-modified programs, and lists init systems, PAM, OpenSSH, cron, sudo, shadow-utils, and other core packages as historical examples of SELinux-aware integration points.
Administrators encounter libselinux through utilities such as getenforce, setenforce, getfilecon, setfilecon, matchpathcon, selinuxenabled, and getsebool. Developers encounter it as the C library used by programs that need to read process and file contexts, ask whether SELinux is enabled, or evaluate an SELinux permission decision.
On macOS via Homebrew it is mainly useful for policy analysis and tooling experiments, not for enabling the Linux kernel SELinux enforcement path.
libselinux is one of those packages whose importance is mostly visible through dependency graphs: if SELinux support is compiled into system software, this library is often the shared object that appears in the linkage. It is also a good example of how Linux security features split across kernel APIs, policy compilers, runtime libraries, and distro packaging.
For Homebrew users, libselinux is interesting because it brings a Linux security userland component onto macOS mostly as a build dependency and analysis library, exposing the portability boundary between SELinux policy tooling and actual SELinux enforcement.
安全态势
library-like package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
avcstat | cli | 全局可执行文件 | |
compute_av | cli | 全局可执行文件 | |
compute_create | cli | 全局可执行文件 | |
compute_member | cli | 全局可执行文件 | |
compute_relabel | cli | 全局可执行文件 | |
getconlist | cli | 全局可执行文件 | |
getdefaultcon | cli | 全局可执行文件 | |
getenforce | cli | 全局可执行文件 | |
getfilecon | cli | 全局可执行文件 | |
getpidcon | cli | 全局可执行文件 | |
getpidprevcon | cli | 全局可执行文件 | |
getpolicyload | cli | 全局可执行文件 | |
getsebool | cli | 全局可执行文件 | |
getseuser | cli | 全局可执行文件 | |
matchpathcon | cli | 全局可执行文件 | |
policyvers | cli | 全局可执行文件 | |
sefcontext_compile | cli | 全局可执行文件 | |
selabel_compare | cli | 全局可执行文件 | |
selabel_digest | cli | 全局可执行文件 | |
selabel_get_digests_all_partial_matches | cli | 全局可执行文件 | |
selabel_lookup | cli | 全局可执行文件 | |
selabel_lookup_best_match | cli | 全局可执行文件 | |
selabel_partial_match | cli | 全局可执行文件 | |
selinux_check_access | cli | 全局可执行文件 | |
selinux_check_securetty_context | cli | 全局可执行文件 | |
selinuxenabled | cli | 全局可执行文件 | |
selinuxexeccon | cli | 全局可执行文件 | |
setenforce | cli | 全局可执行文件 | |
setfilecon | cli | 全局可执行文件 | |
togglesebool | cli | 全局可执行文件 | |
validatetrans | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://github.com/SELinuxProject/selinux
安装元数据
| 软件包键 | brew:libselinux |
|---|---|
| 版本 | 3.11 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/libselinux |
| 主页 | https://github.com/SELinuxProject/selinux |
| 仓库 | https://github.com/SELinuxProject/selinux |
| 上游文档 | https://github.com/SELinuxProject/selinux/wiki |
| 许可证 | LicenseRef-Homebrew-public-domain |
| 源码归档 | https://github.com/SELinuxProject/selinux/releases/download/3.11/libselinux-3.11.tar.gz |
| 最后更新 | 2026-07-01T18:24:07Z |
| Pulse | updated |
| 依赖 | libsepol, pcre2 |
| 构建依赖 | pkgconf |
| Bottle | 可用 (于 arm64_linux, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | libselinux |
| Version Scheme | 0 |
| Revision | 0 |
| Requirements |
|
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
libselinux1 3.8.1-1
SELinux runtime shared libraries
https://github.com/SELinuxProject
sudo apt install libselinux1libselinux1-dev 3.8.1-1
SELinux development headers
https://github.com/SELinuxProject
sudo apt install libselinux1-devpython3-selinux 3.8.1-1
Python3 bindings to SELinux shared libraries
https://github.com/SELinuxProject
sudo apt install python3-selinuxruby-selinux 3.8.1-1
Ruby bindings to SELinux shared libraries
https://github.com/SELinuxProject
sudo apt install ruby-selinuxselinux-utils 3.8.1-1
SELinux utility programs
https://github.com/SELinuxProject
sudo apt install selinux-utilslibselinux
nix profile install nixpkgs#libselinuxlibselinux1 3.5-2ubuntu2
SELinux runtime shared libraries
sudo apt install libselinux1libselinux1-dev 3.5-2ubuntu2
SELinux development headers
sudo apt install libselinux1-devpython3-selinux 3.5-2ubuntu2
Python3 bindings to SELinux shared libraries
sudo apt install python3-selinuxruby-selinux 3.5-2ubuntu2
Ruby bindings to SELinux shared libraries
sudo apt install ruby-selinuxselinux-utils 3.5-2ubuntu2
SELinux utility programs
sudo apt install selinux-utilslibselinux 3.10-r1
SELinux library and simple utilities
https://github.com/SELinuxProject/selinux/wiki
sudo apk add libselinuxlibselinux-dev 3.10-r1
SELinux library and simple utilities (development files)
https://github.com/SELinuxProject/selinux/wiki
sudo apk add libselinux-devlibselinux-doc 3.10-r1
SELinux library and simple utilities (documentation)
https://github.com/SELinuxProject/selinux/wiki
sudo apk add libselinux-doclibselinux-static 3.10-r1
SELinux library and simple utilities (static library)
https://github.com/SELinuxProject/selinux/wiki
sudo apk add libselinux-staticlibselinux-utils 3.10-r1
SELinux libselinux utilies
https://github.com/SELinuxProject/selinux/wiki
sudo apk add libselinux-utils来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.