|
|
d570700 |
From 2512c3ba608077db3a5e0286b976fadc8a04a5c4 Mon Sep 17 00:00:00 2001
|
|
|
d570700 |
From: rpm-build <rpm-build>
|
|
|
d570700 |
Date: Thu, 23 Feb 2017 08:17:07 +0100
|
|
|
d570700 |
Subject: [PATCH 2/2] Do not export/use setools.InfoFlowAnalysis and
|
|
|
d570700 |
setools.DomainTransitionAnalysis
|
|
|
d570700 |
|
|
|
d570700 |
dta and infoflow modules require networkx which brings lot of dependencies.
|
|
|
d570700 |
These dependencies are not necessary for setools module itself as it's
|
|
|
d570700 |
used in policycoreutils.
|
|
|
d570700 |
|
|
|
d570700 |
Therefore it's better to use setools.infoflow.InfoFlowAnalysis and
|
|
|
d570700 |
setools.dta.DomainTransitionAnalysis and let the package containing
|
|
|
d570700 |
sedta and seinfoflow to require python3-networkx
|
|
|
d570700 |
---
|
|
|
d570700 |
sedta | 3 ++-
|
|
|
d570700 |
seinfoflow | 3 ++-
|
|
|
d570700 |
setools/__init__.py | 4 ++--
|
|
|
d570700 |
setoolsgui/apol/dta.py | 2 +-
|
|
|
d570700 |
setoolsgui/apol/infoflow.py | 2 +-
|
|
|
d570700 |
tests/dta.py | 3 ++-
|
|
|
d570700 |
tests/infoflow.py | 3 ++-
|
|
|
d570700 |
7 files changed, 12 insertions(+), 8 deletions(-)
|
|
|
d570700 |
|
|
|
d570700 |
diff --git a/sedta b/sedta
|
|
|
d570700 |
index 1c76ebb..255ad49 100755
|
|
|
d570700 |
--- a/sedta
|
|
|
d570700 |
+++ b/sedta
|
|
|
d570700 |
@@ -23,6 +23,7 @@ import argparse
|
|
|
d570700 |
import logging
|
|
|
d570700 |
|
|
|
d570700 |
import setools
|
|
|
d570700 |
+import setools.dta
|
|
|
d570700 |
|
|
|
d570700 |
|
|
|
d570700 |
def print_transition(trans):
|
|
|
d570700 |
@@ -111,7 +112,7 @@ else:
|
|
|
d570700 |
|
|
|
d570700 |
try:
|
|
|
d570700 |
p = setools.SELinuxPolicy(args.policy)
|
|
|
d570700 |
- g = setools.DomainTransitionAnalysis(p, reverse=args.reverse, exclude=args.exclude)
|
|
|
d570700 |
+ g = setools.dta.DomainTransitionAnalysis(p, reverse=args.reverse, exclude=args.exclude)
|
|
|
d570700 |
|
|
|
d570700 |
if args.shortest_path or args.all_paths:
|
|
|
d570700 |
if args.shortest_path:
|
|
|
d570700 |
diff --git a/seinfoflow b/seinfoflow
|
|
|
d570700 |
index b287921..d53bdef 100755
|
|
|
d570700 |
--- a/seinfoflow
|
|
|
d570700 |
+++ b/seinfoflow
|
|
|
d570700 |
@@ -19,6 +19,7 @@
|
|
|
d570700 |
|
|
|
d570700 |
from __future__ import print_function
|
|
|
d570700 |
import setools
|
|
|
d570700 |
+import setools.infoflow
|
|
|
d570700 |
import argparse
|
|
|
d570700 |
import sys
|
|
|
d570700 |
import logging
|
|
|
d570700 |
@@ -79,7 +80,7 @@ else:
|
|
|
d570700 |
try:
|
|
|
d570700 |
p = setools.SELinuxPolicy(args.policy)
|
|
|
d570700 |
m = setools.PermissionMap(args.map)
|
|
|
d570700 |
- g = setools.InfoFlowAnalysis(p, m, min_weight=args.min_weight, exclude=args.exclude)
|
|
|
d570700 |
+ g = setools.infoflow.InfoFlowAnalysis(p, m, min_weight=args.min_weight, exclude=args.exclude)
|
|
|
d570700 |
|
|
|
d570700 |
if args.shortest_path or args.all_paths:
|
|
|
d570700 |
if args.shortest_path:
|
|
|
d570700 |
diff --git a/setools/__init__.py b/setools/__init__.py
|
|
|
d570700 |
index a84c846..a53c5a7 100644
|
|
|
d570700 |
--- a/setools/__init__.py
|
|
|
d570700 |
+++ b/setools/__init__.py
|
|
|
d570700 |
@@ -74,11 +74,11 @@ from .pcideviceconquery import PcideviceconQuery
|
|
|
d570700 |
from .devicetreeconquery import DevicetreeconQuery
|
|
|
d570700 |
|
|
|
d570700 |
# Information Flow Analysis
|
|
|
d570700 |
-from .infoflow import InfoFlowAnalysis
|
|
|
d570700 |
+# from .infoflow import InfoFlowAnalysis
|
|
|
d570700 |
from .permmap import PermissionMap
|
|
|
d570700 |
|
|
|
d570700 |
# Domain Transition Analysis
|
|
|
d570700 |
-from .dta import DomainTransitionAnalysis
|
|
|
d570700 |
+# from .dta import DomainTransitionAnalysis
|
|
|
d570700 |
|
|
|
d570700 |
# Policy difference
|
|
|
d570700 |
from .diff import PolicyDifference
|
|
|
d570700 |
diff --git a/setoolsgui/apol/dta.py b/setoolsgui/apol/dta.py
|
|
|
d570700 |
index 0aaf13f..5b1ea20 100644
|
|
|
d570700 |
--- a/setoolsgui/apol/dta.py
|
|
|
d570700 |
+++ b/setoolsgui/apol/dta.py
|
|
|
d570700 |
@@ -23,7 +23,7 @@ from PyQt5.QtCore import pyqtSignal, Qt, QStringListModel, QThread
|
|
|
d570700 |
from PyQt5.QtGui import QPalette, QTextCursor
|
|
|
d570700 |
from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog, \
|
|
|
d570700 |
QTreeWidgetItem
|
|
|
d570700 |
-from setools import DomainTransitionAnalysis
|
|
|
d570700 |
+from setools.dta import DomainTransitionAnalysis
|
|
|
d570700 |
|
|
|
d570700 |
from ..logtosignal import LogHandlerToSignal
|
|
|
d570700 |
from .analysistab import AnalysisTab
|
|
|
d570700 |
diff --git a/setoolsgui/apol/infoflow.py b/setoolsgui/apol/infoflow.py
|
|
|
d570700 |
index 1ae16de..fdf8f7b 100644
|
|
|
d570700 |
--- a/setoolsgui/apol/infoflow.py
|
|
|
d570700 |
+++ b/setoolsgui/apol/infoflow.py
|
|
|
d570700 |
@@ -25,7 +25,7 @@ from PyQt5.QtCore import pyqtSignal, Qt, QStringListModel, QThread
|
|
|
d570700 |
from PyQt5.QtGui import QPalette, QTextCursor
|
|
|
d570700 |
from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog, \
|
|
|
d570700 |
QTreeWidgetItem
|
|
|
d570700 |
-from setools import InfoFlowAnalysis
|
|
|
d570700 |
+from setools.infoflow import InfoFlowAnalysis
|
|
|
d570700 |
from setools.exception import UnmappedClass, UnmappedPermission
|
|
|
d570700 |
|
|
|
d570700 |
from ..logtosignal import LogHandlerToSignal
|
|
|
d570700 |
diff --git a/tests/dta.py b/tests/dta.py
|
|
|
d570700 |
index 32b9271..2bdd052 100644
|
|
|
d570700 |
--- a/tests/dta.py
|
|
|
d570700 |
+++ b/tests/dta.py
|
|
|
d570700 |
@@ -17,7 +17,8 @@
|
|
|
d570700 |
#
|
|
|
d570700 |
import unittest
|
|
|
d570700 |
|
|
|
d570700 |
-from setools import SELinuxPolicy, DomainTransitionAnalysis
|
|
|
d570700 |
+from setools import SELinuxPolicy
|
|
|
d570700 |
+from setools.dta import DomainTransitionAnalysis
|
|
|
d570700 |
from setools import TERuletype as TERT
|
|
|
d570700 |
from setools.policyrep.exception import InvalidType
|
|
|
d570700 |
from setools.policyrep.typeattr import Type
|
|
|
d570700 |
diff --git a/tests/infoflow.py b/tests/infoflow.py
|
|
|
d570700 |
index 7751dda..a21c683 100644
|
|
|
d570700 |
--- a/tests/infoflow.py
|
|
|
d570700 |
+++ b/tests/infoflow.py
|
|
|
d570700 |
@@ -17,7 +17,8 @@
|
|
|
d570700 |
#
|
|
|
d570700 |
import unittest
|
|
|
d570700 |
|
|
|
d570700 |
-from setools import SELinuxPolicy, InfoFlowAnalysis
|
|
|
d570700 |
+from setools import SELinuxPolicy
|
|
|
d570700 |
+from setools.infoflow import InfoFlowAnalysis
|
|
|
d570700 |
from setools import TERuletype as TERT
|
|
|
d570700 |
from setools.permmap import PermissionMap
|
|
|
d570700 |
from setools.policyrep.exception import InvalidType
|
|
|
d570700 |
--
|
|
|
d570700 |
2.9.3
|
|
|
d570700 |
|