SETools 4.7.0

- Add MCP server to provide LLMs the ability to analyze policy.

Note: adding dependency on the freshly rebased userspace (3.11)

Resolves: RHEL-188035
This commit is contained in:
Vit Mojzis 2026-07-10 20:34:36 +02:00
parent 945db6459b
commit 9daa6399da
6 changed files with 48 additions and 94 deletions

1
.gitignore vendored
View File

@ -19,3 +19,4 @@ setools-3.3.8-f1e5b20.tar.bz2
/4.5.0.tar.gz
/4.5.1.tar.gz
/4.6.0.tar.gz
/4.7.0.tar.gz

View File

@ -0,0 +1,37 @@
From a5579c77fb85542ca588519e3910180b387c3df6 Mon Sep 17 00:00:00 2001
From: Vit Mojzis <vmojzis@redhat.com>
Date: Fri, 10 Jul 2026 23:39:20 +0200
Subject: [PATCH] pyproject.toml: fix license field
Fixes:
ValueError: invalid pyproject.toml config: `project.license`.
configuration error: `project.license` must be valid exactly by one definition (2 matches found):
- keys:
'file': {type: string}
required: ['file']
- keys:
'text': {type: string}
required: ['text']
Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
---
pyproject.toml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 29649f1..9cf0e13 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -9,8 +9,7 @@ name = "setools"
version = "4.7.0"
description="SELinux policy analysis tools."
authors = [{name = "Chris PeBenito", email="pebenito@ieee.org"}]
-license = "LGPL-2.1-only AND GPL-2.0-only"
-license-files = ["COPYING*"]
+license = {text = "LGPL-2.1-only AND GPL-2.0-only"}
readme = {file = "README.md", content-type = "text/markdown"}
urls.Homepage = "https://github.com/SELinuxProject/setools"
urls.Repository = "https://github.com/SELinuxProject/setools.git"
--
2.53.0

View File

@ -1,43 +0,0 @@
From 39f7c88251925463c38f5000f6178fe70b484f44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Tue, 8 Apr 2025 11:22:47 +0200
Subject: [PATCH] Remove redundant runtime requirement on setuptools
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The dependency was dropped in 99a1cf3b50cd8bf502b5070293c4d1bf792d1566
Add a build time dependency for setup.py build_ext on Python 3.12+
which no longer contains distutils.
Signed-off-by: Miro Hrončok <miro@hroncok.cz>
---
pyproject.toml | 2 +-
tox.ini | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index f7815a15..28ae121a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -39,7 +39,7 @@ classifiers = ["Development Status :: 5 - Production/Stable",
requires-python=">=3.10"
# also requires libsepol.so and libselinux.so.
-dependencies = ["setuptools"]
+dependencies = []
optional-dependencies.analysis = ["networkx>=2.6",
"pygraphviz"]
diff --git a/tox.ini b/tox.ini
index 8fa6954f..b2a21d6b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -56,5 +56,6 @@ deps = networkx>=2.6
pygraphviz
pytest-qt
pytest-xvfb
+ setuptools;python_version>="3.12"
commands_pre = {envpython} setup.py build_ext -i
commands = {envpython} -m pytest tests

View File

@ -1,42 +0,0 @@
From a33a2e394435316f3822e89ac9c2a9aabab17252 Mon Sep 17 00:00:00 2001
From: Pranav Lawate <pran.lawate@gmail.com>
Date: Tue, 30 Sep 2025 22:29:10 +0530
Subject: [PATCH] Fix seinfo argument parsing when policy path follows query
options
Signed-off-by: Pranav Lawate <pran.lawate@gmail.com>
---
seinfo | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/seinfo b/seinfo
index 99180c36..d04ec320 100755
--- a/seinfo
+++ b/seinfo
@@ -12,6 +12,7 @@ import logging
import signal
import ipaddress
import warnings
+from pathlib import Path
from typing import Callable, List, Tuple
@@ -102,6 +103,18 @@ xen.add_argument("--devicetreecon", help="Print all devicetreecon statements.",
args = parser.parse_args()
+# Fix argument misparsing: when policy is None and a query option is a string,
+# check if the string is actually a policy file that is incorrectly consumed by the query option
+if not args.policy:
+ # Check all query options defined in the queries argument group
+ for action in queries._group_actions:
+ value = getattr(args, action.dest, None)
+ if isinstance(value, str) and Path(value).exists():
+ # This query argument consumed the policy path - fix it
+ args.policy = value
+ setattr(args, action.dest, True)
+ break
+
if args.debug:
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s|%(levelname)s|%(name)s|%(message)s')

View File

@ -1,9 +1,9 @@
%global sepol_ver 3.10
%global selinux_ver 3.10
%global sepol_ver 3.11
%global selinux_ver 3.11
Name: setools
Version: 4.6.0
Release: 3%{?dist}
Version: 4.7.0
Release: 1%{?dist}
Summary: Policy analysis tools for SELinux
License: GPL-2.0-only AND LGPL-2.1-only
@ -12,10 +12,7 @@ Source0: https://github.com/SELinuxProject/setools/archive/%{version}.tar
Source1: setools.pam
Source2: apol.desktop
# Remove redundant runtime requirement on setuptools
Patch: https://github.com/SELinuxProject/setools/pull/156.patch
# Fix seinfo argument parsing when policy path follows query
Patch: https://github.com/SELinuxProject/setools/pull/157.patch
Patch: 0001-pyproject.toml-fix-license-field.patch
Obsoletes: setools < 4.0.0, setools-devel < 4.0.0
BuildRequires: flex, bison
@ -120,6 +117,7 @@ Python modules designed to facilitate SELinux policy analysis.
%{_bindir}/sediff
%{_bindir}/seinfo
%{_bindir}/sesearch
%{_bindir}/setools-mcp
%{_mandir}/man1/sechecker*
%{_mandir}/man1/sediff*
%{_mandir}/man1/seinfo*
@ -150,6 +148,9 @@ Python modules designed to facilitate SELinux policy analysis.
%{_mandir}/ru/man1/apol*
%changelog
* Fri Jul 10 2026 Vit Mojzis <vmojzis@redhat.com> - 4.7.0-1
- SETools 4.7.0 (RHEL-188035)
* Tue Feb 17 2026 Vit Mojzis <vmojzis@redhat.com> - 4.6.0-3
- Rebuild for SELinux userspace 3.10 (RHEL-150462)

View File

@ -1 +1 @@
SHA512 (4.6.0.tar.gz) = 5b654f480f285717d15fa55f754fbd00cb030a0d8af8342d901e0514c4fdbacb7873e19420dab98540eaa481c687ff1e03423df893c0d1744eb4c53eb81afbf5
SHA512 (4.7.0.tar.gz) = 4041bc4551b47c8c1fc40e89e71e1e96d1ab3a1033fe96f807212311aca7a2e231d9c786a638916d64694a5ed66f9cd3d72b07e6aab60f834c4aef0ca395911f