cisagov / ScubaGoggles

SCuBA Secure Configuration Baselines and assessment tool for Google Workspace
https://www.cisa.gov/resources-tools/services/secure-cloud-business-applications-scuba-project
Creative Commons Zero v1.0 Universal
149 stars 20 forks source link

Orchestrator: convert to class implementation (issue 167) #333

Closed rlxdev closed 1 month ago

rlxdev commented 2 months ago

๐Ÿ—ฃ Description

I converted the orchestrator module to a class. My aim when refactoring this module was to minimize the changes to the original code, while converting the individual functions to methods of the Orchestrator class. I kept the use of args from the parsed command line arguments, rather than try to separate out the nearly 20 arguments into instance variables. This helps to keep the structure of the code the same.

If you compare this class implementation with the non-class module, while ignoring whitespace and empty lines, there are only 37 differences.

๐Ÿ’ญ Motivation and context

closes #167

๐Ÿงช Testing

I've tested these changes by running several different variations of ScubaGoggles runs. With minimal changes made to the code, I've got a high confidence that the class works correctly, as it did when the orchestrator was implemented as separate functions in the module.

โœ… Pre-approval checklist

โœ… Pre-merge Checklist

โœ… Post-merge Checklist

LaurenBassett commented 2 months ago

This looks good to me, but I'm having some import errors. I think it's my machine though. I'll keep troubleshooting. Just wanted to comment to say I've started reviewing.

LaurenBassett commented 2 months ago

For documentation's sake, I'm getting one of two errors depending on if I run the code in the virtual environment or locally.

In the virtual environment: ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Which tells me it doesn't like the version of numpy I'm using

Update: I was able to fix this by downgrading the version of numpy used.

pip install numpy==1.26.4


Locally: ImportError: cannot import name 'Enum' from partially initialized module 'enum' (most likely due to a circular import) (/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/enum.py)

Which tells me there's some circular import with the Enum package I think.

I think the issue is with my python installation, but want to capture this in case anyone else runs into it.