Commit Graph

1028 Commits

Author SHA1 Message Date
Chris PeBenito
e42ec3fb67 ApolMainWindow: Try to find Qt assistant if help fails to start.
First search for it and if that fails, ask the user to select it.

Closes #28

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-11-24 22:48:22 -05:00
Chris PeBenito
459eb474ff ApolMainWindow: Add an apol config file.
First setting is location of qt assisstant.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-11-24 22:48:22 -05:00
Chris PeBenito
5c68b61f3c
Merge pull request #27 from jwcart2/improve_sediff_03
Change how differences in AV rules are generated in sediff
2019-10-24 22:16:27 -04:00
James Carter
89cad5e1b7 Change how differences in AV rules are generated in sediff
The primary motivation for the change is to correctly handle redundant
rules. Recent changes in the SELinux toolchain added support for an
optimization that removes redundant rules from a policy. These are
conditional rules that are either already specified in unconditional
policy or rules using types that are also specified more generally
through an attribute. Since attributes are always expanded in sediff,
the second type of redundant rules are already effectively removed. But
redundant conditional rules show up as differences when a binary version
of a policy that has been optimized is compared to one that has not been.

A secondary motivation for the change is to reduce memory usage and diff
times. A modern Fedora policy cannot be diffed with a system with less than
32Gb of memory and it takes over four hours to complete.

With this change AV rules are processed by creating a data structure which
consists of nested dictionaries that store BOTH the left and the right
policies. All of the keys are interned strings to save space.

The basic structure is
  rule_db[cond_exp][block_bool][src][tgt][tclass]=sides
where:
  cond_exp is a boolean expression
  block_bool is either true or false
  src is the source type
  tgt is the target type
  tclass is the target class
  sides is a namedtuple with "left" and "right" attributes
    Each side is either None or another namedtuple with "perms" and
    "orig_rule" attributes
      perms is the set of permissions for this rule
      orig_rule is the original unexpanded rule

These changes improve diff times and memory usage.
Without the change
                         Time        Memory Usage
Older Fedora Policy    3 min 17 sec      4.5Gb
Recent Refpolicy       4 min 19 sec      6.0Gb
Recent Fedora Policy   4 hrs  9 min     31.9Gb

With the change
                         Time        Memory Usage
Older Fedora Policy          28 sec      1.7Gb
Recent Refpolicy             34 sec      1.9Gb
Recent Fedora Policy   4 min 45 sec      7.7Gb

Also added a unit test to check that redundant rules are removed.

Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
2019-10-24 09:00:19 -04:00
Chris PeBenito
87674b2e17 ApolMainWindow: Fix question when closing the policy.
Closes #29.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-10-23 18:49:42 -04:00
Chris PeBenito
474c4e0566 Various apol tabs: Fix typo in result message.
Closes #30

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-10-23 18:47:09 -04:00
Chris PeBenito
2fd3739fd0 TypeAttribute: Add methods to make it a proper Python Collection.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-10-19 11:49:02 -04:00
Chris PeBenito
2557369f00 ibendportconquery.ui: Fix title. 2019-08-14 20:59:24 -04:00
Chris PeBenito
3df2bf11c6
Merge pull request #23 from fishilico/fix-lgtm-errors
Fix errors reported by lgtm.com
2019-08-13 17:28:10 -04:00
Nicolas Iooss
faf3d1b204
diff: compare with other instead of self
This issue has been found using lgtm.com.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2019-08-13 21:52:28 +02:00
Nicolas Iooss
186b77bc2d
diff: return a hash instead of raising it
Method __hash__ should return an integer.

This issue has been found using lgtm.com.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2019-08-13 21:49:09 +02:00
Chris PeBenito
9d319a3b96 netifconquery.ui: Fix tooltip for the device name regex checkbox.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-07-19 23:05:27 -04:00
Chris PeBenito
d251e344b0 apol: Add nicer titles for network context tabs.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-07-19 23:05:27 -04:00
Chris PeBenito
5eab4ac7a4 apol: Add ibendportcon analysis tab.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-07-19 23:05:16 -04:00
Chris PeBenito
f12640cd6b IbendportconQuery: Add setter for port.
Ensure it is an integer in the correct range.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-07-17 21:27:34 -04:00
Chris PeBenito
6333cfaff3 apol: Add ipbkeycon query tab.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-07-17 21:17:49 -04:00
Chris PeBenito
022adcb715 TERulesDifference: Add additional debugging statements.
Record the rule list and expanded rule statistics for determining if
memory size issues are due to rule size vs. something else.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-07-13 20:23:54 -04:00
Chris PeBenito
cf1342f4c8 sediff: Fix issue with policy properties heading with 0 changes.
The policy properties header would always be displayed if no specific
difference was chosen.
2019-07-08 20:22:32 -04:00
Chris PeBenito
f0bbab9547 Release 4.2.2.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-06-15 15:52:10 -04:00
Chris PeBenito
ba305bfd74 Remove source policy references from man pages.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-05-18 08:33:36 -04:00
Chris PeBenito
58bd5c871e SELinuxPolicy: Create a map of aliases on policy load.
Addresses a performance regression after the alias fixes in #17.

Closes #20
2019-04-29 07:57:16 -04:00
Chris PeBenito
324a24ea1a Update .gitignore. 2019-02-23 23:46:52 -08:00
Chris PeBenito
16c603df96 InfoFlowAnalysis: Revise disabled rule removal to use TERule.enabled(). 2019-02-23 23:46:39 -08:00
Chris PeBenito
2593b008e1 seinfoflow: Fix -b help text. 2019-02-23 23:23:00 -08:00
Chris PeBenito
5aa99044d7 seinfoflow: Whitespace fix. 2019-02-23 23:21:30 -08:00
Chris PeBenito
2c133a6831
Merge pull request #15 from driechersRC/tunables
Add feature to select only the default tunable rules
2019-02-16 14:37:49 -05:00
Riechers, Daniel J
b662b07cc0 infoflow: adds boolean selection to seinfoflow
Adds the option to the infoflow analysis to filter conditional policy based on the default or user specified boolean values.

Signed-off-by: Daniel Riechers <daniel.riechers@rockwellcollins.com>
Signed-off-by: David Graziano <david.graziano@rockwellcollins.com>
2019-02-06 21:02:46 +00:00
Chris PeBenito
926076a6d8 4.2.1 Release. 2019-02-04 19:28:33 -05:00
Chris PeBenito
b02e16b264 ChangeLog: Add missing release notes between 4.1.0 and 4.2.0. 2019-02-04 19:27:34 -05:00
Chris PeBenito
814c334e83 Set SIGPIPE handler for CLI tools.
SIG_IGN doesn't work.

Closes #18
2019-02-04 16:50:53 -05:00
Chris PeBenito
f3b86a77b9 ConstraintQuery: Fix PEP8 issue.
Whitespace change.
2019-02-02 10:27:51 -05:00
Chris PeBenito
9314b2024b SELinuxPolicy: Add alias dereferencing for symbols that have aliases.
For #17
2019-02-02 10:17:26 -05:00
Chris PeBenito
fc961ee42c Category: Fix aliases method to use the cached alias list. 2019-02-02 10:17:26 -05:00
Chris PeBenito
a943daa452 MatchName: Add support for alias dereferencing.
For #17
2019-02-02 10:17:26 -05:00
Chris PeBenito
afc2d08682 SummaryTab: Add inifiniband context counts. 2019-02-02 10:17:26 -05:00
Chris PeBenito
c07e8e45b7
Merge pull request #16 from driechersRC/bugfix_evaluate_kwargs
terule: Fixed evaluate kwargs
2019-01-25 15:56:13 -05:00
Riechers, Daniel J
7d22e0fb66 terule: Fixed evaluate kwargs
Added missing ** to pass kwargs as kwargs instead of as a dictionary.

Signed-off-by: Riechers, Daniel J <daniel.riechers@rockwellcollins.com>
2019-01-25 16:39:01 +00:00
Chris PeBenito
36c6a4a721
Merge pull request #14 from darktemplarbasealt/add_ru_mans
Add russian translations for man pages
2019-01-09 19:37:52 -05:00
Aleksei Nikiforov
59e183caac Allow installing translated man pages 2019-01-09 12:44:02 +03:00
Aleksei Nikiforov
99d83b7430 Add man pages translation by Olesya Gerasimenko 2019-01-09 12:43:25 +03:00
Chris PeBenito
e3bd331c0a sediff: Fix PEP8 issues. 2018-12-05 15:27:38 -05:00
Chris PeBenito
ad5fb0025c sediff: Add ibendportcon and ibpkeycon output. 2018-12-05 15:23:25 -05:00
Chris PeBenito
b1336686bd PolicyDifference: Add ibendportcon and ibpkeycon difference. 2018-12-05 15:22:07 -05:00
Chris PeBenito
70445d45ad sediff: Fix bug in rendering modified nodecons. 2018-12-05 14:41:36 -05:00
Chris PeBenito
7a49473537
Merge pull request #13 from rc-matthew-l-weber/fix_prefix_man_install
setup.py: drop path prefix from man install
2018-11-30 20:26:07 -05:00
Chris PeBenito
ea2485059a Fix PEP8 issues. 2018-11-30 20:05:10 -05:00
Matt Weber
bc36cba139 setup.py: drop path prefix from man install
If the directory is a relative path, it is interpreted relative to the
installation prefix (Python’s sys.prefix for pure-Python packages,
sys.exec_prefix for packages that contain extension modules).
So the sys.prefix should not be joined because the correct one will be
added regardless. The reason why a relative path is going to work is
because the installation path is built internally joining python root
with python prefix, thus forming the correct path $(TARGET_DIR)/usr.
(https://docs.python.org/3/distutils/setupscript.html#installing-additional-files)

For this man file install scenario, joining the sys.prefix makes the
path absolute (this was previously working by accident).

Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
2018-11-28 20:49:00 -06:00
Chris PeBenito
db9066b978 seinfo: Add ibendportcon and ibpkeycon info. 2018-11-25 10:54:16 -05:00
Chris PeBenito
832462fd0f Add ibendportcon and ibpkeycon queries. 2018-11-25 10:51:23 -05:00
Chris PeBenito
a9620d8b2b policyrep: Implement infiniband classes.
ibpkeycon and ibendportcon statements.
2018-11-25 10:43:26 -05:00