Go to file
Chris PeBenito 1b3ce1bd81
Merge pull request #139 from pebenito/fix-ci-tests
Fix ci tests
2024-10-28 13:38:40 -04:00
.github/workflows seinfoflow/sedta: Add graphical output files. 2024-02-14 09:11:35 -05:00
man Fix typos 2024-10-01 17:25:26 +02:00
patches Remove old patches. 2018-08-26 18:22:13 -04:00
setools Type: Stabilize attribute and alias output in statements. 2024-10-28 13:21:51 -04:00
setoolsgui Fix typos 2024-10-01 17:25:26 +02:00
tests tests/conftest.py: Work around apparent mypy issue. 2024-10-28 13:21:58 -04:00
.gitignore .gitignore: Add VS Code and tox venv directories. 2020-10-14 10:16:54 -04:00
COPYING Refine COPYING text. 2021-11-20 14:32:33 -05:00
COPYING.GPL Initial public release. 2014-07-08 14:28:55 -04:00
COPYING.LGPL Initial public release. 2014-07-08 14:28:55 -04:00
ChangeLog Fix typos 2024-10-01 17:25:26 +02:00
KNOWN-BUGS Update KNOWN-BUGS 2018-11-10 08:44:10 -05:00
MANIFEST.in MANIFEST.in: Fix typos. 2020-12-10 15:51:33 -05:00
README.md seinfoflow/sedta: Add graphical output files. 2024-02-14 09:11:35 -05:00
apol CLI: Always show a traceback for AssertionErrors. 2024-02-14 09:11:35 -05:00
pyproject.toml setup.py: Move static definitions to pyproject.toml. 2024-04-23 10:38:11 -04:00
sechecker Replace str.format() with f-strings. 2024-04-02 15:36:38 -04:00
sediff Fix typos 2024-10-01 17:25:26 +02:00
sedta seinfoflow/sedta: Add graphical output files. 2024-02-14 09:11:35 -05:00
seinfo seinfo: Fix incorrect target platform check. 2024-04-18 18:54:00 -04:00
seinfoflow seinfoflow/sedta: Add graphical output files. 2024-02-14 09:11:35 -05:00
sesearch CLI: Always show a traceback for AssertionErrors. 2024-02-14 09:11:35 -05:00
setup.py setup.py: Clean up implementation. 2024-04-23 10:38:13 -04:00
tox.ini tox.ini: Add file listing to install test. 2024-04-23 10:26:22 -04:00

README.md

SETools: Policy analysis tools for SELinux

Overview

This file describes SETools. SETools is a collection of graphical tools, command-line tools, and libraries designed to facilitate SELinux policy analysis. Please consult the KNOWN-BUGS file prior to reporting bugs.

Installation

SETools uses the Python setuptools build system to build, and install. As such it contains a setup.py script that will install the tools.

To run SETools command line tools, the following packages are required:

  • Python 3.10+
  • NetworkX 2.6+
  • pygraphviz
  • setuptools
  • libselinux
  • libsepol 3.2+

To run SETools graphical tools, the following packages are also required:

  • PyQt6

To build SETools, the following development packages are required, in addition to the development packages from the above list:

  • gcc
  • cython 0.29.14

To run SETools unit tests, the following packages are required, in addition to the above dependencies:

  • pytest
  • tox (optional)

Obtaining SETools

SETools is included in most Linux distributions which support SELinux, such as Fedora, Red Hat Enterprise Linux, Gentoo, and Debian.

Official releases of SETools may be freely downloaded from the GitHub releases page.

SETools source code is maintained within a GitHub repository. From the command line do:

  $ git clone https://github.com/SELinuxProject/setools.git

You may also browse the GitHub repository. The master branch has development code that may not be stable. Each release series is considered stable, and has its own branch, e.g. "4.0" for all 4.0.* releases. To checkout a stable branch, do:

  $ git checkout 4.0

Where 4.0 is the release series. Each release will have a tag.

Building SETools for Local Use

To use SETools locally, without installing it onto the system, unpack the official distribution or check out the git repository, and perform the following at the root:

  $ python setup.py build_ext -i

This will compile the C portion of SETools locally, and then the tools can be ran from the current directory (e.g. ./seinfo).

Rebuilding the Apol Help File

For convenience, a prebuilt copy of the apol help data file is included. To rebuild this file, the Qt5 development tools are required (particularly, the qcollectiongenerator tool). At the root of the SETools sources, perform the following:

  $ python setup.py build_qhc

Installing SETools

Unpack the official distribution or check out the git repository, and perform the following at the root:

  $ python setup.py build_ext
  $ python setup.py build
  $ python setup.py install

This will put the applications in /usr/bin, data files in /usr/share/setools, and libraries in /usr/lib/pythonX.Y/site-packages/setools.

Building SETools with a Local Libsepol and Libselinux

At times, SETools requires a newer libsepol than is available from distributions. To use a locally-built libsepol instead of the libsepol provided by the Linux distribution, build the libsepol sources and then set the USERSPACE_SRC environmental variable to the path to the root of SELinux userspace source tree. The libsepol and libselinux must already be compiled.

  $ export USERSPACE_SRC=/home/user/src/selinux
  $ python setup.py build_ext
  $ python setup.py build
  $ python setup.py install

This feature assumes that the directory structure at $USERSPACE_SRC is the same as the SELinux userspace code checked out from GitHub.

Since SETools is dynamically linked to libsepol and libselinux, you must specify the path to the libsepol/src and libselinux/src directories by using LD_LIBRARY_PATH so that the newer versions of the libraries are used.

  $ export LD_LIBRARY_PATH="/home/user/src/selinux/libsepol/src:/home/user/src/selinux/libselinux/src"
  $ ./seinfo policy.31
  $ ./sesearch -A sysadm_t policy.31

Installation Options

Please see python setup.py --help or python setup.py install --help for up-to-date information on build and install options, respectively.

Unit Tests

One goal for SETools is to provide confidence in the validity of the output for the tools. The unit tests for SETools can be run with the following commands:

  $ python setup.py build_ext -i
  $ pytest tests

Features

SETools encompasses a number of tools, both graphical and command line, and libraries. Many of the programs have help files accessible during runtime.

Graphical tools

Tool Name Use
apol A Qt graphical analysis tool. Use it to perform various types of analyses.

Command-line tools

Tool Name Use
sechecker Configuration file-driven automated analysis.
sediff Compare two policies to find differences.
sedta Perform domain transition analyses.
seinfo List policy components.
seinfoflow Perform information flow analyses.
sesearch Search rules (allow, type_transition, etc.)

Analysis Libraries

The SETools libraries are available for use in third-party applications. Although this is not officially supported, we will do our best to maintain API stability.

Reporting bugs

Bugs can be reported in the SETools GitHub issues tracker.

The intent is to allow free use of this source code. All programs' source files are copyright protected and freely distributed under the GNU General Public License (see COPYING.GPL). All library source files are copyright under the GNU Lesser General Public License (see COPYING.LGPL). All files distributed with this package indicate the appropriate license to use. Absolutely no warranty is provided or implied.