profile_generator.py - All baselines use the same 'mobileconfigs' directory #329

Closed
opened 2026-01-19 18:30:05 +00:00 by michael · 5 comments
Owner

Originally created by @peterlewis on GitHub.

Summary

When running profile_generator.py, no matter which baseline you are targeting, the outputted .mobileconfig files are put into a folder named mobileconfigs. This means that, when running the script against multiple baselines, the .mobileconfig files are combined into a single directory.

When running

Steps to reproduce

  1. Run python3 profile_generator.py ../baselines/high.yaml
  2. Run python3 profile_generator.py ../baselines/low.yaml

Operating System version

10.15.5 (19F101)

What is the current bug behavior?

The mobileconfigs directory contains .mobileconfig files from both of steps 1 and 2

What is the expected correct behavior?

In line with the behaviour of the other scripts, I believe that output directory should contain the name of the targeted baseline, e.g.:

  • high_mobileconfigs
  • moderate_mobileconfigs
  • low_mobileconfigs

Possible fixes

I think that something along the lines of the following, should fix:

# Output folder
mobileconfig_output_path = os.path.join(parent_dir, 'build', ''+profile_name+'_mobileconfigs')

I would open a PR myself, but not hugely Python-y and so wouldn't wish to define/duplicate profile_name in the wrong place/way.

Many thanks!

Peter

Originally created by @peterlewis 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 When running `profile_generator.py`, no matter which baseline you are targeting, the outputted `.mobileconfig` files are put into a folder named `mobileconfigs`. This means that, when running the script against multiple baselines, the `.mobileconfig` files are combined into a single directory. When running ### Steps to reproduce 1. Run `python3 profile_generator.py ../baselines/high.yaml` 2. Run `python3 profile_generator.py ../baselines/low.yaml` ### Operating System version 10.15.5 (19F101) ### What is the current *bug* behavior? The `mobileconfigs` directory contains `.mobileconfig` files from both of steps 1 and 2 ### What is the expected *correct* behavior? In line with the behaviour of the other scripts, I believe that output directory should contain the name of the targeted baseline, e.g.: - high_mobileconfigs - moderate_mobileconfigs - low_mobileconfigs ### Possible fixes I think that something along the lines of the following, should fix: ``` # Output folder mobileconfig_output_path = os.path.join(parent_dir, 'build', ''+profile_name+'_mobileconfigs') ``` I would open a PR myself, but not hugely Python-y and so wouldn't wish to define/duplicate `profile_name` in the wrong place/way. Many thanks! Peter
Author
Owner

@golbiga commented on GitHub:

The fix is in master, please test. Closing issue.

@golbiga commented on GitHub: The fix is in master, please test. Closing issue.
Author
Owner

@golbiga commented on GitHub:

This has been fixed in the 0.9_prerelease branch, it will be included in the release.

Thanks for reporting it.

@golbiga commented on GitHub: This has been fixed in the 0.9_prerelease branch, it will be included in the release. Thanks for reporting it.
Author
Owner

@peterlewis commented on GitHub:

Sounds/looks good, to me! So long as I'm not unintentionally overwriting .mobileconfig sets, then I'm happy! :)

@peterlewis commented on GitHub: Sounds/looks good, to me! So long as I'm not unintentionally overwriting .mobileconfig sets, then I'm happy! :)
Author
Owner

@golbiga commented on GitHub:

@peterlewis, one thing to note. The output will still be in the mobileconfigs folder. There will just be an additional folder within, based on the selected baseline.

Screen Shot 2020-06-15 at 9 52 10 AM
@golbiga commented on GitHub: @peterlewis, one thing to note. The output will still be in the mobileconfigs folder. There will just be an additional folder within, based on the selected baseline. <img width="485" alt="Screen Shot 2020-06-15 at 9 52 10 AM" src="https://user-images.githubusercontent.com/786537/84765535-5d675200-af9d-11ea-8ac0-ea5f470a7b1c.png">
Author
Owner

@peterlewis commented on GitHub:

That's great. Thanks, @golbiga, for sorting that out so quickly!

@peterlewis commented on GitHub: That's great. Thanks, @golbiga, for sorting that out so quickly!
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#329