Commit Graph

349 Commits

Author SHA1 Message Date
Chris PeBenito
20ee139f3b SELinuxPolicy: add support for finding the policy to load.
Restore legacy CLI tool behavior for not having to specify a policy to load
2015-05-08 15:21:00 -04:00
Chris PeBenito
ff1fb21012 Boolean: change state to a property. 2015-04-30 19:03:28 -04:00
Chris PeBenito
82b021a5a4 Portcon: implement port ranges using a namedtuple
Has the benefit of unifying the object attributes for port range and MLS
range objects, making the PolicyQuery._match_range() function work
naturally for both object types.
2015-04-27 14:15:31 -04:00
Chris PeBenito
da8b151d5c InfoFlowAnalysis: convert output to namedtuples 2015-04-26 10:41:03 -04:00
Chris PeBenito
d23bdd4895 DomainTransitionAnalysis: convert to named tuples for output
Makes output compact and easier to use for callers. Also it is backwards
compatible.
2015-04-26 10:19:42 -04:00
Chris PeBenito
43f7c19114 qpol.i: remove unneeded classes and functions. 2015-04-24 20:47:07 -04:00
Chris PeBenito
1406eb30c3 Implement InitialSIDTest. 2015-04-24 08:56:56 -04:00
Chris PeBenito
6de35b81f7 Implement CommonTest and ObjClassTest.
Also fix bugs uncovered by testing.
2015-04-23 11:04:37 -04:00
Chris PeBenito
7cb5762b4f TypeAttribute: add __contains__ 2015-04-23 09:00:07 -04:00
Chris PeBenito
970a905867 PolCapTest: add lookup test. 2015-04-23 08:53:19 -04:00
Chris PeBenito
df493bbb4a Fix PolCapTest. 2015-04-23 08:38:39 -04:00
Chris PeBenito
ae0e116567 Implement PolCapTest. 2015-04-22 18:01:22 -04:00
Chris PeBenito
f8a2023391 DomainTransitionAnalysis: implement Edge class and descriptors for graph access
Includes policyrep changes to handle the deepcopy needed by NetworkX. The
SWIG objects are treated as immutable, since they are proxies of C pointers
to immutable objects (raw policydb).

Also fixes PolicySymbol.__hash__(), as returning NotImplemented would
raise a TypeError.
2015-04-22 09:55:21 -04:00
Chris PeBenito
43b8fb5214 InfoFlowAnalysis: undo API change. 2015-04-22 08:54:59 -04:00
Chris PeBenito
3aaf8fa25e EdgeAttrIntMax: fix __set__ references. 2015-04-21 10:22:25 -04:00
Chris PeBenito
6904619197 InfoFlowAnalysis: implement Edge class and descriptors for graph access 2015-04-21 09:49:42 -04:00
Chris PeBenito
b1c2901e4f tests: fix iter() use in Mock objects
By using return_value, there was only one instance of the iterator, which
would cause problems if it needed to be used again but had already been
consumed. Switch to lambdas that return a new instance of the iter().
2015-04-18 10:47:42 -04:00
Chris PeBenito
cc7ee08f03 policyrep factories: short circuit if provided a constructed object.
Change factory functions that support lookups to short circuit if they are
being provided an instance of the object they are meant to create.
2015-04-16 14:07:18 -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
55b290a77d NodeconQuery: Sync __init__ named parameters to setters
This is to match up __init__ named parameters to the corresponding
setter names, so it is simpler to switch from using the named parameters
over to separate setter calls.
2015-04-15 11:24:41 -04:00
Chris PeBenito
05da568b15 Clean up unused imports in RBAC and TE rule tests. 2015-04-13 10:08:15 -04:00
Chris PeBenito
961680ee1e Implement MLSRuleTest 2015-04-13 10:06:04 -04:00
Chris PeBenito
f2064f7eac Implement RoleAllowTest and RoleTransitionTest. 2015-04-12 17:20:55 -04:00
Chris PeBenito
25a5c1adab Implement AVRuleTest and TERuleTest. 2015-04-12 10:51:58 -04:00
Chris PeBenito
5594c02e8c Role: tweak statement() 2015-04-11 10:56:15 -04:00
Chris PeBenito
09a5f5dca4 Implement TypeTest and TypeAttributeTest 2015-04-11 10:54:22 -04:00
Chris PeBenito
9c9d908754 Implement RoleTest. 2015-04-11 09:01:26 -04:00
Chris PeBenito
415a91d9a0 UserTest: fix copy/paste error in docstring 2015-04-11 08:37:54 -04:00
Chris PeBenito
26e0396290 Implement User unit tests. 2015-04-10 14:53:07 -04:00
Chris PeBenito
52d119c58f Fix qpol compile error. 2015-04-09 14:39:11 -04:00
Chris PeBenito
4e0b7d853b Thoroughly test MLS representations.
Implement category and level decl. lookups along the way.
2015-04-09 14:27:51 -04:00
Chris PeBenito
71e99abbcf sedta: add limit for transition output 2015-04-07 14:43:17 -04:00
Chris PeBenito
8cfa23109c Revise README tool and library descriptions 2015-04-07 14:41:55 -04:00
Chris PeBenito
448b8ebeae PermissionMapTest: add additional unit tests for error cases
Fix the exposed bugs in PermissionMap.  Add an exception for parse errors
in the permission map file parser, as SyntaxError is not the correct
exception.
2015-04-07 14:40:04 -04:00
Chris PeBenito
f817fe2c56 Fix tox lint target on CI. 2015-04-06 10:58:42 -04:00
Chris PeBenito
ffd32d38f8 Add lint to CI. Step back to single coverage test, on Python 3.3.
I decided kamino's original single-coverage tox.ini was better.
2015-04-06 10:07:22 -04:00
Chris PeBenito
f3ca479a27 Address remaining pylint errors.
Also implement some suggested changes.
2015-04-06 09:51:32 -04:00
Chris PeBenito
695081fcc0 Add pylint configuration. 2015-04-06 09:38:58 -04:00
Chris PeBenito
0397706313 PermissionMapTest: implement helper function for verifying map contents 2015-04-03 15:07:04 -04:00
Chris PeBenito
816fc94e3b MLSRuleQueryTest: PEP8 fix 2015-04-03 14:59:07 -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
d15a015bfa Fix missed exception changes. 2015-04-02 10:36:22 -04:00
Chris PeBenito
0745f8011c SELinuxPolicyTest: clean up temp binary policy in case of setUpClass error
This should never be hit since the source policy already was complied
by checkpolicy.
2015-04-01 13:26:48 -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
4ced886c24 Add KNOWN-BUGS. 2015-04-01 09:21:40 -04:00
Chris PeBenito
a659c87b50 seinfoflow: remove redundant try block 2015-03-31 15:49:08 -04:00
Chris PeBenito
f24a8237ab Further README revision and formatting. 2015-03-31 10:41:20 -04:00
Chris PeBenito
d6ea1014a0 Convert README to github markdown. 2015-03-31 10:40:59 -04:00