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

    sal.add_plugin_results('machine_detail_mdm_enrollment', result)
Ejemplo n.º 2
0
Archivo: uptime.py Proyecto: jpbw/sal
def main():
    uptime_seconds = get_uptime()
    data = {
        'UptimeDays': uptime_seconds / 60 / 60 / 24,
        'UptimeSeconds': uptime_seconds
    }
    sal.add_plugin_results('Uptime', data)
Ejemplo n.º 3
0
def main():
    from os import path
    if path.exists(EXCMDTOOL):
        extensions = get_extensions()
    else:
        extensions = {}
    sal.add_plugin_results('AdobePlugins', extensions)
Ejemplo n.º 4
0
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}
    sal.add_plugin_results('MunkiInfo', data)
Ejemplo n.º 5
0
def main():
    plist_path = pathlib.Path(
        '/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist'
    )
    if plist_path.exists():
        plist = plistlib.loads(plist_path.read_bytes())
        version = str(plist['Version'])
    else:
        version = 'Not supported'

    sal.add_plugin_results('XprotectVersion', {'Version': version})
Ejemplo n.º 6
0
Archivo: ard_info.py Proyecto: jpbw/sal
def main():
    bundle_id = "com.apple.RemoteDesktop.plist"

    sal_key = "ARD_Info_{}"
    prefs_key_prefix = "Text{}"

    data = {
        sal_key.format(i): CFPreferencesCopyAppValue(prefs_key_prefix.format(i), bundle_id) or ""
        for i in range(1, 5)}

    sal.add_plugin_results('ARD_Info', data)
Ejemplo n.º 7
0
def main():
    client_manifest_path = munkilib.updatecheck.manifestutils.get_primary_manifest()
    if client_manifest_path.exists():
        client_manifest = plistlib.loads(client_manifest_path.read_bytes())
    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"]
    sal.add_plugin_results('Manifests', {"included_manifests": "+".join(manifests)})
def main():
    dep_assigned = False

    cmd = ['/usr/bin/profiles', '-e']
    try:
        output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, text=True)
    except subprocess.CalledProcessError as error:
        output = str(error.output)
    if len(output[output.find('{') + 1: output.find('}')].strip()) > 0:
        dep_assigned = True

    result = {'dep_status': '{}Assigned'.format('' if dep_assigned else 'Not ')}

    sal.add_plugin_results('dep_assignment', result)
Ejemplo n.º 9
0
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['mdm_status'] = get_enrollment_from_mdm_profile()

    else:
        status = profiles_status()
        if status.get('Enrolled via DEP') == 'Yes':
            result['mdm_status'] = 'DEP'
        else:
            result['mdm_status'] = 'Manually Enrolled' if 'Yes' in status.get(
                'MDM enrollment', '') else 'No'

    sal.add_plugin_results('mdm_enrollment', result)
Ejemplo n.º 10
0
Archivo: sip.py Proyecto: jpbw/sal
def main():
    sal.add_plugin_results('Sip', {'SIP': sip_status()})
Ejemplo n.º 11
0
def main():
    status = filevault_status()
    sal.add_plugin_results('Encryption', {'FileVault': status})
Ejemplo n.º 12
0
def main():
    filevault = fv_status()
    sip = sip_status()
    gatekeeper = gatekeeper_status()
    data = {'Filevault': filevault, 'SIP': sip, 'Gatekeeper': gatekeeper}
    sal.add_plugin_results('MachineDetailSecurity', data)
Ejemplo n.º 13
0
def main():
    data = battery_facts()
    sal.add_plugin_results('Battery', data)
Ejemplo n.º 14
0
def main():
    sal.add_plugin_results('Gatekeeper', {'Gatekeeper': gatekeeper_status()})