이전 글에서 Terraform으로 Jamf 구성 관리: 소개에서 코드형 인프라의 기본과 Terraform을 사용한 Jamf Pro 시작 방법을 다루었습니다. 아직 읽지 않았다면 Terraform의 기본 사항, 설치, 프로젝트 구조 및 상태 관리를 다루므로 거기서 시작하는 것을 권장합니다.
이번에는 Jamf Protect에 중점을 둡니다. Jamf Protect 제품 구성을 코드로 관리할 수 있게 해주는 전용 Terraform 공급자를 구축했습니다 - 계획, 작업 구성, 예외 집합 등.
Jamf Protect용 전용 공급자는 왜?
Jamf Pro와 마찬가지로 Jamf Protect는 그 자체로 제품이며 Jamf Platform 제품군의 일부입니다. Jamf Pro 및 기타 Jamf Platform 마이크로서비스(예: 청사진 및 규정 준수 벤치마크)와 구별되는 자체 API 표면(GraphQL 기반) 및 리소스 세트가 있습니다. 엔드포인트 보안 계획, 원격 분석 구성 및 이동식 저장소 정책과 같은 것들은 모두 Jamf Protect에 있고 올바르게 관리하기 위해 자체 공급자가 필요합니다.
콘솔을 통해 Jamf Protect 구성을 관리하는 경우 테넌트 간 설정을 다시 만들거나 변경 사항을 롤백하는 것을 이미 알 것입니다. 이 공급자를 사용하면 전체 Jamf Protect 구성이 Git에 있고 코드 검토를 거쳐 환경 전체에 일관되게 적용됩니다.
범위는 무엇입니까?
공급자는 16개의 리소스 및 18개의 데이터 소스와 함께 제공됩니다. 다음은 다루는 주요 영역입니다:
위협 감지 및 방지
- 사용자 정의 방지 목록 - 팀 ID, 파일 해시, CDHash 또는 서명 ID별 허용/차단 목록입니다.
- 예외 집합 - 분석 및 엔드포인트 보안 제어를 위한 예외입니다.
엔드포인트 구성
- 계획 - 위협 방지 모드, 통신 프로토콜, 보고 간격 및 장치 정보 수집을 포함한 전체 엔드포인트 보안 구성입니다.
- 작업 구성 - 경고 데이터 강화 및 보고 엔드포인트(HTTP, Kafka, 클라우드)입니다.
- 원격 분석 - 이벤트 및 로그 수집: 보안 이벤트, 인증, 파일 무결성 모니터링, 성능 메트릭 등입니다.
장치 제어
- 이동식 저장소 제어 집합 - 공급업체 ID, 제품 ID 또는 일련 번호별로 재정의하는 USB 장치 정책입니다.
운영 설정
- 데이터 전달 - Amazon S3, Microsoft Sentinel 또는 클라우드 엔드포인트로 데이터를 라우팅합니다.
- 데이터 보존 - 테넌트 전체 보존 정책입니다.
- 변경 관리 - 구성 동결입니다.
- 통합 로깅 필터 - NSPredicate 필터를 사용한 macOS 통합 로그 수집입니다.
액세스 제어
- 사용자, 그룹, 역할 및 API 클라이언트 - 코드에서 액세스 및 권한을 관리합니다.
모든 리소스는 전체 CRUD 작업 및 terraform import를 지원합니다.
jamfprotect_change_management, jamfprotect_data_forwarding 및 jamfprotect_data_retention은 싱글톤 리소스입니다 - 개별적으로 식별 가능한 개체가 아닌 테넌트 전체 설정을 관리합니다.
시작하기
소개 문서를 따라가셨다면 이미 Terraform을 설치하고 프로젝트 구조를 기본적으로 이해하고 있어야 합니다. 여기의 단계는 비슷합니다.
1. Jamf Protect에서 API 클라이언트 만들기
Jamf Protect 콘솔에서 관리 > API 클라이언트로 이동하여 관리하려는 리소스에 필요한 권한을 가진 새 API 클라이언트를 만드십시오.
2. 공급자 구성
Terraform 구성에 공급자를 추가합니다:
terraform {
required_providers {
jamfprotect = {
source = "Jamf-Concepts/jamfprotect"
version = "~> 0.1.0"
}
}
}
provider "jamfprotect" {
url = "https://your-tenant.protect.jamfcloud.com"
client_id = var.jamfprotect_client_id
client_secret = var.jamfprotect_client_secret
}
공급자 블록을 깔끔하게 유지하려면 환경 변수를 사용할 수도 있습니다:
export JAMFPROTECT_URL="https://your-tenant.protect.jamfcloud.com"
export JAMFPROTECT_CLIENT_ID="your-client-id"
export JAMFPROTECT_CLIENT_SECRET="your-client-secret"
Jamf Pro 공급자와 마찬가지로 이러한 자격 증명이 Git 저장소에 들어가지 않도록 하십시오. terraform.tfvars 파일을 사용하고 .gitignore에 추가합니다.
3. 리소스 정의
수집되는 데이터 및 경고가 전송되는 위치를 정의하는 작업 구성의 예:
resource "jamfprotect_action_configuration" "default" {
name = "Default Action Config"
alert_data_collection = {
binary_included_data_attributes = ["Sha256", "Signing Information"]
download_event_included_data_attributes = ["File"]
file_included_data_attributes = ["Sha256", "Signing Information"]
file_system_event_included_data_attributes = ["File", "Process"]
gatekeeper_event_included_data_attributes = ["Blocked Process"]
group_included_data_attributes = ["Name"]
keylog_register_event_included_data_attributes = ["Source Process"]
process_included_data_attributes = ["Args", "Signing Information", "Binary", "User", "Parent"]
process_event_included_data_attributes = ["Process"]
screenshot_event_included_data_attributes = ["File"]
synthetic_click_event_included_data_attributes = ["Process"]
user_included_data_attributes = ["Name"]
}
jamf_protect_cloud_endpoint = {
collect_alerts = ["low", "medium", "high"]
collect_logs = ["telemetry"]
}
}
승인된 암호화된 드라이브를 제외한 모든 USB 저장소를 차단하는 이동식 저장소 정책:
resource "jamfprotect_removable_storage_control_set" "strict" {
name = "Strict USB Policy"
description = "Block all removable storage except encrypted devices."
default_permission = "Prevent"
default_local_notification_message = "Removable storage devices are not permitted."
override_encrypted_devices = [
{
permission = "Read and Write"
},
]
}
신뢰할 수 있는 IT 관리 도구를 위협 방지에서 제외하는 예외 집합:
resource "jamfprotect_exception_set" "it_admin_tools" {
name = "IT Admin Tools"
description = "Exceptions for trusted IT administration software."
exceptions = [
{
type = "Override Endpoint Threat Prevention"
sub_type = "Process"
rules = [
{
match_type = "Bundle ID"
match_value = "com.example.admin-tool"
}
]
}
]
}