Compare commits

...
Sign in to create a new pull request.

22 commits

Author SHA1 Message Date
Python Maint
622553b611 Rebuilt for Python 3.14.0rc3 bytecode 2025-09-19 12:34:48 +02:00
Python Maint
b22058781d Rebuilt for Python 3.14.0rc2 bytecode 2025-08-15 13:04:07 +02:00
Fedora Release Engineering
b69db95272 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-24 23:39:37 +00:00
Python Maint
22f5bcd187 Rebuilt for Python 3.14 2025-06-04 21:29:43 +02:00
Fedora Release Engineering
de5a49c95a Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-17 21:49:00 +00:00
Packit
8c5320ed1a Update to 1.0.0 upstream release
Upstream tag: v1.0.0
Upstream commit: 4fed3a2e

Commit authored by Packit automation (https://packit.dev/)
2024-10-04 10:06:13 +00:00
Fedora Release Engineering
76fa7a23e5 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-18 20:58:56 +00:00
Python Maint
890abe5f4e Rebuilt for Python 3.13 2024-06-08 11:35:33 +02:00
Packit
d71a523f0d Update to 0.2.9 upstream release
Upstream tag: v0.2.9
Upstream commit: be59973d

Commit authored by Packit automation (https://packit.dev/)
2024-04-23 13:07:05 +00:00
Yaakov Selkowitz
39e924bdb7 Avoid coverage and tox dependencies
The Fedora Python packaging guidelines exclude coverage checks as used
in this package's tox.ini:

https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters

Furthermore, RHEL does not include tox, but even in Fedora it does not
add much value relative to its dependencies.  Calling %pytest directly
is simpler and more conformant.

https://github.com/OpenSCAP/openscap-report/pull/225
2024-01-29 16:34:41 -05:00
Packit
dbeff4dda3 [packit] 0.2.7 upstream release
Upstream tag: v0.2.7
Upstream commit: 60ac886e
2024-01-26 15:11:05 +00:00
Fedora Release Engineering
7dfb1aa0e6 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-25 11:28:21 +00:00
Fedora Release Engineering
338c76c1bc Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 11:20:13 +00:00
Packit
b011fd5356 [packit] 0.2.6 upstream release
Upstream tag: v0.2.6
Upstream commit: a75d1f73
2023-12-20 13:32:26 +00:00
Packit
0478061f62 [packit] 0.2.5 upstream release
Upstream tag: v0.2.5
Upstream commit: 961a0636

If you need to do any change in this pull request, you need to locally fetch the source branch of it and push it (with a fix) to your fork (as it is not possible to push to the branch created in the Packit’s fork):
```
git fetch https://src.fedoraproject.org/forks/packit/rpms/openscap-report.git refs/heads/*:refs/remotes/packit/*
git checkout packit/0.2.5-rawhide-update-propose_downstream
```
2023-09-11 08:50:00 +00:00
Fedora Release Engineering
f4a0b1cf97 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-20 18:10:38 +00:00
Python Maint
1b0b99ce3f Rebuilt for Python 3.12 2023-07-05 14:38:14 +02:00
Packit
ca54a67abc [packit] 0.2.4 upstream release
Upstream tag: v0.2.4
Upstream commit: 1145a687
2023-07-05 10:30:36 +00:00
Python Maint
3f9683e721 Rebuilt for Python 3.12 2023-06-15 12:51:44 +02:00
Jan Rodak
3f3367e781 Add script for generation of arf files for integration test 2023-04-14 13:59:44 +02:00
Packit
1cd0141169 [packit] 0.2.3 upstream release
Upstream tag: v0.2.3
Upstream commit: 98984c9b

Signed-off-by: Packit <hello@packit.dev>
2023-04-14 09:27:08 +00:00
Jan Rodak
d5da63f247 Remove test dir 2023-04-13 15:33:49 +02:00
11 changed files with 354 additions and 236480 deletions

7
.gitignore vendored
View file

@ -3,3 +3,10 @@
/openscap-report-0.2.0.tar.gz
/openscap-report-0.2.1.tar.gz
/openscap-report-0.2.2.tar.gz
/openscap-report-0.2.3.tar.gz
/openscap-report-0.2.4.tar.gz
/openscap-report-0.2.5.tar.gz
/openscap-report-0.2.6.tar.gz
/openscap-report-0.2.7.tar.gz
/openscap_report-0.2.9.tar.gz
/openscap_report-1.0.0.tar.gz

View file

@ -10,6 +10,8 @@ files_to_sync:
dest: plans/
- src: .fmf/
dest: .fmf/
- src: generate_arf.sh
dest: generate_arf.sh
# name in upstream package repository or registry (e.g. in PyPI)
upstream_package_name: openscap-report
@ -34,13 +36,21 @@ actions:
jobs:
- job: propose_downstream
trigger: release
identifier: release-rawhide
dist_git_branches:
- fedora-rawhide
- job: propose_downstream
trigger: release
identifier: release-epel8
specfile_path: spec/rhel8/openscap-report.spec
dist_git_branches:
- epel-8
- job: tests
trigger: pull_request
identifier: tests-all
tmt_plan: smoke
targets:
- fedora-all
- epel-9

View file

@ -1,3 +1,3 @@
This repository is maintained by packit.
https://packit.dev/
The file was generated using packit 0.69.0.post27+g1374cc1.
The file was generated using packit 0.101.1.post1.dev8+ge78e9e3b.

111
generate_arf.sh Executable file
View file

@ -0,0 +1,111 @@
#!/usr/bin/env bash
# This script generates ARF results.
# Supported OS:
# - Fedora
# - RHEL8/9
# - Centos8/9
# Requirements:
# - cmake
# - make
# - openscap-utils
# - openscap-scanner
# - python3-pyyaml
# - python3-jinja2
# - python3-setuptools
# - git
# - scap-security-guide
# Usage: ./generate_arf MODE FETCH PRODUCT ARF_FILE SKIP_BUILD
# MODE [latest, ssg] use scap-security-guide or latest content from github
# FETCH [yes, no] scanner fetch remote resources
# ARF_FILE Writes results to a given ARF_FILE.
# SKIP_BUILD [yes] Skip build of latest content(Have affect with mode latest).
set -e -o pipefail
build_content() {
product=$1
echo "Build - Start"
git clone https://github.com/ComplianceAsCode/content.git
cd content/
git checkout master
cd build/
cmake ../
make -j4 "${product}"
cd ../../
echo "Build - Done"
}
run_oscap_scan() {
ds=$1
fetch=$2
file=$3
echo "Scans - Start"
oscap xccdf eval ${fetch} --profile "(all)" --results-arf ${file} ${ds} || EXIT_CODE=$?
echo $EXIT_CODE
if [ ! -f "$file" ]; then
echo "$file does not exist." >&2
exit 2
fi
}
get_product() {
cpe_name=$(grep "CPE_NAME=" < /etc/os-release | sed 's/CPE_NAME=//g' | sed 's/["]//g')
if [[ "${cpe_name}" =~ fedora ]]; then
echo "fedora"
elif [[ "${cpe_name}" =~ redhat ]]; then
version=$(grep VERSION_ID /etc/os-release | grep -o "[0-9]\+" | head -n1)
echo "rhel${version}"
elif [[ "${cpe_name}" =~ centos.*8 ]]; then
echo "centos8"
elif [[ "${cpe_name}" =~ centos ]]; then
version=$(grep VERSION_ID /etc/os-release | grep -o "[0-9]\+")
echo "cs${version}"
else
echo $cpe_name
echo "ERROR: Not supported OS!" >&2
exit 1
fi
}
if [ "$1" = "" ]; then
echo "ERROR: Missing MODE parameter!" >&2
exit 1
fi
if [ "$2" = "" ]; then
echo "ERROR: Missing FETCH parameter!" >&2
exit 1
fi
if [ "$3" = "" ]; then
echo "ERROR: Missing ARF_FILE parameter!" >&2
exit 1
fi
file=$3
product=$(get_product)
fetch="--fetch-remote-resources"
if [ "$2" = "no" ]; then
fetch=""
fi
if [ "$1" = "latest" ]; then
if [ "$4" != "yes" ]; then
build_content "${product}"
fi
run_oscap_scan "./content/build/ssg-${product}-ds.xml" "${fetch}" "${file}"
fi
if [ "$1" = "ssg" ]; then
run_oscap_scan "/usr/share/xml/scap/ssg/content/ssg-${product}-ds.xml" "${fetch}" "${file}"
fi

View file

@ -1,26 +1,29 @@
%global pymodule_name openscap_report
Name: openscap-report
Version: 0.2.2
Release: 0%{?dist}
Version: 1.0.0
Release: 6%{?dist}
Summary: A tool for generating human-readable reports from (SCAP) XCCDF and ARF results
# The entire source code is LGPL-2.1+ and GPL-2.0+ and MIT except schemas/ and assets/, which are Public Domain
License: LGPLv2+ and GPLv2+ and MIT and Public Domain
URL: https://github.com/OpenSCAP/%{name}
Source0: https://github.com/OpenSCAP/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
Source0: https://github.com/OpenSCAP/%{name}/releases/download/v%{version}/%{pymodule_name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-pytest
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx_rtd_theme
Provides: bundled(patternfly) = 4
Requires: python3-lxml
Requires: redhat-display-fonts
Requires: redhat-text-fonts
Recommends: redhat-display-fonts
Recommends: redhat-text-fonts
Obsoletes: oval-graph
%global _description %{expand:
This package provides a command-line tool for generating
@ -30,11 +33,13 @@ human-readable reports from SCAP XCCDF and ARF results.}
%prep
%autosetup -p1 -n %{name}-%{version}
%autosetup -p1 -n %{pymodule_name}-%{version}
%generate_buildrequires
%pyproject_buildrequires -t
%pyproject_buildrequires
# test requirement listed only in tox.ini
echo "%{py3_dist jsonschema}"
%build
@ -50,7 +55,8 @@ install -m 0644 -Dt %{buildroot}%{_mandir}/man1 _build_docs/oscap-report.1
%check
%tox
# test_store_file fails with FileNotFoundError: [Errno 2] No such file or directory: '/tmp/oscap-report-tests_result.html'
%pytest -k "not test_store_file"
%files -f %{pyproject_files}
%{_mandir}/man1/oscap-report.*
@ -60,6 +66,186 @@ install -m 0644 -Dt %{buildroot}%{_mandir}/man1 _build_docs/oscap-report.1
%changelog
* Fri Sep 19 2025 Python Maint <python-maint@redhat.com> - 1.0.0-6
- Rebuilt for Python 3.14.0rc3 bytecode
* Fri Aug 15 2025 Python Maint <python-maint@redhat.com> - 1.0.0-5
- Rebuilt for Python 3.14.0rc2 bytecode
* Thu Jul 24 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Wed Jun 04 2025 Python Maint <python-maint@redhat.com> - 1.0.0-3
- Rebuilt for Python 3.14
* Fri Jan 17 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Fri Oct 04 2024 Packit <hello@packit.dev> - 1.0.0-1
- Update to version 1.0.0
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Sat Jun 08 2024 Python Maint <python-maint@redhat.com> - 0.2.9-2
- Rebuilt for Python 3.13
* Tue Apr 23 2024 Packit <hello@packit.dev> - 0.2.9-1
- Update to version 0.2.9
* Mon Jan 29 2024 Yaakov Selkowitz <yselkowi@redhat.com> - 0.2.7-2
- Avoid tox dependency
* Fri Jan 26 2024 Packit <hello@packit.dev> - 0.2.7-1
- 0.2.7 (Jan Rodak)
- Add tool tip to search bar (Jan Rodak)
- Enable search by reference (Jan Rodak)
- Add generation search infromation (Jan Rodak)
- Use macro for generation of list items (Jan Rodak)
- Create two-tier display of Evaluation Characteristics (Jan Rodak)
- Add title (Jan Rodak)
- Reduce complexity of function generate_referenced_endpoints (Jan Rodak)
- Use default dict (Jan Rodak)
- Fix JSON schema (Jan Rodak)
- Use correct orthography of addresses types acronyms (Jan Rodak)
- Add function to update known references (Jan Rodak)
- Change the presentation of referenced endpoints (Jan Rodak)
- Add new elements (Jan Rodak)
- Add onclick function (Jan Rodak)
- Add map of OVAL endpoints (Jan Rodak)
- Add target addresses to report (Jan Rodak)
- Add target addresses to model (Jan Rodak)
- Fix width of pre element (Jan Rodak)
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Dec 20 2023 Packit <hello@packit.dev> - 0.2.6-1
- 0.2.6 (Jan Rodak)
- Extend the condition to account empty strings in href (Jan Černý)
- Add comments for the pylint tool (Jan Černý)
- Add special classes to table element (Jan Černý)
- Account for missing reference href attribute (Jan Černý)
- Add pragmas to avoid PEP8 warnings (Jan Černý)
- Present references in a table (Jan Černý)
- Collapse CPE tree when is true (Jan Rodak)
- Fix typo (Jan Rodak)
- Add titles (Jan Rodak)
- Fix performace of generation of graphs (Jan Rodak)
- Rearrange fields of rule detail and OVAL definition detail (Jan Rodak)
- Fix bugs in html (Jan Rodak)
* Mon Sep 11 2023 Packit <hello@packit.dev> - 0.2.5-1
- 0.2.5 (Jan Rodak)
- Show referenced OVAL State (Jan Rodak)
- Parse reference in filter (Jan Rodak)
- Show OVAL Variables and referenced OVAL endpoints in report (Jan Rodak)
- Remove UUID from headings (Jan Rodak)
- Move function (Jan Rodak)
- Display in report OVAL object that references to other OVAL Objects (Jan Rodak)
- Resolve parsing of referenced OVAL Objects and OVAL Variables (Jan Rodak)
- Add OVAL Variable structure and parser (Jan Rodak)
- Rework OVAL Object and State (Jan Rodak)
- Parse mapping between OVAL var and values and propagate them (Jan Rodak)
- Remove namesapace for attributes (Jan Rodak)
- Show OVAL states in report (Jan Rodak)
- Parse attributes of elements in OVAL state and Parse all OVAL states in OVAL test (Jan Rodak)
- Show OVAL objects in report (Jan Rodak)
- Parse attributes of elements in OVAL object (Jan Rodak)
- Removing the processing of collected objects (Jan Rodak)
- Use an empty string instead of None when the text of the set-value element is empty (Jan Rodak)
- Fix deprecation warning (Jan Rodak)
- Remove product detection from the tmt plan (Jan Rodak)
- Increase vm memory (Jan Rodak)
- Add python3 dependency (Jan Rodak)
- Adjust the build of content (Jan Rodak)
- Automatic product detection to build content by CPE identifier (Jan Rodak)
- Remove whitespaces (Jan Rodak)
- Show explanation of score computation in report (Jan Rodak)
- Add explanation of score computation (Jan Rodak)
- Parse system attribute from score element (Jan Rodak)
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jul 05 2023 Python Maint <python-maint@redhat.com> - 0.2.4-2
- Rebuilt for Python 3.12
* Wed Jul 05 2023 Packit <hello@packit.dev> - 0.2.4-1
- 0.2.4 (Jan Rodak)
- Rename field Result explained to Class explained (Jan Rodak)
- Add button back to top (Jan Rodak)
- Generate tooltip when hover the mouse over the OVAL operator (Jan Rodak)
- Fix persistance of checkboxes after refresh browser (Jan Rodak)
- Add functionality to buttons (Jan Rodak)
- Add buttons (Jan Rodak)
- Set logging severity from warning to info for missing fonts problem (Jan Rodak)
- Change fonts to week dependency (Jan Rodak)
- Disable scrollbar (Jan Rodak)
- Show tooltip for NOT (Jan Rodak)
- Add explanations (Jan Rodak)
- Generate tooltip (Jan Rodak)
- Set tooltip position for OVAL and CPE AL operators (Jan Rodak)
- Add new tooltip when user click on copy to clipboard (Jan Rodak)
- Rename tooltip class (Jan Rodak)
- Add new lines on end of file (Jan Rodak)
- Update eslint config (Jan Rodak)
- Implement clear button for search bar (Jan Rodak)
- Change title (Jan Rodak)
- Use the same title for the page title and report title (Jan Rodak)
- Using span element instead of link element when href is not available (Jan Rodak)
- Add non-breaking space (Jan Rodak)
- Add missing package (Jan Rodak)
- Update modules docs (Jan Rodak)
- Add documentation on how to run the test suite (Jan Rodak)
- Add usage from source (Jan Rodak)
- Add installation from source and PyPi (Jan Rodak)
- Update README (Jan Rodak)
- Sync generate_arf.sh (Jan Rodak)
- Remove execution of integration test on push to main (Jan Rodak)
* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 0.2.3-2
- Rebuilt for Python 3.12
* Fri Apr 14 2023 Packit <hello@packit.dev> - 0.2.3-1
- 0.2.3 (Jan Rodak)
- Determine which product use (Jan Rodak)
- Discover upstream (Jan Rodak)
- Run only smoke test in Testing Farm (Jan Rodak)
- Add weekly execution of integration test (Jan Rodak)
- Add tmt tests (Jan Rodak)
- Add tmt plan (Jan Rodak)
- Modify the smoke test to use different ARF reports (Jan Rodak)
- Add script for generation of ARF report (Jan Rodak)
- Add filter for rule id (Jan Rodak)
- Select new multi-check rules (Jan Rodak)
- Create copy of multi-check rule for every OVAL definition (Jan Rodak)
- Make method _get_applicable_cpe_ids_for_machine part of ProfileInfo and rename the method to get_list_of_cpe_platforms_that_satisfy_evaluation_target (Jan Rodak)
- Adapt input of oval_cpe_definiton in test (Jan Rodak)
- Adapt the mapping of OVAL definitions to the new OVAL definition analysis system and specify which OVAL result report is for CPE (Jan Rodak)
- Parse all OVAL definition from all OVAL result reports (Jan Rodak)
- Add parsing of OVAL refence to OVAL report (Jan Rodak)
- Load all oval reports present in ARF report (Jan Rodak)
- Fix typo in link (Jan Rodak)
- Sync tests with downstream (Jan Rodak)
- Add required parameter (Jan Rodak)
- Move unit tests from interation_tests direcory (Jan Rodak)
- Move function get_fake_args to test utils (Jan Rodak)
- Create separate job propose_downstream for EPEL8 (Jan Rodak)
- Sort chapters (Jan Rodak)
- Add manual about report content (Jan Rodak)
- Add assets (Jan Rodak)
- Fix typo (Jan Rodak)
- Add license tag (Jan Rodak)
- Add explanation of result of OVAL definition (Jan Rodak)
- Parse class of OVAL definition (Jan Rodak)
- Add tests for CPE AL (Jan Rodak)
- Fix negation of logical test (Jan Rodak)
- Add support for check-fact-ref element in CPE-AL (Jan Rodak)
* Tue Mar 28 2023 Packit <hello@packit.dev> - 0.2.2-0
- 0.2.2 (Jan Rodak)
- Clean up CI jobs titles (Evgeny Kolesnikov)

29
plans/integration.fmf Normal file
View file

@ -0,0 +1,29 @@
summary: Test integration with latest versions of content
discover+:
filter: tag:integration
provision:
memory: 4096
prepare:
- name: Install packages require for generation ARF files
how: install
package:
- cmake
- make
- openscap-utils
- openscap-scanner
- python3
- python3-pyyaml
- python3-jinja2
- python3-setuptools
- git
- scap-security-guide
- name: Generate ARF files
how: shell
script:
- ./generate_arf.sh ssg no ${TMT_PLAN_DATA}/arf.xml
- ./generate_arf.sh ssg yes ${TMT_PLAN_DATA}/arf_fetch-remote-resources.xml
- ./generate_arf.sh latest no ${TMT_PLAN_DATA}/arf-latest.xml
- ./generate_arf.sh latest yes ${TMT_PLAN_DATA}/arf_fetch-remote-resources-latest.xml yes
execute:
how: tmt

View file

@ -2,3 +2,4 @@ execute:
how: tmt
discover:
how: fmf
url: https://github.com/OpenSCAP/openscap-report.git

View file

@ -1 +1 @@
SHA512 (openscap-report-0.2.2.tar.gz) = 312f3a604a19b2d5f46413e247ad98727a8a8e9f530bef6ece0ebdf943f535a2f97bb91fa60dd33420b5ff6c5317103bf453d014833c04e3fdf443740f047288
SHA512 (openscap_report-1.0.0.tar.gz) = 6ca5a24798961cfc50112e9da9157f582732574fef4592a7fe5c8a98b4ed4b9aa3f7221427bd5e95a799a82468a22a2eddfb2262c6fc22cd2e4262540913db03

View file

@ -1,7 +0,0 @@
require:
- openscap-report
summary: Basic smoke test
test: ./smoke.sh
tag:
- smoke
tier: 0

View file

@ -1,14 +0,0 @@
#!/usr/bin/env bash
# Test of the basic function
set -e -o pipefail
# Generate report
oscap-report < ./test_data/arf-report.xml > report.html
# Search for some rule ID in the report
grep -q "xccdf_org\.ssgproject\.content_rule_enable_fips_mode" report.html
rm report.html
echo "Report generation success"

File diff suppressed because one or more lines are too long