Commit Graph

1181 Commits

Author SHA1 Message Date
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
Chris PeBenito
857be3c2fa seinfoflow: Make the permission map option (-m) optional.
If not specified, the default permission map will be used.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2021-11-18 13:59:29 -05:00
Chris PeBenito
3d8df89b00 sedta, seinfoflow: Make the default output brief.
Change the sedta and seinfoflow so that they output a summary of the transitions
and flows.  Add a --full option to get the full rule outputs.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2021-11-18 13:59:25 -05:00
Chris PeBenito
90d198683e
Merge pull request #66 from bachradsusi/predictable-seinfo-c
Make seinfo output predictable
2021-11-18 11:24:17 -05:00
Petr Lautrbach
8ed316d6bf Make seinfo output predictable
There are few places where frozenset is used. Given that frozenset is an unordered
collection the output generated from this is unpredictable.

The following command outputs are fixed using sorted() on frozensets:

    seinfo --constrain
    seinfo --common
    seinfo -c -x
    seinfo -r -x
    seinfo -u -x

Fixes: https://github.com/SELinuxProject/setools/issues/65

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
2021-11-18 17:10:06 +01:00
Chris PeBenito
84945c64da
Merge pull request #64 from BigBadWolfSecurity/master
Correct the number of object classes in the perm_map file.
2021-08-13 21:46:13 -04:00
Karl MacMillan
f0ca466797 Correct the number of object classes in the perm_map file.
Signed-off-by: Karl MacMillan <karl@bigbadwolfsecurity.com>
2021-08-13 21:05:40 -04:00
Chris PeBenito
2f85bd8585
Merge pull request #63 from pebenito/pylint-fix
Updates for pylint, mypy, and GitHub actions testing.
2021-07-28 15:00:28 -04:00
Chris PeBenito
562a181110 tests.yml: Enable Python 3.9 testing.
This requires NetworkX 2.6.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2021-07-28 14:48:54 -04:00
Chris PeBenito
7acb17d530 .mypy.ini: Ignore missing pkg_resources annotations.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2021-07-28 13:35:33 -04:00
Chris PeBenito
36a4d851fa Remove pylint unsubscriptable-object exemptions.
Several class annotations were subscripted but pylint had a bug that did
not handle this. This is now fixed in pylint 2.8+.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2021-07-28 13:25:10 -04:00
Chris PeBenito
176e741514
Merge pull request #62 from cgzones/perm_map
Update permission map
2021-06-07 10:42:58 -04:00
Christian Göttsche
f69c0690ec Update permission map
Drop removed permission.
They are removed in Linux 4.3 and not checked since at least 2.6.30, see
42a9699a9f

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2021-06-07 14:55:17 +02:00
Christian Göttsche
91a6d6851b Update permission map
Add watch permissions, added in ac5656d8a4

Add `perf_event` class, added in da97e18458

Add `lockdown` class, added in 59438b4647

Add `anon_inode` class, added in 29cd6591ab

Drop inexistent permissions `execute_no_trans` and `entrypoint` from
`chr_file`

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2021-06-03 17:38:28 +02:00
Chris PeBenito
52efadf5d1 stale.yml: Fix labels with spaces.
However, a bug prevents this from working on PRs, see actions/stale#98.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2021-04-21 09:36:34 -04:00
Chris PeBenito
e043663785
Merge pull request #61 from pebenito/fix-sechecker-multiline-value
ConfigSetDescriptor: Fix parsing of multiline values.
2021-04-16 07:18:26 -04:00