본문 바로가기
#컴퓨터 과학 [Computer Science]/운영체제 (Operating System)

[OS - 🍎 macOS] 전체 디스크 접근 권한 (Full Disk Access)

by cy_mos 2020. 2. 3.
반응형
카테고리 게시글 작성 날짜 게시글 최근 수정 날짜 작성자
iOS 2020-02-03 09:53 2022.03.06. 21:57 Dev.Yang

 

🗂 전체 디스크 접근 권한 (Full Disk Access)

OSX 10.15 Mojave / OSX 10.16 Catalina 전체 디스크 접근 권한 (Full Disk Access)

 

Full Disk Access is a new security feature in macOS Mojave that requires some applications to be given full permission to access a user's protected files. This way, only applications that are approved can gain access. In previous versions of macOS, this permission was automatically given to all applications at the time of installation. If a user chooses not to give Full Disk Access, some data on the Mac will not be accessible. This is especially important for applications that need to perform specifics tasks such as scanning for malware (VirusBarrier) or data backup (Personal Backup).

 

전체 디스크 접근 권한은 macOS Mojave 버전에서부터 나온 새로운 보안 기능입니다. 사용자의 파일들을 보호하기 위해서 애플리케이션이 임의로 사용자의 동의 없이 사용자의 파일에 대한 접근을 제한하고 있습니다. 사용자 파일에 접근하기 위해서는 반드시 전체 디스크 접근 권한을 통해서 접근 권한을 얻어야 합니다. macOS Mojave 이전 버전에서는 모든 애플리케이션은 설치 시 자동적으로 사용자 파일에 대한 권한이 주어졌습니다. 특히 이러한 전체 디스크 접근 권한은 macOS 시스템에서 사용자 파일을 수집하는 프로그램 또는 Malware 탐지 기능을 수행하는 Anti Virus 프로그램에게 필수적인 기능입니다.


🗂 전체 디스크 접근 권한 (Full Disk Access) 설정 방법

Enabling Full Disk Access in macOS Mojave (10.14) and higher

 

  1. 시스템 환경설정을 실행합니다.
  2. 보안 및 개인 정보 보호를 실행합니다.
  3. 상단 메뉴에서 개인 정보 보호 탭을 누른 후 왼쪽 메뉴 목록에서 전체 디스크 접근 권한을 선택합니다.
  4. 자물쇠 버튼을 눌러 잠금해제+ 버튼을 통하여 전체 디스크 접근 권한이 필요한 애플리케이션 (Application)을 선택합니다.
  5. 다시 자물쇠 버튼을 눌러 잠금을 한 뒤 전체 디스크 접근 권한을 추가한 애플리케이션 (Application) 다시 실행합니다.

🗂 전체 디스크 접근 권한 (Full Disk Access)이 필요한 경로 목록

번호 전체 디스크 접근 권한이 필요한 경로 운영체제
001 /Users/<user-name>/Library/Application Support/com.apple.sharedfilelist [OSX 10.14]
[OSX 10.15]
002 /Users/<user-name>/Library/Safari [OSX 10.14]
[OSX 10.15]
003 /Users/<user-name>/Library/Application Support/com.apple.TCC [OSX 10.14]
[OSX 10.15]
004 /Users/<user-name>/.trash [OSX 10.15]
005 /Users/<user-name>/Library/Mail [OSX 10.14]
[OSX 10.15]
006 /Users/<user-name>/Library/Sharing [OSX 10.15]
007 /Users/<user-name>/Library/Suggestions [OSX 10.14]
[OSX 10.15]
008 /Users/<user-name>/Library/Messages [OSX 10.14]
[OSX 10.15]
009 /Users/<user-name>/Library/Application Support/CallHistoryDB [OSX 10.14]
[OSX 10.15]
010 /Users/<user-name>/Library/Application Support/CallHistoryTransactions [OSX 10.14]
[OSX 10.15]
011 /Users/<user-name>/Library/Application Support/FileProvider [OSX 10.15]

🔑 전체 디스크 접근 권한 (Full Disk Access) 시스템 정보

항목명
전체 디스크 접근 권한 설정 파일 ~/Library/Application Support/com.apple.TCC/TCC.db
TCC.db Service Name kTCCServiceSystemPolicyAllFiles
시스템 환경설정 링크  x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles

📔 Check Full Disk Access Source Code With Swift

[macOS] CheckFullDiskAccess.swift
0.00MB

/*
 * Copyright (c) 2019 양창엽. All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

/**
        macOS System에서 전체 디스크 접근 권한 (Full Disk Access)이 설정되어 있는지 확인하는 함수입니다.
     
        - Returns: Bool
*/
func checkFullDiskAccess() -> Bool {

        let user = "HERE YOUR USER NAME"

        // MARK: Library/Application Support/com.apple.TCC/TCC.db 파일을 기준으로 권한 확인을 수행합니다.
        if let homePath = NSHomeDirectoryForUser(user) {
            let path = URL(fileURLWithPath: homePath, isDirectory: true)
                        .appendingPathComponent("Library/Application Support/com.apple.TCC", isDirectory: true)
                        .appendingPathComponent("TCC.db", isDirectory: false)

            // MARK: FileManager를 통하여 TCC.db을 읽어들이지 못한 경우를 비교하여 전체 디스크 접근 권한 (Full Disk Access)을 확인합니다.
            if FileManager.default.contents(atPath: path.path) == nil {
                return false
            }
        }

        return true
}

 


🚀 REFERENCE

더보기
반응형

댓글