Commit Graph

1196 Commits

Author SHA1 Message Date
Chris PeBenito
878059debf README: Minor formatting refinements.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-03-27 09:16:53 -04:00
Chris PeBenito
fbce6e8324
Merge pull request #89 from pebenito/namedtuple-to-dataclass
diff/permmap: Replace named tuples with dataclasses.
2023-03-24 11:21:54 -04:00
Chris PeBenito
02e70efcb0 RuleWeight: Change to dataclass.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-03-24 11:16:01 -04:00
Chris PeBenito
450f94875a diff: Replace named tuples with dataclasses.
Add backwards compatibility for tuple usage.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-03-24 10:53:13 -04:00
Chris PeBenito
0abf995706
Merge pull request #88 from pebenito/pytest
Change unit test runner to pytest.
2023-03-23 13:35:52 -04:00
Chris PeBenito
3d5fcdd6cf tests.yml: Enable coverage test.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-03-23 10:24:07 -04:00
Chris PeBenito
729daacc57 AVRuleTest: Fix warning in regex escape sequence.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-03-23 10:10:53 -04:00
Chris PeBenito
2676ea9152 .pylintrc: Update options to current release.
Remove deprecated options and fully specify the overgeneral-exceptions
option.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-03-23 10:05:01 -04:00
Chris PeBenito
85cac110be Change test runner to pytest.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-03-23 10:05:01 -04:00
Chris PeBenito
a75656b891 Rename unit test files for pytest detection.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-03-23 10:05:01 -04:00
Chris PeBenito
d491963133
Merge pull request #81 from pebenito/nx-dataclasses
Convert data structures to Python dataclasses where relevant.
2023-02-07 11:47:14 -05:00
Chris PeBenito
ec0bafe6bb dta, infoflow: Move __getitem__() to common mixin.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-02-07 10:55:30 -05:00
Chris PeBenito
ebbfef2482 dta, infoflow: Use dataclasses where relevant.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-02-07 10:05:44 -05:00
Chris PeBenito
51a3e3aa98 tox.ini: Add dataclasses package for Python 3.6.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-02-07 10:05:44 -05:00
Chris PeBenito
d8a9c33337 README: Add dataclasses package for Python 3.6.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-02-07 10:05:44 -05:00
Chris PeBenito
4fb753e31a
Merge pull request #84 from pebenito/refine-descriptors
Refine descriptors
2023-02-07 09:28:56 -05:00
Chris PeBenito
575ddbff59 Fix typing issue from CI tests.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-02-07 09:22:48 -05:00
Chris PeBenito
d43bbdcd4a DiffResultDescriptor: Save data to the object instead of in the descriptor.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-02-07 09:03:33 -05:00
Chris PeBenito
4255600044 CriteriaDescriptor: Store data in obj instead of local instances.
This obviates the need of a instances dict.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-02-06 15:34:56 -05:00
Chris PeBenito
967e862ab1 NetworkXGraphEdgeDescriptor: Use __set_name__.
Still need the __init__ use to handle a single case of overriding the name.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-02-06 14:52:46 -05:00
Chris PeBenito
2d1de939ba PermissionMapDescriptor: Use __set_name__.
Then the attribute name does not need to be passed to __init__.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-02-06 14:37:46 -05:00
Chris PeBenito
83bac2e6a4
Merge pull request #83 from cgzones/perm_map
Update permission map
2023-02-03 14:51:32 -05:00
Christian Göttsche
1b364e518f Update permission map
* Add permission cmd to class io_uring (added in Linux 6.0 and 5.19.9)

* Add class user_namespace (added in Linux 6.1)

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2023-02-03 20:37:14 +01:00
Chris PeBenito
4bedce8811
Merge pull request #80 from pebenito/ci-fixes
tests.yml: Pin ubuntu-20.04 to keep appropriate Python versions.
2023-02-02 16:56:23 -05:00
Chris PeBenito
fea650045d dta, infoflow: Replace nx.info() function.
This is a deprecated function and was removed in NetworkX 3.0.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-02-02 16:50:44 -05:00
Chris PeBenito
42a75ad753 tests.yml: Pin ubuntu-20.04 to keep appropriate Python versions.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2023-02-02 16:31:22 -05:00
Chris PeBenito
a66c264b2b
Merge pull request #79 from pebenito/ci-fixes
Update CI tests and fix new issues.
2022-11-30 15:19:01 -05:00
Chris PeBenito
c0d0f0d3b8 tests.yml: Add Python 3.10 and 3.11 CI tests.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2022-11-30 15:02:09 -05:00
Chris PeBenito
fc0aadf3ae tests.yml: Update GitHub actions versions.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2022-11-30 14:52:50 -05:00
Chris PeBenito
f1e0035029 CriteriaDescriptor: Fix typing for enum_class keyword parameter.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2022-11-30 14:43:41 -05:00
Chris PeBenito
ee21412234 policyrep.pyi: Remove incorrect attribute overrides.
This fixes mypy issues.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2022-11-30 14:26:49 -05:00
Chris PeBenito
6a00d5d5f3 PermissionMap: Fix error in __deepcopy__().
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2022-11-30 13:48:00 -05:00
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
Chris PeBenito
13edaf693c
Merge pull request #78 from stevedlawrence/master
Override copy() and cut() functions for custom tree/table widgets
2022-11-30 11:26:44 -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
cbf0b2f5b8
Merge pull request #76 from dross-carve/master
Add pyproject.toml to fix Cython dependency issue
2022-09-22 14:23:58 -04:00
Dylan Ross
fad7c5cf39
Add pyproject.toml to fix Cython dependency issue
Signed-off-by: Dylan Ross <dylan.ross@carvesystems.com>
2022-09-22 10:45:49 -04:00
Chris PeBenito
6b75402974
Merge pull request #75 from pebenito/issue74
AVRuleXperm: Fix permission set creation for AVTAB_XPERMS_IOCTLDRIVER.
2022-08-31 14:50:36 -04:00
Chris PeBenito
f78476ab65 AVRuleXperm: Fix permission set creation for AVTAB_XPERMS_IOCTLDRIVER.
Closes #74

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2022-08-30 14:30:52 -04:00
Chris PeBenito
1612addc60
Merge pull request #72 from cgzones/perm_map
perm_map: add kernel security class io_uring
2022-04-01 10:20:53 -04:00
Christian Göttsche
869a8fcea8 perm_map: add kernel security class io_uring
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2022-03-29 21:28:10 +02:00
Chris PeBenito
2617477774
Merge pull request #71 from dburgener/sesearch-sp-arg
Add -Sp argument to sesearch to serve as front end for perms_subset
2022-03-19 15:53:42 -04:00
Daniel Burgener
af077513fc Add -Sp argument to sesearch to serve as front end for perms_subset
The perms_subset rule search flag matches rules where the searched perms
are a subset of the rule perms.  This flag is currently only exposed via
apol, and this commit exposes it via sesearch

Signed-off-by: Daniel Burgener <dburgener@linux.microsoft.com>
2022-03-18 16:57:45 -04:00
Chris PeBenito
ea54ee1750
Merge pull request #70 from dburgener/ep-man-page
Update text of man page for -ep flag
2022-03-18 15:29:35 -04:00
Daniel Burgener
2ca75dfb02 Update text of man page for -ep flag
The old text does not match the behavior observed in practice or the
description in the --help flag

Signed-off-by: Daniel Burgener <dburgener@linux.microsoft.com>
2022-03-18 15:14:43 -04:00
Chris PeBenito
3e791a7497
Merge pull request #68 from pebenito/networkx-optional
Make NetworkX optional.
2021-12-15 10:37:58 -05:00
Chris PeBenito
716a1d9e1d Make NetworkX optional.
The CLI tools get installed to most distros, but sedta and seinfoflow are
not typically used or separated into a different package. This will allow
seinfo, sesearch, and sediff to function if NetworkX is missing, since they
don't require it.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2021-12-15 10:24:48 -05:00
Chris PeBenito
fff1906ff4 Refine COPYING text.
No license changes.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2021-11-20 14:32:33 -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
c5394ecce1
Merge pull request #67 from pebenito/sedta-seinfoflow-changes
Minor improvements to sedta and seinfoflow
2021-11-18 14:10:50 -05:00