Commit Graph

204 Commits

Author SHA1 Message Date
Chris PeBenito
263b588a6d TabRegistry: Switch __new__() use to *args, **kwargs.
This fixes a pylint issue.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2022-11-30 13:46:17 -05:00
Steve Lawrence
8ecedcdf9c Override copy() and cut() functions for custom tree/table widgets
The Ctrl-C and Ctrl-X shortcuts are handled by the copy() and cut()
functions in the ApolMainWindow, which just get the currently focused
widget and call its function of the same name.

However, the custom SEToolsTableView and SEToolsTreeView widgets do not
use these functions to implement Ctrl-C/X, but instead override the
event() function and check if each received event is a copy/cut key
sequence. Functionally this is the same as copy() and cut(), but this
leads to an abort in newer versions for Fedora and/or PyQT5 (the reason
is not obvious).

To avoid the abort, and arguably make things a little more clear, this
overrides the copy() and cut() functions in these widgets, moves the
specialize copy logic into them, and removes the event() function.

Closes #77

Signed-off-by: Steve Lawrence <slawrence@owlcyberdefense.com>
2022-11-29 13:19:05 -05:00
Chris PeBenito
8e082f70cf Replace license text in sources with SPDX license indentifiers.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2021-11-20 14:12:15 -05:00
Chris PeBenito
16c069631e
Merge pull request #57 from pebenito/apol-tab-metaclass
TabRegistry: Add a new metaclass for generating the tab selection.
2021-01-20 15:33:20 -05:00
Chris PeBenito
d3687c7705 TabRegistry: Add a new metaclass for generating the tab selection.
The ChooseAnalysis dialog lists the analysis tabs so the user can select
them.  Create a new metaclass so the listing of tabs, grouping in the menu,
and the invocation of the tab's class is automatic.  This requires section,
tab_title, and mlsonly class attributes.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2021-01-20 15:27:38 -05:00
Chris PeBenito
bb5986724e apol: Suppress RuntimeErrors in analysis tab destructors.
Suppress errors like this:

Exception ignored in: <function DomainTransitionAnalysisTab.__del__ at 0x7fcb4e93c1f0>
Traceback (most recent call last):
  File "/home/pebenito/projects/setools/setoolsgui/apol/dta.py", line 54, in __del__
    self.thread.quit()
RuntimeError: wrapped C/C++ object of type ResultsUpdater has been deleted
Exception ignored in: <function ResultsUpdater.__del__ at 0x7fcb4e943550>
Traceback (most recent call last):
  File "/home/pebenito/projects/setools/setoolsgui/apol/dta.py", line 449, in __del__
    self.wait()
RuntimeError: wrapped C/C++ object of type ResultsUpdater has been deleted
Exception ignored in: <function BrowserUpdater.__del__ at 0x7fcb4e943820>
Traceback (most recent call last):
  File "/home/pebenito/projects/setools/setoolsgui/apol/dta.py", line 538, in __del__
    self.wait()
RuntimeError: wrapped C/C++ object of type BrowserUpdater has been deleted

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2021-01-20 14:27:59 -05:00
Chris PeBenito
3b845c01c2 SEToolsTableModel: Fix type checking error.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-10-17 16:27:53 -04:00
Chris PeBenito
f36cc727fc util: Create utility function to parse xperm range strings.
Change sesearch and TERuleQueryTab to use this new function.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>

# Conflicts:
#	setools/__init__.py
2020-10-17 16:27:53 -04:00
Chris PeBenito
73e8c28845 ApolMainWindow: PEP8 style fix.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-11-26 13:33:15 -05:00
Chris PeBenito
e80c3a1280 ApolConfig: Move apol configuration file management to a new class.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-11-26 13:32:59 -05:00
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
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
2557369f00 ibendportconquery.ui: Fix title. 2019-08-14 20:59:24 -04: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
6333cfaff3 apol: Add ipbkeycon query tab.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-07-17 21:17:49 -04:00
Chris PeBenito
afc2d08682 SummaryTab: Add inifiniband context counts. 2019-02-02 10:17:26 -05:00
Chris PeBenito
17a20a596a PermListModel: Fix bug in creating permission set intersection.
ObjClass.perms is now a frozenset, so it can't be updated.
2018-11-16 10:14:39 -05:00
Chris PeBenito
2496ae0509 Update old documentation references.
Closes #12
2018-11-12 11:40:22 -05:00
Chris PeBenito
e6fc383eee ConstraintExpression: Move constraint/validatetrans expression to new class.
This represents the constraint expression and simplifies use of the
expression.
2018-08-31 21:09:14 -04:00
Chris PeBenito
fd7989a413 apol: Revise UI layouts to have bigger expansion of QLineEdit fields. 2018-08-26 11:53:09 -04:00
Chris PeBenito
d59b989e06 setoolsgui: Missed symbol name attribute use. 2018-08-25 11:00:13 -04:00
Chris PeBenito
87f28f850f setoolsgui: Use symbol name attribute where now possible. 2018-08-18 13:35:09 -04:00
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
2b4d69d42e Revise structure to make policyrep a module instead of a subpackage.
The setools.policyrep.exception module merged into setools.exception.
2018-08-11 20:46:01 -04:00
Chris PeBenito
a82a7fcc84 apol/workspace: Remove unnecessary import. 2018-06-15 20:28:05 -04:00
Chris PeBenito
51b91d6130 Convert policyrep and SWIG wrapper into Cython libpolicyrep. 2018-06-15 20:26:49 -04:00
Chris PeBenito
576268eeca Use the suppress context manager where possible to improve readability. 2017-09-17 09:43:13 -04:00
Chris PeBenito
1dd0bf31e1 ApolMainWindow: IOError is an alias for OSError in Python 3. 2017-09-17 09:43:13 -04:00
Chris PeBenito
af88deac17 PermissionMapEditor, EdgeAttrList: Use list .clear() method.
Closes #110
2017-09-17 09:43:13 -04:00
Chris PeBenito
d0ca705cc7 Drop explicit inheritance of object as all classes are new-style in Python 3.
Closes #109
2017-09-17 09:43:13 -04:00
Chris PeBenito
78a15c92ac Nodecon: Implement network property.
The network property will return an IPv4Network or IPv6Network based on the
nodecon.  If the policy has host bits set, the ipaddress module will
simply ignore the host bits, so there may be unexpected results in network
comparisons.

Closes #108
2017-09-17 09:43:13 -04:00
Chris PeBenito
bfa50a42f8 NodeconQuery: Make ipaddress module usage unconditional.
Closes #107
2017-09-17 09:43:13 -04:00
Chris PeBenito
904a83b27e Implement exception chaining.
Closes #106.
2017-09-17 09:43:13 -04:00
Nicolas Iooss
dae1080d51
Update compiled Apol Help files 2017-02-15 21:37:49 +01:00
Chris PeBenito
e97afd7467 SEToolsTreeWidget: Subclass QTreeWidget to copy tree to clipboard.
Closes #122
2016-11-13 16:42:42 -05:00
Chris PeBenito
42c2bbd606 Move data in as package data.
Closes #136.
2016-11-12 11:13:21 -05:00
Chris PeBenito
6927ea885b SummaryTab: Fix handle_unknown output. 2016-11-11 18:22:07 -05:00
Chris PeBenito
96428e6309 Implement an enumeration for *bounds rule types. 2016-09-03 16:44:13 -04:00
Chris PeBenito
9648d013a2 Implement an enumeration for constraint rule type. 2016-09-03 16:44:13 -04:00
Chris PeBenito
693b5a435b Implement an enumeration for default rule type, value, and range value. 2016-09-03 16:44:13 -04:00
Chris PeBenito
8ea292f934 Implement an enumeration for fs_use_* ruletype. 2016-09-03 16:44:07 -04:00
Chris PeBenito
3178745ffc Implement an enumeration for nodecon IP version. 2016-09-03 16:42:38 -04:00
Chris PeBenito
57e51ec69b Implement an enumeration for portcon protocol. 2016-09-03 16:42:06 -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