Пример #1
0
    def show(self, mls):
        analysis_map = {
            "Domain Transition Analysis": DomainTransitionAnalysisTab,
            "Information Flow Analysis": InfoFlowAnalysisTab
        }
        components_map = {
            "Booleans": BoolQueryTab,
            "Commons": CommonQueryTab,
            "Roles": RoleQueryTab,
            "Object Classes": ObjClassQueryTab,
            "Types": TypeQueryTab,
            "Type Attributes": TypeAttributeQueryTab,
            "Users": UserQueryTab
        }
        rule_map = {
            "Constraints": ConstraintQueryTab,
            "RBAC Rules": RBACRuleQueryTab,
            "TE Rules": TERuleQueryTab
        }
        labeling_map = {
            "Fs_use_* Statements": FSUseQueryTab,
            "Genfscon Statements": GenfsconQueryTab,
            "Initial SID Statements": InitialSIDQueryTab,
            "Netifcon Statements": NetifconQueryTab,
            "Nodecon Statements": NodeconQueryTab,
            "Portcon Statements": PortconQueryTab
        }
        general_choices = {"Summary": SummaryTab}
        other_choices = {"Bounds": BoundsQueryTab, "Defaults": DefaultQueryTab}
        analysis_choices = {
            "Components": components_map,
            "Rules": rule_map,
            "Analyses": analysis_map,
            "Labeling": labeling_map,
            "General": general_choices,
            "Other": other_choices
        }

        if mls:
            rule_map["MLS Rules"] = MLSRuleQueryTab
            components_map["Categories"] = CategoryQueryTab
            components_map["Sensitivities"] = SensitivityQueryTab

        # populate the item list:
        self.analysisTypes.clear()
        for groupname, group in analysis_choices.items():
            groupitem = QTreeWidgetItem(self.analysisTypes)
            groupitem.setText(0, groupname)
            groupitem._tab_class = None
            for entryname, cls in group.items():
                item = QTreeWidgetItem(groupitem)
                item.setText(0, entryname)
                item._tab_class = cls
                groupitem.addChild(item)

        self.analysisTypes.expandAll()
        self.analysisTypes.sortByColumn(0, Qt.AscendingOrder)
        super(ChooseAnalysis, self).show()
Пример #2
0
    def show(self, mls):
        analysis_map = {"Domain Transition Analysis": DomainTransitionAnalysisTab,
                        "Information Flow Analysis": InfoFlowAnalysisTab}
        components_map = {"Booleans": BoolQueryTab,
                          "Commons": CommonQueryTab,
                          "Roles": RoleQueryTab,
                          "Object Classes": ObjClassQueryTab,
                          "Types": TypeQueryTab,
                          "Type Attributes": TypeAttributeQueryTab,
                          "Users": UserQueryTab}
        rule_map = {"Constraints": ConstraintQueryTab,
                    "RBAC Rules": RBACRuleQueryTab,
                    "TE Rules": TERuleQueryTab}
        labeling_map = {"Fs_use_* Statements": FSUseQueryTab,
                        "Genfscon Statements": GenfsconQueryTab,
                        "Initial SID Statements": InitialSIDQueryTab,
                        "Netifcon Statements": NetifconQueryTab,
                        "Nodecon Statements": NodeconQueryTab,
                        "Portcon Statements": PortconQueryTab}
        general_choices = {"Summary": SummaryTab}
        other_choices = {"Bounds": BoundsQueryTab,
                         "Defaults": DefaultQueryTab}
        analysis_choices = {"Components": components_map,
                            "Rules": rule_map,
                            "Analyses": analysis_map,
                            "Labeling": labeling_map,
                            "General": general_choices,
                            "Other": other_choices}

        if mls:
            rule_map["MLS Rules"] = MLSRuleQueryTab
            components_map["Categories"] = CategoryQueryTab
            components_map["Sensitivities"] = SensitivityQueryTab

        # populate the item list:
        self.analysisTypes.clear()
        for groupname, group in analysis_choices.items():
            groupitem = QTreeWidgetItem(self.analysisTypes)
            groupitem.setText(0, groupname)
            groupitem._tab_class = None
            for entryname, cls in group.items():
                item = QTreeWidgetItem(groupitem)
                item.setText(0, entryname)
                item._tab_class = cls
                groupitem.addChild(item)

        self.analysisTypes.expandAll()
        self.analysisTypes.sortByColumn(0, Qt.AscendingOrder)
        super(ChooseAnalysis, self).show()
Пример #3
0
    def show(self, mls):
        self.analysisTypes.clear()
        for groupname, group in self.analysis_choices.items():
            groupitem = QTreeWidgetItem(self.analysisTypes)
            groupitem.setText(0, groupname)
            groupitem._tab_class = None
            for entryname, cls in group.items():
                if cls.mlsonly and not mls:
                    continue

                item = QTreeWidgetItem(groupitem)
                item.setText(0, entryname)
                item._tab_class = cls
                groupitem.addChild(item)

        self.analysisTypes.expandAll()
        self.analysisTypes.sortByColumn(0, Qt.AscendingOrder)
        super(ChooseAnalysis, self).show()
Пример #4
0
    def setupUi(self):
        self.load_ui("choose_analysis.ui")
        self.buttonBox.accepted.connect(self.ok_clicked)
        self.analysisTypes.doubleClicked.connect(self.ok_clicked)

        # populate the item list:
        self.analysisTypes.clear()
        for groupname, group in self._analysis_choices.items():
            groupitem = QTreeWidgetItem(self.analysisTypes)
            groupitem.setText(0, groupname)
            groupitem._tab_class = None
            for entryname, cls in group.items():
                item = QTreeWidgetItem(groupitem)
                item.setText(0, entryname)
                item._tab_class = cls
                groupitem.addChild(item)

        self.analysisTypes.expandAll()
Пример #5
0
    def setupUi(self):
        self.load_ui("choose_analysis.ui")
        self.buttonBox.accepted.connect(self.ok_clicked)
        self.analysisTypes.doubleClicked.connect(self.ok_clicked)

        # populate the item list:
        self.analysisTypes.clear()
        for groupname, group in self._analysis_choices.items():
            groupitem = QTreeWidgetItem(self.analysisTypes)
            groupitem.setText(0, groupname)
            groupitem._tab_class = None
            for entryname, cls in group.items():
                item = QTreeWidgetItem(groupitem)
                item.setText(0, entryname)
                item._tab_class = cls
                groupitem.addChild(item)

        self.analysisTypes.expandAll()
        self.analysisTypes.sortByColumn(0, Qt.AscendingOrder)