2015-03-31 14:31:59 +00:00
|
|
|
# SETools: Policy analysis tools for SELinux
|
2015-03-31 14:02:43 +00:00
|
|
|
https://github.com/TresysTechnology/setools/wiki
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2015-03-31 14:02:43 +00:00
|
|
|
## Overview
|
2014-07-08 18:28:55 +00:00
|
|
|
|
|
|
|
This file describes SETools, developed by Tresys Technology. 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.
|
|
|
|
|
2015-03-31 14:02:43 +00:00
|
|
|
## Installation
|
2014-07-08 18:28:55 +00:00
|
|
|
|
|
|
|
SETools uses the Python setuptools build system to build, and install.
|
2014-11-14 03:16:08 +00:00
|
|
|
As such it contains a setup.py script that will install the tools.
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2016-04-20 14:11:29 +00:00
|
|
|
To run SETools command line tools, the following packages are required:
|
2015-03-31 14:02:43 +00:00
|
|
|
* Python 2.7 or 3.3+
|
|
|
|
* NetworkX 1.8+
|
|
|
|
* setuptools
|
2016-04-22 17:42:08 +00:00
|
|
|
* libselinux Python bindings (optional but recommended)
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2016-04-20 14:11:29 +00:00
|
|
|
To run SETools graphical tools, the following packages are also required:
|
|
|
|
* PyQt5
|
|
|
|
* qt5-assistant
|
|
|
|
* qt-devel (only if rebuilding the help file)
|
|
|
|
|
2015-03-31 14:31:59 +00:00
|
|
|
To build SETools, the following development packages are required, in
|
|
|
|
addition to the development packages from the above list:
|
2015-03-31 14:02:43 +00:00
|
|
|
* gcc
|
|
|
|
* bison
|
|
|
|
* flex
|
2016-03-22 15:14:25 +00:00
|
|
|
* libsepol 2.5+
|
2015-03-31 14:02:43 +00:00
|
|
|
* SWIG 2.0.12+ or 3.0+
|
2015-03-31 14:31:59 +00:00
|
|
|
|
|
|
|
To run SETools unit tests, the following packages are required, in
|
|
|
|
addition to the above dependencies:
|
2015-03-31 14:02:43 +00:00
|
|
|
* mock (on Python 2.7 only)
|
|
|
|
* tox (optional)
|
|
|
|
|
2016-04-22 18:02:04 +00:00
|
|
|
### 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:
|
|
|
|
|
|
|
|
https://github.com/TresysTechnology/setools/releases
|
|
|
|
|
|
|
|
SETools source code is maintained within a GitHub repository.
|
|
|
|
From the command line do:
|
|
|
|
```
|
|
|
|
$ git clone https://github.com/TresysTechnology/setools.git
|
|
|
|
```
|
|
|
|
You may also browse the GitHub repository at
|
|
|
|
https://github.com/TresysTechnology/setools. 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.
|
|
|
|
|
2016-04-20 14:11:29 +00:00
|
|
|
### 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 soures, perform the following:
|
|
|
|
```
|
|
|
|
$ python setup.py build_qhc
|
|
|
|
```
|
|
|
|
|
|
|
|
### Installing SETools
|
2014-07-08 18:28:55 +00:00
|
|
|
|
|
|
|
Unpack the official distribution or check out the git repository,
|
2015-03-31 14:31:59 +00:00
|
|
|
and perform the following at the root:
|
2015-03-31 14:02:43 +00:00
|
|
|
```
|
2014-07-08 18:28:55 +00:00
|
|
|
$ python setup.py install
|
2015-03-31 14:02:43 +00:00
|
|
|
```
|
2014-07-08 18:28:55 +00:00
|
|
|
This will put the applications in /usr/bin, data files in /usr/share/setools,
|
2014-10-25 01:23:13 +00:00
|
|
|
and libraries in /usr/lib/pythonX.Y/site-packages/setools.
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2015-03-31 14:02:43 +00:00
|
|
|
### Installation Options
|
2014-07-08 18:28:55 +00:00
|
|
|
|
|
|
|
Please see `python setup.py --help` or `python setup.py install --help`
|
|
|
|
for up-to-date information on build and install options, respectively.
|
|
|
|
|
2015-03-31 14:02:43 +00:00
|
|
|
### Unit Tests
|
2014-07-08 18:28:55 +00:00
|
|
|
|
|
|
|
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 command
|
2015-03-31 14:02:43 +00:00
|
|
|
```
|
2014-07-08 18:28:55 +00:00
|
|
|
$ python setup.py test
|
2015-03-31 14:02:43 +00:00
|
|
|
```
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2015-03-31 14:02:43 +00:00
|
|
|
## Features
|
2014-07-08 18:28:55 +00:00
|
|
|
|
|
|
|
SETools encompasses a number of tools, both graphical and command
|
|
|
|
line, and libraries. Many of the programs have help files accessible
|
|
|
|
during runtime.
|
|
|
|
|
2015-03-31 14:02:43 +00:00
|
|
|
### Graphical tools
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2016-01-08 13:11:48 +00:00
|
|
|
Tool Name | Use
|
|
|
|
---------- | -------------------------------------------
|
|
|
|
apol | A Qt graphical analysis tool. Use it to perform various types of analyses.
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2015-03-31 14:02:43 +00:00
|
|
|
### Command-line tools
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2015-04-07 18:41:55 +00:00
|
|
|
Tool Name | Use
|
|
|
|
---------- | -------------------------------------------
|
2016-01-08 13:11:48 +00:00
|
|
|
sediff | Compare two policies to find differences.
|
|
|
|
sedta | Perform domain transition analyses.
|
2015-04-07 18:41:55 +00:00
|
|
|
seinfo | List policy components.
|
|
|
|
seinfoflow | Perform information flow analyses.
|
|
|
|
sesearch | Search rules (allow, type_transition, etc.)
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2015-03-31 14:02:43 +00:00
|
|
|
### Analysis Libraries
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2015-03-31 14:31:59 +00:00
|
|
|
The SETools libraries are available for use in third-party
|
2015-04-07 18:41:55 +00:00
|
|
|
applications. Although this is not officially supported, we will
|
|
|
|
do our best to maintain API stability.
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2015-03-31 14:02:43 +00:00
|
|
|
### Reporting bugs
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2014-11-14 03:16:08 +00:00
|
|
|
Bugs can be reported in the SETools GitHub issues tracker:
|
|
|
|
|
|
|
|
https://github.com/TresysTechnology/setools/issues
|
2014-07-08 18:28:55 +00:00
|
|
|
|
2015-03-31 14:02:43 +00:00
|
|
|
### Copyright license
|
2014-07-08 18:28:55 +00:00
|
|
|
|
|
|
|
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
|
2015-03-31 14:31:59 +00:00
|
|
|
appropriate license to use. Absolutely no warranty is provided or implied.
|