Stats Reporting Incorrect #241

Closed
opened 2026-01-19 18:29:46 +00:00 by michael · 1 comment
Owner

Originally created by @mzaske3 on GitHub.

Summary

Generate_Stats and Generate_Report functions are reporting compliant/non-compliant counts incorrectly.

Steps to reproduce

  1. Initiate a compliance scan (-check)
  2. Initiate a stats report (-stats)
  3. See the stats report is showing improper data: see current bug behavior

Operating System version

macOS Big Sur (11.1)

What is the current bug behavior?

Output of stats displays: Passed: {non-compliant count} Failed: {NULL}, {NULL} percent compliant!
The values of {NULL} are not actually present, it just shows blank.

What is the expected correct behavior?

Output of stats displays: Passed: {compliant count} Failed: {non-compliant count} , {percentage_compliant} percent compliant!

Relevant logs and/or screenshots

N/A

Output of checks

N/A

Possible fixes

Lines 719-720, 723

Lines 744-745, 748

  • Lines 719 and 744: change count[1] to count[0]
  • Lines 720 and 745: change count[2] to count[1]
  • Lines 723 and 748: remove the . after 100
Originally created by @mzaske3 on GitHub. <!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "bug" label and verify the issue you're about to submit isn't a duplicate. ---> ### Summary Generate_Stats and Generate_Report functions are reporting compliant/non-compliant counts incorrectly. ### Steps to reproduce 1. Initiate a compliance scan (-check) 2. Initiate a stats report (-stats) 3. See the stats report is showing improper data: see [current bug behavior](#what-is-the-current-bug-behavior) ### Operating System version macOS Big Sur (11.1) ### What is the current *bug* behavior? Output of stats displays: Passed: {non-compliant count} Failed: {NULL}, {NULL} percent compliant! The values of {NULL} are not actually present, it just shows blank. ### What is the expected *correct* behavior? Output of stats displays: Passed: {compliant count} Failed: {non-compliant count} , {percentage_compliant} percent compliant! ### Relevant logs and/or screenshots N/A ### Output of checks N/A ### Possible fixes [Lines 719-720, 723](https://github.com/usnistgov/macos_security/blob/06cc0d2614da5b6f478b6f1ff45b059bb7c6aa5a/scripts/generate_guidance.py#L719-L723) [Lines 744-745, 748](https://github.com/usnistgov/macos_security/blob/06cc0d2614da5b6f478b6f1ff45b059bb7c6aa5a/scripts/generate_guidance.py#L744-L748) - Lines 719 and 744: change count[1] to count[0] - Lines 720 and 745: change count[2] to count[1] - Lines 723 and 748: remove the . after 100
Author
Owner

@mzaske3 commented on GitHub:

Please disregard - I was testing using the wrong shell (bash instead of Zsh).

@mzaske3 commented on GitHub: Please disregard - I was testing using the wrong shell (bash instead of Zsh).
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: usnistgov/macos_security#241