Skip to content

Commit

Permalink
Add new InfoFlowAnalysisTab implementation.
Browse files Browse the repository at this point in the history
Also add constants to PermissionMap class.

Signed-off-by: Chris PeBenito <[email protected]>
  • Loading branch information
pebenito committed Oct 6, 2023
1 parent bc76014 commit 88cf611
Show file tree
Hide file tree
Showing 6 changed files with 336 additions and 1,206 deletions.
11 changes: 7 additions & 4 deletions setools/permmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from collections import OrderedDict
from contextlib import suppress
from dataclasses import dataclass
from typing import cast, Dict, Iterable, Optional, Union
from typing import cast, Dict, Final, Iterable, Optional, Union

import pkg_resources

Expand All @@ -16,9 +16,9 @@
from .mixins import TupleCompat
from .policyrep import AVRule, SELinuxPolicy, TERuletype

INFOFLOW_DIRECTIONS = ("r", "w", "b", "n", "u")
MIN_WEIGHT = 1
MAX_WEIGHT = 10
INFOFLOW_DIRECTIONS: Final = ("r", "w", "b", "n", "u")
MIN_WEIGHT: Final[int] = 1
MAX_WEIGHT: Final[int] = 10


@dataclass
Expand Down Expand Up @@ -95,6 +95,9 @@ class PermissionMap:

"""Permission Map for information flow analysis."""

MIN_WEIGHT: Final[int] = MIN_WEIGHT
MAX_WEIGHT: Final[int] = MAX_WEIGHT

def __init__(self, permmapfile: Optional[str] = None) -> None:
"""
Parameter:
Expand Down
2 changes: 1 addition & 1 deletion setoolsgui/apol.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Supported analyses. These are not directly used here, but
# will init the tab registry in widgets.tab for apol's analyses.
from .widgets import (mlsrulequery, rbacrulequery, terulequery)
from .widgets import (infoflow, mlsrulequery, rbacrulequery, terulequery)

if TYPE_CHECKING:
from typing import Dict, Final, Optional
Expand Down
Loading

0 comments on commit 88cf611

Please sign in to comment.