Commit Graph

17 Commits

Author SHA1 Message Date
Chris PeBenito
6d7a672611 Update static testing and fix identified issues.
* Change pep8 to new pycodestyle tool.
* Load the policrep extension in pylint
2018-08-11 20:46:06 -04:00
Chris PeBenito
4684eca5bc tests: Revise unit tests for binary-only policy support.
Closes #72
2018-06-15 20:26:49 -04:00
Chris PeBenito
f3fb462c88 Implement an enumeration for TE rule types. 2016-09-03 16:17:07 -04:00
Chris PeBenito
a9cd2248e9 Complete TERuleQuery changes for extended permission rules.
Related to #73.
2016-03-22 11:07:25 -04:00
Chris PeBenito
bb5cffd44e Extend indirect handling for rule queries.
Range_transitions are expanded in the qpol representation, but attributes
can still be used as criteria.

Hard code default role to indirect to handle role attributes in the
criteria.  Role attributes don't survive in the qpol
representation yet, so this is a forward-looking change.

Similarly hard code the default type matching to indirect so attributes can
be used for default type criteria in type_* rules.  Adjust default criteria
lookup function accordingly.

Related to #111
2016-03-16 14:06:49 -04:00
Chris PeBenito
d66467f3b3 MatchPermission: implement subset permission criteria
Useful for matches where a matching rule has all of the permission criteria
but may have more.

Closes #57
2015-10-04 11:03:41 -04:00
Chris PeBenito
e6f59d04e5 Refactor SETools queries/analyses to use descriptors instead of get/setters
This is Pythonic.
2015-05-16 21:59:10 -04:00
Chris PeBenito
d82a28262c setools __init__: import query/analysis classes
Makes use simpler. The setools submodules map 1:1 to classes anyway;
the separate modules are simply to ease organization.

Change seinfo to use conditional setter use rather than conditional
instantiation of queries.  Note: pylint disable is added because pylint
gets confused by the reuse of the q variable and thinks that q is always
BoolQuery, so it incorrectly reports missing member functions.
2015-04-15 12:00:59 -04:00
Chris PeBenito
cfbedfb9f3 tests: implement ValidateRule mixin
Simplifies testing and uncovered a couple minor bugs in unit tests.
2015-04-03 14:48:25 -04:00
Chris PeBenito
9d51dcc7e3 Misc cleanups suggested by pylint
* unnecessary parentheses on return
* variable shadowing
* unused variables
* classmethod variable naming
2015-04-02 14:50:21 -04:00
Chris PeBenito
c146f0ab47 Restructure exceptions across the entire project.
Group all exception classes into a module for each package.  This is the
first step towards having all exceptions raised by setools libs be a child of
SEToolsException.
2015-04-01 12:10:45 -04:00
Chris PeBenito
ed35d206d9 Change unit tests to use setUpClass for opening policies. 2015-03-18 09:44:16 -04:00
Chris PeBenito
de8bbb88b0 Implement boolean criteria for TE rule query.
Match rules based on the Booleans in the rule's conditional expression.

closes #4
2015-02-11 09:24:09 -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
be32a92f79 Python 3: fix manual generator consuming 2014-10-29 21:51:19 -04:00
Chris PeBenito
109ba68a92 Rename libapol package to setools. 2014-10-24 21:23:13 -04:00
Chris PeBenito
39505d0295 Initial public release. 2014-07-08 14:28:55 -04:00