def main(): result = {} # 10.13.4 is when the profiles command gained the ability to # report on UAMDM status. if os_version() < LooseVersion('10.13.4'): result['uamdm'] = 'N/A' result['status'] = get_enrollment_from_mdm_profile() else: status = profiles_status() result['uamdm'] = 'Yes' if 'User Approved' in status.get( 'MDM enrollment', '') else 'No' if status.get('Enrolled via DEP') == 'Yes': result['status'] = 'DEP' else: result['status'] = 'Manually Enrolled' if 'Yes' in status.get( 'MDM enrollment', '') else 'No' result['dep_status'] = get_dep_activation() # From 10.13.2, 10.13.3: # cmd = ['profiles', 'status', '-type', 'enrollment'] # An enrollment profile is currently installed on this system # There is no enrollment profile installed on this system utils.add_plugin_results('machine_detail_mdm_enrollment', result)
def main(): # Skip a manual check if len(sys.argv) > 1: if sys.argv[1] == 'manualcheck': # Manual check: skipping MunkiInfo Plugin exit(0) data = {pref: str(munkicommon.pref(pref)) for pref in PREFS_TO_GET} utils.add_plugin_results('MunkiInfo', data)
def main(): plist_path = ( '/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist' ) if os.path.exists(plist_path): plist = FoundationPlist.readPlist(plist_path) version = str(plist['Version']) else: version = 'Not supported' utils.add_plugin_results('XprotectVersion', {'Version': version})
def main(): if os.path.exists(salt_highstate_log): with open(salt_highstate_log) as raw_log: # The salt events won't parse as a whole. So just slice out # the good stuff. events = json.loads(raw_log.readlines()[-1]) try: result = {i['__id__']: i['result'] for i in events['return'].values()} except: result = {} utils.add_plugin_results('SaltMachineDetail', result)
def main(): client_manifest_path = munkilib.updatecheck.manifestutils.get_primary_manifest( ) if os.path.exists(client_manifest_path): client_manifest = plistlib.readPlist(client_manifest_path) else: client_manifest = {} # Drop any blank entries and trim WS. catalogs = [c.strip() for c in client_manifest.get("catalogs", []) if c] if not catalogs: catalogs = ["NO CATALOGS"] utils.add_plugin_results('Catalogs', {"Catalogs": "+".join(catalogs)})
def main(): ard_path = "/Library/Preferences/com.apple.RemoteDesktop.plist" if os.path.exists(ard_path): ard_prefs = FoundationPlist.readPlist(ard_path) else: ard_prefs = {} sal_result_key = "ARD_Info_{}" prefs_key_prefix = "Text{}" data = { sal_result_key.format(i): ard_prefs.get(prefs_key_prefix.format(i), "") for i in range(1, 5)} utils.add_plugin_results('ARD_Info', data)
def main(): client_manifest_path = munkilib.updatecheck.manifestutils.get_primary_manifest( ) if os.path.exists(client_manifest_path): client_manifest = plistlib.readPlist(client_manifest_path) else: client_manifest = {} # Drop any blank entries and trim WS. manifests = [ m.strip() for m in client_manifest.get("included_manifests", []) if m ] if not manifests: manifests = ["NO INCLUDED MANIFESTS"] utils.add_plugin_results('Manifests', {"included_manifests": "+".join(manifests)})
def main(): status = filevault_status() utils.add_plugin_results('Encryption', {'FileVault': status})
def main(): utils.add_plugin_results('Sip', {'SIP': sip_status()})
def main(): utils.add_plugin_results('Gatekeeper', {'Gatekeeper': gatekeeper_status()})
def main(): filevault = fv_status() sip = sip_status() gatekeeper = gatekeeper_status() data = {'Filevault': filevault, 'SIP': sip, 'Gatekeeper': gatekeeper} utils.add_plugin_results('MachineDetailSecurity', data)