Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traceback when generating report from Automatus #149

Closed
jan-cerny opened this issue Mar 29, 2023 · 1 comment · Fixed by #150
Closed

Traceback when generating report from Automatus #149

jan-cerny opened this issue Mar 29, 2023 · 1 comment · Fixed by #150
Assignees
Labels
bug Something isn't working

Comments

@jan-cerny
Copy link
Member

Describe the bug

Traceback (most recent call last):
  File "/usr/bin/oscap-report", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/openscap_report/cli.py", line 205, in main
    report = api.generate_report(parser)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/openscap_report/cli.py", line 173, in generate_report
    report_generator = self.get_report_generator(report_parser)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/openscap_report/cli.py", line 169, in get_report_generator
    return dict_of_report_generators[self.output_format](report_parser)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/openscap_report/report_generators/html.py", line 24, in __init__
    self.report = parser.parse_report()
                  ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/openscap_report/scap_results_parser/scap_results_parser.py", line 92, in parse_report
    OVAL_and_CPE_tree_builder = OVALAndCPETreeBuilder(  # pylint: disable=C0103
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/openscap_report/scap_results_parser/oval_and_cpe_tree_builder.py", line 22, in __init__
    self.load_oval_definitions()
  File "/usr/lib/python3.11/site-packages/openscap_report/scap_results_parser/oval_and_cpe_tree_builder.py", line 33, in load_oval_definitions
    self._load_cpe_platforms()
  File "/usr/lib/python3.11/site-packages/openscap_report/scap_results_parser/oval_and_cpe_tree_builder.py", line 61, in _load_cpe_platforms
    self._evaluate_all_cpe_platforms()
  File "/usr/lib/python3.11/site-packages/openscap_report/scap_results_parser/oval_and_cpe_tree_builder.py", line 67, in _evaluate_all_cpe_platforms
    cpe_platform.result = cpe_platform.logical_test.evaluate_tree()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/openscap_report/scap_results_parser/data_structures/cpe_logical_test.py", line 55, in evaluate_tree
    results_counts = self._get_result_counts()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/openscap_report/scap_results_parser/data_structures/cpe_logical_test.py", line 34, in _get_result_counts
    value = str(child.oval_tree.evaluate_tree())
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'evaluate_tree'

To Reproduce
tar xzf arf.tar.gz
oscap-report -o report.html selinux_all_devicefiles_labeled-regular_file_device_t.pass.sh-initial-arf.xml

ARF file
arf.tar.gz

Expected behavior
no traceback

Screenshots
no

Environment (please complete the following information):
Fedora 37
openscap-report-0.2.2-0.fc37.noarch - from updates-testing

Additional context
The ARF comes from automatus testing executed locally.

The command that Automatus used internally is:

oscap-ssh root@192.168.122.241 22 xccdf eval --verbose DEVEL --results-arf /home/jcerny/work/git/scap-security-guide/logs/rule-custom-2023-03-29-1047/selinux_all_devicefiles_labeled-regular_file_device_t.pass.sh-initial-arf.xml --benchmark-id xccdf_org.ssgproject.content_benchmark_RHEL-9 --profile (all) --progress --oval-results --report /home/jcerny/work/git/scap-security-guide/logs/rule-custom-2023-03-29-1047/selinux_all_devicefiles_labeled-regular_file_device_t.pass.sh-initial.html --rule xccdf_org.ssgproject.content_rule_selinux_all_devicefiles_labeled /tmp/_ssgts_ds_modified6gk8e2qs

@jan-cerny jan-cerny added the bug Something isn't working label Mar 29, 2023
@Honny1 Honny1 self-assigned this Mar 29, 2023
@Honny1
Copy link
Member

Honny1 commented Mar 29, 2023

This problem is caused by a change in CPE-AL. This change has not yet been published. The fact-ref element that refers to the CPE dictionary has been changed to a check-fact-ref element. The check-fact-ref element refers directly to the OVAL definition. This issue is resolved in PR #150.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants