Commit Graph

150 Commits

Author SHA1 Message Date
Fernand Lone-Sang
0583fc7fda Enable installing setools in virtualenv
When installed from virtualenv, setools fails to write into /usr/share/setools.
This fix uses sys.prefix to install data_files either system wide or inside the
virtualenv.
2015-02-05 19:23:27 +01:00
Chris PeBenito
79320ba0cc Update parsers to checkpolicy 2.4.
Start dropping ancient psid support and other unused #ifdefs.
2015-02-05 13:05:55 -05:00
Chris PeBenito
0ff6de188a Restore -Werror
Ubuntu 12.04 LTS's flex (2.5.35) generates a redundant declaration.
2015-02-05 10:52:42 -05:00
Chris PeBenito
44437c4112 Fix travis-ci issues with old SWIG. 2015-02-05 09:59:07 -05:00
Chris PeBenito
bed179851a Fix escaping. 2015-02-04 15:09:21 -05:00
Chris PeBenito
f79bf4c3b8 Point travis build to the compiled instance of sepol.a 2015-02-04 15:03:40 -05:00
Chris PeBenito
3937946900 Update to libsepol 2.4 parser.
There was a struct change internally. Now setools4 requires libsepol 2.4.
2015-02-04 14:34:47 -05:00
Chris PeBenito
17c169d4d4 Temporarily remove -Werror to make sure travis-ci script works. 2015-02-04 12:01:52 -05:00
Chris PeBenito
7edd44d047 Fix userspace link in .travis.yml. 2015-02-04 11:29:41 -05:00
Chris PeBenito
846d4650a4 Add updated SELinux userspace to travis config.
Originally by Nicolas Iooss
https://github.com/fishilico/selinux-refpolicy-patched/blob/travis-upstream/.travis.yml
2015-02-04 10:56:07 -05:00
Chris PeBenito
d43af2bdae Add SWIG to travis-ci config. 2015-02-04 10:40:33 -05:00
Chris PeBenito
79c7c6bf26 Add Travis-ci config 2015-02-04 10:33:12 -05:00
Chris PeBenito
0b2782b0a2 Add coverage.py configuration. 2015-02-03 08:08:35 -05:00
Chris PeBenito
2418619e2a Move permissive query into type query
TypeQuery needed the permisive matching support to be complete. This made
PermissiveQuery redundant.

Made the permissive state an option, so enforcing types could be queried.
2015-01-31 12:10:11 -05:00
Chris PeBenito
3ec1cf7d60 Merge pull request #3 from kamino/kamino-fix-build-errors
Fix build errors on ubuntu 14.10
2015-01-26 13:21:03 -05:00
Fernand Lone-Sang
bc081bbccd Fixed -Werror=unused-but-set-variable in libqpol/policy_extend.c 2015-01-23 15:23:38 +01:00
Fernand Lone-Sang
6a8dbe88a5 Fixed -Werror=unused-variable in libqpol/policy_extend.c 2015-01-23 15:23:32 +01:00
Fernand Lone-Sang
43ab9251fd Fixed -Werror=unused-but-set-variable in libqpol/default_object_query.c 2015-01-23 15:23:32 +01:00
Fernand Lone-Sang
322b08b64e Fixed -Werror=unused-label in setools/policyrep/qpol.i
This fix removes "error: label 'fail' defined but not used [-Werror=unused-label]"
compilation errors. Exceptions handlers (fail label) where defined in swig, but no
exceptions where raised in the function, causing the compilation error.
2015-01-23 15:23:23 +01:00
Chris PeBenito
3a0af0341f Create factory functions for all policyrep classes.
* break apart classes that are overloaded (e.g. TypeAttr)
* move object class member function out of Rule subclasses, into Rule.
* Fix SWIG wrapper to make class member function for rules to be consistent
2014-12-18 15:10:31 -05:00
Chris PeBenito
bcd20d761a Python3 fix for default.py 2014-12-16 13:04:10 -05:00
Chris PeBenito
0219b3016e Add docs for Default classes. 2014-12-16 12:52:13 -05:00
Chris PeBenito
351f59b347 Split default_range into two components (src/tgt) and (low/high/low_high) 2014-12-16 12:48:59 -05:00
Chris PeBenito
a71f44dfc4 Implement objects for default_* statements. 2014-12-16 12:29:06 -05:00
Chris PeBenito
d71c3a13fe Add default_* statement generator in SWIG 2014-12-16 12:22:46 -05:00
Chris PeBenito
0c0534e824 Change libqpol to return qpol_class_t instead of string for default objects 2014-12-16 12:21:33 -05:00
Chris PeBenito
7556f8591e Whitespace fix in Common. 2014-11-30 16:28:13 -05:00
Chris PeBenito
c687d1d473 Fix copy-paste error in seinfo. 2014-11-30 16:27:55 -05:00
Chris PeBenito
3a347720b9 Switch SELinuxPolicy terules and rbacrules generators to use chain(). 2014-11-30 13:33:04 -05:00
Chris PeBenito
36abf44bce PEP8 fixes in seinfo 2014-11-30 13:31:31 -05:00
Chris PeBenito
6258b648aa Implement policy statistics functions.
Do counting in C where possible.
2014-11-30 13:30:36 -05:00
Chris PeBenito
16f2eab30c Restructure seinfo
* Restructure queries to only have one output
* Fix portcon help info to be clearer about specifying ports
* Cover all functions with exception handling
2014-11-30 09:34:59 -05:00
Chris PeBenito
bf8d60e1e5 Add mls, version, and handle unknown policy properties. 2014-11-29 21:40:41 -05:00
Chris PeBenito
26698bbb56 Whitespace fix in SELinuxPolicy 2014-11-29 14:15:20 -05:00
Chris PeBenito
d6c71408a3 Documentation fix in PermisiveQuery. 2014-11-29 12:00:19 -05:00
Chris PeBenito
5dadcd071a Comment fix in policyrep __init__. 2014-11-29 11:57:58 -05:00
Chris PeBenito
c4e3068ddf Change inheritance for MLSDisabled and NoCommon exceptions. 2014-11-29 11:43:38 -05:00
Chris PeBenito
cdc09f25ca Change instances where None is returned by SWIG to raise exceptions instead 2014-11-29 11:30:08 -05:00
Chris PeBenito
064d561035 Add role and user factory functions. 2014-11-29 11:02:42 -05:00
Chris PeBenito
5127caf8ae Implement file type criteria for GenfsconQuery. 2014-11-29 10:24:41 -05:00
Chris PeBenito
5301dc54dc Implement file type interface for Genfscon. 2014-11-29 08:59:33 -05:00
Chris PeBenito
a8b1aa07ad Create factory function for TypeAttr objects.
Move the lookup-by-name from __init__ to the factory function.
2014-11-25 13:38:35 -05:00
Chris PeBenito
8ba3cf16f5 Change all unit tests for "unset" query to use full comparison.
Fully compare the lists rather than only counting objects.

Also fix comparison problem in Nodecon and Genfscon. In libqpol, the all
genfscons/nodecons iterators allocate new objects, so the pointer
comparison in PolicySymbol fails.
2014-11-25 13:24:36 -05:00
Chris PeBenito
9fec147c52 Implement portcon query. 2014-11-24 22:08:34 -05:00
Chris PeBenito
dff4b61d6e Update README. 2014-11-13 22:16:08 -05:00
Chris PeBenito
448305f2ef Add NodeconQuery functions for matching on IP version. 2014-11-12 13:39:36 -05:00
Chris PeBenito
4798e10706 Work around IPv6Network constructor expanded netmask issue.
Python 3.3's IPv6Network constructor does not support an expanded netmask
for specifying the network, only CIDR.  Convert all netmasks to CIDR.

The code does not verify that the orignal expanded netmask from the policy
is correct; it counts all set bits in the netmask.

Also add IPv6 NodeconQuery unit tests.
2014-11-10 20:14:33 -05:00
Chris PeBenito
4791d0044f netcontext whitespace fix. 2014-11-10 07:50:46 -05:00
Chris PeBenito
767c32b652 Change PermissionMap rule_weight to not raise exception.
We always want the rule_weight to work, even in the face of unmapped
permissions.  Other functions, e.g. for handling permission map editing
and saving may raise an exception.
2014-11-09 20:04:32 -05:00
Chris PeBenito
8a07be100f Implement infoflow subgraph to handle min weight and excluded types.
Infoflow now will create a complete graph for the policy and then create
a subgraph to filter out nodes based on excluded types and edges based on
minimum weight.  The main graph will only need to be rebuilt if there is
a change in the permission map.  While this is a little more expensive for
seinfoflow, it should make interactive analysis in apol faster since
repeatedly deriving a subgraph will be faster than repeatedly rebuilding
the entire graph.
2014-11-09 20:00:01 -05:00