Commit Graph

21 Commits

Author SHA1 Message Date
Chris PeBenito
f3fb462c88 Implement an enumeration for TE rule types. 2016-09-03 16:17:07 -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
da8b151d5c InfoFlowAnalysis: convert output to namedtuples 2015-04-26 10:41:03 -04:00
Chris PeBenito
43b8fb5214 InfoFlowAnalysis: undo API change. 2015-04-22 08:54:59 -04:00
Chris PeBenito
6904619197 InfoFlowAnalysis: implement Edge class and descriptors for graph access 2015-04-21 09:49:42 -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
94376a145f Remove unused imports.
Uncovered with pylint.
2015-04-02 10:58:26 -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
4f73368b7e DTA/InfoFlow: add unit tests for analysis functions
The purpose is not to verify graph algorithm correctness. The purpose is to
verify everything is yielded correctly.
2015-03-28 11:50:44 -04:00
Chris PeBenito
2ea074e563 InfoFlowAnalysisTest: improve efficiency
The main graph is never rebuilt since the perm map never changes.  This
mirrors how a user might interact. If in the future perm map changes
are introduced, the code should still cope.

Also one minor efficiency tweak in InfoFlowAnalysis. Don't bother removing
edges due to weight if it is set to 1 since that includes everything.
2015-03-27 12:30:43 -04:00
Chris PeBenito
758865e3a9 InfoFlow tests: fix disconnected node tests
The no_flow type wasn't ever in the graph.
2015-03-27 09:07:48 -04:00
Chris PeBenito
ec9de08ac6 InfoFlowAnalysis: Add interface error tests.
Unconvered 2 minor NetworkX error path bugs:
networkx/networkx#1430
networkx/networkx#1433
2015-03-26 14:48:29 -04:00
Chris PeBenito
ed35d206d9 Change unit tests to use setUpClass for opening policies. 2015-03-18 09:44:16 -04:00
Chris PeBenito
bdb47c7241 PEP8 fixes for unit test code.
Except max line length of 100.
2015-02-12 14:34:49 -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
Chris PeBenito
5be254a309 Change infoflow to use TypeAttr objects rather than string representations
This will also catch invalid types passed in for analysis.
2014-11-09 11:27:38 -05:00
Chris PeBenito
109ba68a92 Rename libapol package to setools. 2014-10-24 21:23:13 -04:00
Chris PeBenito
4e995cc13f Convert unit tests over to assertListEqual where possible.
It makes determining what's wrong easier since it has a diff-style
output.  Also put the expected list first, so the diff style makes sense.
2014-08-01 10:52:17 -04:00
Chris PeBenito
39505d0295 Initial public release. 2014-07-08 14:28:55 -04:00