mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-11 07:18:15 +00:00
parent
87c8b85c98
commit
14aa86c99d
779
data/portconquery.ui
Normal file
779
data/portconquery.ui
Normal file
@ -0,0 +1,779 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PortconQueryTab_ui</class>
|
||||
<widget class="QScrollArea" name="PortconQueryTab_ui">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>774</width>
|
||||
<height>846</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="contents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>772</width>
|
||||
<height>844</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_9">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="3" column="0" colspan="5">
|
||||
<widget class="QTextEdit" name="notes">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Optionally enter notes here about the query.</string>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Enter notes here.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QCheckBox" name="notes_expander">
|
||||
<property name="toolTip">
|
||||
<string>Show or hide the notes field (no data is lost)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Notes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QCheckBox" name="criteria_expander">
|
||||
<property name="toolTip">
|
||||
<string>Show or hide the search criteria (no settings are lost)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Criteria</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Portcon Statements</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Show:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="5">
|
||||
<widget class="QTabWidget" name="results_frame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="results_framePage1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Results</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTableView" name="table_results">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="results_framePage2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Raw Results</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="raw_results">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Monospace</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="documentTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QPlainTextEdit::NoWrap</enum>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="5">
|
||||
<widget class="QFrame" name="criteria_frame">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="3" rowspan="2">
|
||||
<widget class="QGroupBox" name="range_criteria">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Context MLS Range</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="2" column="1">
|
||||
<widget class="QRadioButton" name="range_exact">
|
||||
<property name="toolTip">
|
||||
<string>Match the context's range if the criteria is equal to the context's range.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Equal</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QRadioButton" name="range_overlap">
|
||||
<property name="toolTip">
|
||||
<string>Match the context's range if the criteria overlaps the context's range.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Overlap</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QRadioButton" name="range_subset">
|
||||
<property name="toolTip">
|
||||
<string>Match the context's range if the criteria is a subset of the context's range.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Subset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QRadioButton" name="range_superset">
|
||||
<property name="toolTip">
|
||||
<string>Match the context's range if the criteria is a superset to the context's range.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Superset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="range_">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" rowspan="2">
|
||||
<widget class="QGroupBox" name="type_criteria">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Context Type</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="type_regex">
|
||||
<property name="toolTip">
|
||||
<string>Use regular expressions to match the context's type.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Regex</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="type_">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" rowspan="2">
|
||||
<widget class="QGroupBox" name="role_criteria">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Context Role</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="role">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="role_regex">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Use regular expressions to match the context's role.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Regex</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" rowspan="2">
|
||||
<widget class="QGroupBox" name="user_critera">
|
||||
<property name="title">
|
||||
<string>Context User</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="user">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="user_regex">
|
||||
<property name="toolTip">
|
||||
<string>Use regular expressions to match the context's user.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Regex</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="port_criteria">
|
||||
<property name="title">
|
||||
<string>Port/Port Range</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="ports">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>e.g. 80 or 6000-6010</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QRadioButton" name="ports_superset">
|
||||
<property name="toolTip">
|
||||
<string>Match the port range if the criteria is a superset to the portcon's port range.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Superset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QRadioButton" name="ports_overlap">
|
||||
<property name="toolTip">
|
||||
<string>Match the port range if the criteria overlaps the portcon's port range.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Overlap</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QRadioButton" name="ports_exact">
|
||||
<property name="toolTip">
|
||||
<string>Match the port range if the criteria is equal to the portcon's port range.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Equal</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QRadioButton" name="ports_subset">
|
||||
<property name="toolTip">
|
||||
<string>Match the port range if the criteria is a subset of the portcon's port range.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Subset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QGroupBox" name="protocol_criteria">
|
||||
<property name="title">
|
||||
<string>Protocol</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QComboBox" name="protocol">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>TCP</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>UDP</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>role_criteria</zorder>
|
||||
<zorder>type_criteria</zorder>
|
||||
<zorder>user_critera</zorder>
|
||||
<zorder>range_criteria</zorder>
|
||||
<zorder>buttonBox</zorder>
|
||||
<zorder>protocol_criteria</zorder>
|
||||
<zorder>port_criteria</zorder>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>criteria_expander</tabstop>
|
||||
<tabstop>notes_expander</tabstop>
|
||||
<tabstop>user</tabstop>
|
||||
<tabstop>user_regex</tabstop>
|
||||
<tabstop>role</tabstop>
|
||||
<tabstop>role_regex</tabstop>
|
||||
<tabstop>type_</tabstop>
|
||||
<tabstop>type_regex</tabstop>
|
||||
<tabstop>range_</tabstop>
|
||||
<tabstop>range_exact</tabstop>
|
||||
<tabstop>range_overlap</tabstop>
|
||||
<tabstop>range_subset</tabstop>
|
||||
<tabstop>range_superset</tabstop>
|
||||
<tabstop>results_frame</tabstop>
|
||||
<tabstop>table_results</tabstop>
|
||||
<tabstop>raw_results</tabstop>
|
||||
<tabstop>notes</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>criteria_expander</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>criteria_frame</receiver>
|
||||
<slot>setVisible(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>592</x>
|
||||
<y>16</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>386</x>
|
||||
<y>232</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>notes_expander</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>notes</receiver>
|
||||
<slot>setVisible(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>735</x>
|
||||
<y>16</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>386</x>
|
||||
<y>756</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -35,6 +35,7 @@ from .infoflow import InfoFlowAnalysisTab
|
||||
from .initsidquery import InitialSIDQueryTab
|
||||
from .mlsrulequery import MLSRuleQueryTab
|
||||
from .netifconquery import NetifconQueryTab
|
||||
from .portconquery import PortconQueryTab
|
||||
from .rbacrulequery import RBACRuleQueryTab
|
||||
from .rolequery import RoleQueryTab
|
||||
from .terulequery import TERuleQueryTab
|
||||
@ -284,7 +285,8 @@ class ChooseAnalysis(SEToolsWidget, QDialog):
|
||||
_labeling_map = {"fs_use_* Statements": FSUseQueryTab,
|
||||
"Genfscon Statements": GenfsconQueryTab,
|
||||
"Initial SID Statements": InitialSIDQueryTab,
|
||||
"Netifcon Statements": NetifconQueryTab}
|
||||
"Netifcon Statements": NetifconQueryTab,
|
||||
"Portcon Statements": PortconQueryTab}
|
||||
_analysis_choices = {"Components": _components_map,
|
||||
"Rules": _rule_map,
|
||||
"Analyses": _analysis_map,
|
||||
|
284
setoolsgui/apol/portconquery.py
Normal file
284
setoolsgui/apol/portconquery.py
Normal file
@ -0,0 +1,284 @@
|
||||
# Copyright 2016, Tresys Technology, LLC
|
||||
#
|
||||
# This file is part of SETools.
|
||||
#
|
||||
# SETools is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as
|
||||
# published by the Free Software Foundation, either version 2.1 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# SETools is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with SETools. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
import logging
|
||||
|
||||
from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread
|
||||
from PyQt5.QtGui import QPalette, QTextCursor
|
||||
from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog, QScrollArea
|
||||
from setools import PortconQuery
|
||||
|
||||
from ..logtosignal import LogHandlerToSignal
|
||||
from ..portconmodel import PortconTableModel
|
||||
from ..widget import SEToolsWidget
|
||||
from .queryupdater import QueryResultsUpdater
|
||||
|
||||
|
||||
class PortconQueryTab(SEToolsWidget, QScrollArea):
|
||||
|
||||
"""An portcon query."""
|
||||
|
||||
def __init__(self, parent, policy, perm_map):
|
||||
super(PortconQueryTab, self).__init__(parent)
|
||||
self.log = logging.getLogger(__name__)
|
||||
self.policy = policy
|
||||
self.query = PortconQuery(policy)
|
||||
self.setupUi()
|
||||
|
||||
def __del__(self):
|
||||
self.thread.quit()
|
||||
self.thread.wait(5000)
|
||||
logging.getLogger("setools.portconquery").removeHandler(self.handler)
|
||||
|
||||
def setupUi(self):
|
||||
self.load_ui("portconquery.ui")
|
||||
|
||||
# set up user autocompletion
|
||||
user_completion_list = [str(u) for u in self.policy.users()]
|
||||
user_completer_model = QStringListModel(self)
|
||||
user_completer_model.setStringList(sorted(user_completion_list))
|
||||
self.user_completion = QCompleter()
|
||||
self.user_completion.setModel(user_completer_model)
|
||||
self.user.setCompleter(self.user_completion)
|
||||
|
||||
# set up role autocompletion
|
||||
role_completion_list = [str(r) for r in self.policy.roles()]
|
||||
role_completer_model = QStringListModel(self)
|
||||
role_completer_model.setStringList(sorted(role_completion_list))
|
||||
self.role_completion = QCompleter()
|
||||
self.role_completion.setModel(role_completer_model)
|
||||
self.role.setCompleter(self.role_completion)
|
||||
|
||||
# set up type autocompletion
|
||||
type_completion_list = [str(t) for t in self.policy.types()]
|
||||
type_completer_model = QStringListModel(self)
|
||||
type_completer_model.setStringList(sorted(type_completion_list))
|
||||
self.type_completion = QCompleter()
|
||||
self.type_completion.setModel(type_completer_model)
|
||||
self.type_.setCompleter(self.type_completion)
|
||||
|
||||
# setup indications of errors on source/target/default
|
||||
self.orig_palette = self.type_.palette()
|
||||
self.error_palette = self.type_.palette()
|
||||
self.error_palette.setColor(QPalette.Base, Qt.red)
|
||||
self.clear_ports_error()
|
||||
self.clear_user_error()
|
||||
self.clear_type_error()
|
||||
self.clear_role_error()
|
||||
self.clear_range_error()
|
||||
|
||||
# set up results
|
||||
self.table_results_model = PortconTableModel(self)
|
||||
self.sort_proxy = QSortFilterProxyModel(self)
|
||||
self.sort_proxy.setSourceModel(self.table_results_model)
|
||||
self.table_results.setModel(self.sort_proxy)
|
||||
self.table_results.sortByColumn(0, Qt.AscendingOrder)
|
||||
|
||||
# set up processing thread
|
||||
self.thread = QThread()
|
||||
self.worker = QueryResultsUpdater(self.query, self.table_results_model)
|
||||
self.worker.moveToThread(self.thread)
|
||||
self.worker.raw_line.connect(self.raw_results.appendPlainText)
|
||||
self.worker.finished.connect(self.update_complete)
|
||||
self.worker.finished.connect(self.thread.quit)
|
||||
self.thread.started.connect(self.worker.update)
|
||||
|
||||
# create a "busy, please wait" dialog
|
||||
self.busy = QProgressDialog(self)
|
||||
self.busy.setModal(True)
|
||||
self.busy.setRange(0, 0)
|
||||
self.busy.setMinimumDuration(0)
|
||||
self.busy.canceled.connect(self.thread.requestInterruption)
|
||||
self.busy.reset()
|
||||
|
||||
# update busy dialog from query INFO logs
|
||||
self.handler = LogHandlerToSignal()
|
||||
self.handler.message.connect(self.busy.setLabelText)
|
||||
logging.getLogger("setools.portconquery").addHandler(self.handler)
|
||||
|
||||
# Ensure settings are consistent with the initial .ui state
|
||||
self.criteria_frame.setHidden(not self.criteria_expander.isChecked())
|
||||
self.notes.setHidden(not self.notes_expander.isChecked())
|
||||
|
||||
# Range criteria is visible only if policy is MLS
|
||||
self.range_criteria.setVisible(self.policy.mls)
|
||||
|
||||
# connect signals
|
||||
self.buttonBox.clicked.connect(self.run)
|
||||
self.ports.textEdited.connect(self.clear_ports_error)
|
||||
self.ports.editingFinished.connect(self.set_ports)
|
||||
self.user.textEdited.connect(self.clear_user_error)
|
||||
self.user.editingFinished.connect(self.set_user)
|
||||
self.user_regex.toggled.connect(self.set_user_regex)
|
||||
self.role.textEdited.connect(self.clear_role_error)
|
||||
self.role.editingFinished.connect(self.set_role)
|
||||
self.role_regex.toggled.connect(self.set_role_regex)
|
||||
self.type_.textEdited.connect(self.clear_type_error)
|
||||
self.type_.editingFinished.connect(self.set_type)
|
||||
self.type_regex.toggled.connect(self.set_type_regex)
|
||||
self.range_.textEdited.connect(self.clear_range_error)
|
||||
self.range_.editingFinished.connect(self.set_range)
|
||||
|
||||
#
|
||||
# Ports criteria
|
||||
#
|
||||
def clear_ports_error(self):
|
||||
self.ports.setToolTip("Match the ports.")
|
||||
self.ports.setPalette(self.orig_palette)
|
||||
|
||||
def set_ports(self):
|
||||
try:
|
||||
pending_ports = self.ports.text()
|
||||
if pending_ports:
|
||||
try:
|
||||
ports = [int(i) for i in pending_ports.split("-")]
|
||||
except ValueError:
|
||||
raise ValueError("Enter a port number or range, e.g. 22 or 6000-6020")
|
||||
|
||||
if len(ports) == 2:
|
||||
self.query.ports = ports
|
||||
elif len(ports) == 1:
|
||||
self.query.ports = (ports[0], ports[0])
|
||||
else:
|
||||
raise ValueError("Enter a port number or range, e.g. 22 or 6000-6020")
|
||||
else:
|
||||
self.query.ports = (0, 0)
|
||||
|
||||
except Exception as ex:
|
||||
self.log.error("Ports error: {0}".format(ex))
|
||||
self.ports.setToolTip("Error: " + str(ex))
|
||||
self.ports.setPalette(self.error_palette)
|
||||
|
||||
#
|
||||
# User criteria
|
||||
#
|
||||
def clear_user_error(self):
|
||||
self.user.setToolTip("Match the user of the context.")
|
||||
self.user.setPalette(self.orig_palette)
|
||||
|
||||
def set_user(self):
|
||||
try:
|
||||
self.query.user = self.user.text()
|
||||
except Exception as ex:
|
||||
self.log.error("Context user error: {0}".format(ex))
|
||||
self.user.setToolTip("Error: " + str(ex))
|
||||
self.user.setPalette(self.error_palette)
|
||||
|
||||
def set_user_regex(self, state):
|
||||
self.log.debug("Setting user_regex {0}".format(state))
|
||||
self.query.user_regex = state
|
||||
self.clear_user_error()
|
||||
self.set_user()
|
||||
|
||||
#
|
||||
# Role criteria
|
||||
#
|
||||
def clear_role_error(self):
|
||||
self.role.setToolTip("Match the role of the context.")
|
||||
self.role.setPalette(self.orig_palette)
|
||||
|
||||
def set_role(self):
|
||||
try:
|
||||
self.query.role = self.role.text()
|
||||
except Exception as ex:
|
||||
self.log.error("Context role error: {0}".format(ex))
|
||||
self.role.setToolTip("Error: " + str(ex))
|
||||
self.role.setPalette(self.error_palette)
|
||||
|
||||
def set_role_regex(self, state):
|
||||
self.log.debug("Setting role_regex {0}".format(state))
|
||||
self.query.role_regex = state
|
||||
self.clear_role_error()
|
||||
self.set_role()
|
||||
|
||||
#
|
||||
# Type criteria
|
||||
#
|
||||
def clear_type_error(self):
|
||||
self.type_.setToolTip("Match the type of the context.")
|
||||
self.type_.setPalette(self.orig_palette)
|
||||
|
||||
def set_type(self):
|
||||
try:
|
||||
self.query.type_ = self.type_.text()
|
||||
except Exception as ex:
|
||||
self.log.error("Context type error: {0}".format(ex))
|
||||
self.type_.setToolTip("Error: " + str(ex))
|
||||
self.type_.setPalette(self.error_palette)
|
||||
|
||||
def set_type_regex(self, state):
|
||||
self.log.debug("Setting type_regex {0}".format(state))
|
||||
self.query.type_regex = state
|
||||
self.clear_type_error()
|
||||
self.set_type()
|
||||
|
||||
#
|
||||
# Range criteria
|
||||
#
|
||||
def clear_range_error(self):
|
||||
self.range_.setToolTip("Match the range of the context.")
|
||||
self.range_.setPalette(self.orig_palette)
|
||||
|
||||
def set_range(self):
|
||||
try:
|
||||
self.query.range_ = self.range_.text()
|
||||
except Exception as ex:
|
||||
self.log.info("Context range error: " + str(ex))
|
||||
self.range_.setToolTip("Error: " + str(ex))
|
||||
self.range_.setPalette(self.error_palette)
|
||||
|
||||
#
|
||||
# Results runner
|
||||
#
|
||||
def run(self, button):
|
||||
# right now there is only one button.
|
||||
self.query.ports_overlap = self.ports_overlap.isChecked()
|
||||
self.query.ports_subset = self.ports_subset.isChecked()
|
||||
self.query.ports_superset = self.ports_superset.isChecked()
|
||||
self.query.protocol = self.protocol.currentData(Qt.DisplayRole)
|
||||
self.query.range_overlap = self.range_overlap.isChecked()
|
||||
self.query.range_subset = self.range_subset.isChecked()
|
||||
self.query.range_superset = self.range_superset.isChecked()
|
||||
|
||||
# start processing
|
||||
self.busy.setLabelText("Processing query...")
|
||||
self.busy.show()
|
||||
self.raw_results.clear()
|
||||
self.thread.start()
|
||||
|
||||
def update_complete(self, count):
|
||||
self.log.info("{0} portcon statment(s) found.".format(count))
|
||||
|
||||
# update sizes/location of result displays
|
||||
if not self.busy.wasCanceled():
|
||||
self.busy.setLabelText("Resizing the result table's columns; GUI may be unresponsive")
|
||||
self.busy.repaint()
|
||||
self.table_results.resizeColumnsToContents()
|
||||
|
||||
if not self.busy.wasCanceled():
|
||||
self.busy.setLabelText("Resizing the result table's rows; GUI may be unresponsive")
|
||||
self.busy.repaint()
|
||||
self.table_results.resizeRowsToContents()
|
||||
|
||||
if not self.busy.wasCanceled():
|
||||
self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive")
|
||||
self.busy.repaint()
|
||||
self.raw_results.moveCursor(QTextCursor.Start)
|
||||
|
||||
self.busy.reset()
|
54
setoolsgui/portconmodel.py
Normal file
54
setoolsgui/portconmodel.py
Normal file
@ -0,0 +1,54 @@
|
||||
# Copyright 2016, Tresys Technology, LLC
|
||||
#
|
||||
# This file is part of SETools.
|
||||
#
|
||||
# SETools is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as
|
||||
# published by the Free Software Foundation, either version 2.1 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# SETools is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with SETools. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
from collections import defaultdict
|
||||
|
||||
from PyQt5.QtCore import Qt, QModelIndex
|
||||
|
||||
from .models import SEToolsTableModel
|
||||
|
||||
|
||||
class PortconTableModel(SEToolsTableModel):
|
||||
|
||||
"""Table-based model for portcons."""
|
||||
|
||||
headers = defaultdict(str, {0: "Port/Port Range", 1: "Protocol", 2: "Context"})
|
||||
|
||||
def columnCount(self, parent=QModelIndex()):
|
||||
return 3
|
||||
|
||||
def data(self, index, role):
|
||||
if self.resultlist:
|
||||
row = index.row()
|
||||
col = index.column()
|
||||
rule = self.resultlist[row]
|
||||
|
||||
if role == Qt.DisplayRole:
|
||||
if col == 0:
|
||||
low, high = rule.ports
|
||||
if low == high:
|
||||
return str(low)
|
||||
else:
|
||||
return "{0}-{1}".format(low, high)
|
||||
elif col == 1:
|
||||
return str(rule.protocol)
|
||||
elif col == 2:
|
||||
return str(rule.context)
|
||||
|
||||
elif role == Qt.UserRole:
|
||||
return rule
|
Loading…
Reference in New Issue
Block a user