Commit Graph

33 Commits

Author SHA1 Message Date
Chris PeBenito
cc313f9791 __future__ print functions no longer need importing. 2017-09-24 20:40:29 -04:00
Chris PeBenito
e292a77c52 Drop support for Python < 3.4. 2017-09-17 09:43:13 -04:00
Chris PeBenito
4b5b6c0970 Implement an enumeration for MLS rule type. 2016-09-03 16:40:54 -04:00
Chris PeBenito
a441a92937 Implement an enumeration for RBAC rule type. 2016-09-03 16:19:52 -04:00
Chris PeBenito
f3fb462c88 Implement an enumeration for TE rule types. 2016-09-03 16:17:07 -04:00
Chris PeBenito
9f8f8f72c1 Change tool exception handlers to re-raise the exception if debugging.
This will allow the debugger to catch the exception for debugging purposes.
2016-07-22 19:14:40 -04:00
Chris PeBenito
38cd43c80b sesearch: Fix xperm options for consistency.
The options should have been like --allowxperm but were like --allowx. Fix
to be consistent with sediff, which has these options.

Fortunately argparse recognizes abbreviations of long options, so anyone
that started using, --allowx, for example, can still use that.
2016-05-12 10:07:04 -04:00
Chris PeBenito
c3a9d45e33 Update sesearch for TERuleQuery extended permission changes.
The -A option will now search allowxperm rules in addition to allow rules.

Related to #73.
2016-03-22 11:12:23 -04:00
Chris PeBenito
56965ae9b3 Fix PEP8 and lint issues in Xen code. 2016-03-21 10:58:05 -04:00
Steve Lawrence
21864a7ea6 Change extended avrules to be more similar to normal avrules
- Add an iterator to extract the extended permissions rather than
  returning only a string
- Add queries for determining if an avrule is extended, and what its
  type the extended avrule is (e.g. ioctl)
- Removed tests, but should probably revert that change and make sure
  they still work
- Fixed some warnings about unsigned/signed comparisons with ebitmaps
- Updates seinfo and sesearch to support new extended avrule changes

Signed-off-by: Steve Lawrence <slawrence@tresys.com>
2016-03-21 10:57:21 -04:00
Richard Haines
3532ed2fff setools-V4: Add updates for testing V30 xen and xperms
Add updates to seinfo and sesearch to test libqpol updates
added via [1].

Also include extra tests for Xen and xperms. Note, xperms
cannot yet test the extended perms as needs more work on
libqpol.

[1] 0001-setools-V4-libqpol-policy-V30-updates-xen-xperm-stat.patch

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
2016-03-21 10:56:37 -04:00
Chris PeBenito
99ea9b6c02 seinfo: add missing source/target indirect options to MLS rule query.
Closes #111
2016-03-16 14:12:37 -04:00
Chris PeBenito
7d88a1424e cli: switch to logging.exception for debug reporting of unrecoverable exception. 2016-03-04 13:59:21 -05:00
Chris PeBenito
89a96a422a Change #! to use standard Python form 2016-02-26 09:12:34 -05: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
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
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
c224995eeb Fully configure logging in CLI tools. 2015-03-25 13:40:03 -04:00
Chris PeBenito
3d1c8af0c1 Remove rule type combination parser error.
It is possible to have a match across all three types of rules:
* same target type for (type|role|range)_transition
* regex, e.g. sysadm_(r|t)
2015-03-20 11:54:08 -04:00
Chris PeBenito
1dd17a0718 Remove unnecessary option defaults in CLI tools. 2015-03-19 15:20:37 -04:00
Chris PeBenito
de716ba6a5 Add logging.
Not comprehensive yet. Only planning to do setools pkg (not policyrep),
with the exception being the SELinuxPolicy class in policyrep.

Avoids performance-critical paths.  Use only info and debug so in normal
cases the user only sees messages if they ask for it (e.g. -v).
2015-03-19 08:07:23 -04:00
Chris PeBenito
edb19126c9 Add --debug options to CLI tools.
Catch all exceptions in the main bulk of the CLI code. We can't do anything
if there is an exception, so either print the error message from the
exception, or print the traceback if debug is enabled.
2015-03-07 11:41:04 -05:00
Chris PeBenito
175b7c167f Implement range matching in MLSRuleQuery.
Skip adding all of the range matching options in sesearch for now, as it
already has a large number of CLI options.

closes #5
2015-02-25 14:17:38 -05:00
Chris PeBenito
4d19fb964b Remove bad MLSRuleQuery options in sesearch.
MLSRuleQuery doesn't support indirection because range_transition rules
are always expanded (they never have attributes) in a binary policy.
2015-02-25 14:16:23 -05:00
Chris PeBenito
2f44b599ca Reflow lines with new max line length.
Undo past whitespace fixes that are now unnecessary now that the max
line length increased to 100.
2015-02-14 10:40:38 -05:00
Chris PeBenito
f73e1d2850 Fix parameter moving errors in sesearch. 2015-02-14 10:33:18 -05:00
Chris PeBenito
2d1c9184ed Reorder parameters to meet PEP8 standards.
Except max line length of 100.
2015-02-12 13:59:54 -05:00
Chris PeBenito
02c5e72f0a Whitespace changes to meet PEP8 standards.
Except max line length of 100.
2015-02-12 13:52:46 -05: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
278ababe61 Whitespace fix in sesearch. 2014-11-02 12:33:28 -05:00
Chris PeBenito
f28682b88e Fix SWIG exception raising in qpol_policy constructor. 2014-10-28 10:37:47 -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