Compliance Reporter をアンインストール

コンピュータから Compliance Reporter をアンインストールするには、以下のいずれかを実行します。

  • Jamf によって提供されたアンインストーラパッケージをインストールします。Jamf Protect サブスクリプションをご利用中の場合、Administrative (管理) > Downloads (ダウンロード) に移動し、Jamf Protect web app からアンインストーラをダウンロードできます。Jamf Protect を使用していない場合、アンインストーラパッケージは Compliance Reporter 専用のテナント URL から入手できます。

  • 以下のスクリプトを実行して Compliance Reporter をアンインストールし、/etc/security/audit_control ファイルを元の状態に戻します。

    #!/bin/bash
    
    GUI_USER=$(who | grep console | grep -v '_mbsetupuser' | awk '{print $1}')
    GUI_UID=$(id -u "$GUI_USER")
    
    # LaunchDaemon
    /bin/launchctl bootout "system/com.jamf.compliancereporter.daemon"
    /bin/rm "/Library/LaunchDaemons/com.jamf.compliancereporter.daemon.plist"
    
    /bin/launchctl bootout "gui/$GUI_UID" "/Library/LaunchAgents/com.jamf.compliancereporter.agent.plist"
    /bin/rm "/Library/LaunchAgents/com.jamf.compliancereporter.agent.plist"
    
    # Double check proc killed
    /usr/bin/killall JamfComplianceReporter
    /usr/bin/killall JamfComplianceReporterAgent
    
    # Binary
    /bin/rm /usr/local/bin/JamfComplianceReporter
    /bin/rm /usr/local/bin/JamfComplianceReporterAgent
    /bin/rm -r /Applications/JamfComplianceReporter.app
    
    # Logs
    /bin/rm -f /var/log/JamfComplianceReporter.*
    
    # Unlock audit control files
    chflags nouchg /etc/security/audit_class
    chflags nouchg /etc/security/audit_control
    chflags nouchg /etc/security/audit_event
    chflags nouchg /etc/security/audit_user
    chflags nouchg /etc/security/audit_warn
    
    # Restore audit_control file
    if [[ -e /etc/security/audit_control.backup ]]; then
        if [[ -e /etc/security/audit_control.backup ]]; then
            #statements
            # Change audit control file back to values before JamfComplianceReporter install
            /bin/rm /etc/security/audit_control
            /bin/cp /etc/security/audit_control.backup /etc/security/audit_control
            /bin/rm -f /etc/security/audit_control.backup
        fi
        # Reload the audit config
        /usr/sbin/audit -s
    fi