πŸ”’ Security

MDR

Managed Detection and Response

A managed security service in which external security experts monitor and respond to threats 24/7. Suited to small and medium-sized businesses that find it hard to build their own SOC, or large enterprises seeking to supplement their internal teams.

πŸ“– Detailed Explanation

MDR (Managed Detection and Response) is a service in which an external security specialist company monitors a customer's security events 24 hours a day, detects threats, and even carries out the response. Whereas the traditional MSSP (Managed Security Service Provider) mostly stopped at forwarding alerts, MDR includes actual threat analysis and response actions.

MDR services are generally based on EDR/XDR solutions. Agents are installed at the customer's site, and the collected telemetry is analyzed in the MDR provider's SOC. Alongside AI/ML-based automated detection, experienced threat hunters perform manual analysis to filter out False Positives and focus on real threats.

Representative MDR providers include CrowdStrike Falcon Complete, SentinelOne Vigilance, Palo Alto Unit 42 MDR, and Arctic Wolf. In Korea, SK Shieldus, AhnLab, and IGLOO Corporation offer MDR services. Red Canary and Expel are drawing attention as MDR providers specialized in cloud environments.

The core value of MDR is solving the shortage of security personnel. Hiring and retaining skilled security analysts is costly and difficult. With MDR, you can "rent" a team of experts and secure security capabilities faster than by building your own SOC. It is especially effective at filling monitoring gaps at night and on weekends.

πŸ’» Code Example

# MDR μ„œλΉ„μŠ€ 연동 API 예제 (κ°€μƒμ˜ MDR ν”Œλž«νΌ)

import requests
from datetime import datetime, timedelta
from typing import Dict, List, Optional
import hashlib
import hmac
import json

class MDRClient:
    """MDR μ„œλΉ„μŠ€ API ν΄λΌμ΄μ–ΈνŠΈ"""

    def __init__(self, api_key: str, api_secret: str, base_url: str):
        self.api_key = api_key
        self.api_secret = api_secret
        self.base_url = base_url

    def _sign_request(self, method: str, path: str, body: str = "") -> Dict[str, str]:
        """API μš”μ²­ μ„œλͺ… 생성"""
        timestamp = datetime.utcnow().isoformat()
        string_to_sign = f"{method}\n{path}\n{timestamp}\n{body}"
        signature = hmac.new(
            self.api_secret.encode(),
            string_to_sign.encode(),
            hashlib.sha256
        ).hexdigest()

        return {
            "X-API-Key": self.api_key,
            "X-Timestamp": timestamp,
            "X-Signature": signature,
            "Content-Type": "application/json"
        }

    # ==========================================
    # 1. μΈμ‹œλ˜νŠΈ 쑰회
    # ==========================================

    def get_incidents(self, status: str = "open", days: int = 7) -> List[Dict]:
        """MDRμ—μ„œ νƒμ§€ν•œ μΈμ‹œλ˜νŠΈ λͺ©λ‘ 쑰회"""
        path = "/api/v1/incidents"
        params = {
            "status": status,
            "start_time": (datetime.utcnow() - timedelta(days=days)).isoformat(),
            "end_time": datetime.utcnow().isoformat()
        }

        headers = self._sign_request("GET", path)
        response = requests.get(
            f"{self.base_url}{path}",
            headers=headers,
            params=params
        )

        if response.status_code == 200:
            return response.json()["incidents"]
        else:
            raise Exception(f"API Error: {response.status_code}")

    def get_incident_detail(self, incident_id: str) -> Dict:
        """μΈμ‹œλ˜νŠΈ 상세 정보 쑰회"""
        path = f"/api/v1/incidents/{incident_id}"
        headers = self._sign_request("GET", path)

        response = requests.get(f"{self.base_url}{path}", headers=headers)
        return response.json()

    # ==========================================
    # 2. λŒ€μ‘ 쑰치 μš”μ²­
    # ==========================================

    def request_containment(self, incident_id: str, action: str,
                           targets: List[str], reason: str) -> Dict:
        """
        MDR νŒ€μ— 차단/격리 쑰치 μš”μ²­

        action: "isolate_host", "block_ip", "disable_account", "quarantine_file"
        """
        path = f"/api/v1/incidents/{incident_id}/actions"
        body = {
            "action_type": action,
            "targets": targets,
            "reason": reason,
            "requested_by": "customer_soc",
            "urgency": "high"
        }

        headers = self._sign_request("POST", path, json.dumps(body))
        response = requests.post(
            f"{self.base_url}{path}",
            headers=headers,
            json=body
        )

        return response.json()

    def approve_action(self, action_id: str, approved: bool, comment: str = "") -> Dict:
        """MDR νŒ€μ˜ λŒ€μ‘ 쑰치 승인/κ±°λΆ€"""
        path = f"/api/v1/actions/{action_id}/approval"
        body = {
            "approved": approved,
            "comment": comment,
            "approved_by": "security_manager"
        }

        headers = self._sign_request("POST", path, json.dumps(body))
        response = requests.post(
            f"{self.base_url}{path}",
            headers=headers,
            json=body
        )

        return response.json()

    # ==========================================
    # 3. μœ„ν˜‘ μΈν…”λ¦¬μ „μŠ€ 쑰회
    # ==========================================

    def query_threat_intel(self, indicators: List[str]) -> Dict:
        """IOC(Indicator of Compromise) 쑰회"""
        path = "/api/v1/threat-intel/lookup"
        body = {"indicators": indicators}

        headers = self._sign_request("POST", path, json.dumps(body))
        response = requests.post(
            f"{self.base_url}{path}",
            headers=headers,
            json=body
        )

        return response.json()

    # ==========================================
    # 4. 리포트 및 λ©”νŠΈλ¦­
    # ==========================================

    def get_monthly_report(self, year: int, month: int) -> Dict:
        """μ›”κ°„ MDR 리포트 쑰회"""
        path = f"/api/v1/reports/monthly/{year}/{month}"
        headers = self._sign_request("GET", path)

        response = requests.get(f"{self.base_url}{path}", headers=headers)
        return response.json()

    def get_metrics(self) -> Dict:
        """SLA λ©”νŠΈλ¦­ 쑰회 (MTTD, MTTR λ“±)"""
        path = "/api/v1/metrics"
        headers = self._sign_request("GET", path)

        response = requests.get(f"{self.base_url}{path}", headers=headers)
        return response.json()


# ==========================================
# 5. μ‚¬μš© μ˜ˆμ‹œ
# ==========================================

def main():
    client = MDRClient(
        api_key="your-api-key",
        api_secret="your-api-secret",
        base_url="https://mdr.example.com"
    )

    # μ—΄λ¦° μΈμ‹œλ˜νŠΈ 쑰회
    incidents = client.get_incidents(status="open", days=7)
    print(f"Open incidents: {len(incidents)}")

    for incident in incidents:
        print(f"""
        ID: {incident['id']}
        Severity: {incident['severity']}
        Title: {incident['title']}
        Status: {incident['status']}
        Detected: {incident['detected_at']}
        Assigned Analyst: {incident['analyst']}
        """)

        # 상세 정보 쑰회
        detail = client.get_incident_detail(incident['id'])

        # Critical μΈμ‹œλ˜νŠΈμ— λŒ€ν•΄ 호슀트 격리 μš”μ²­
        if incident['severity'] == 'critical':
            affected_hosts = detail.get('affected_hosts', [])
            if affected_hosts:
                result = client.request_containment(
                    incident_id=incident['id'],
                    action="isolate_host",
                    targets=affected_hosts,
                    reason="Critical malware detected, immediate containment required"
                )
                print(f"Containment requested: {result['action_id']}")

    # λ©”νŠΈλ¦­ 쑰회
    metrics = client.get_metrics()
    print(f"""
    === MDR SLA Metrics ===
    MTTD (Mean Time to Detect): {metrics['mttd_minutes']} minutes
    MTTR (Mean Time to Respond): {metrics['mttr_minutes']} minutes
    Incidents this month: {metrics['incidents_count']}
    False Positive Rate: {metrics['false_positive_rate']}%
    """)

if __name__ == "__main__":
    main()

πŸ—£οΈ How It's Said in Practice

CISO: "We only have three people on the security team, so how can we do 24/7 monitoring? If ransomware hits over the weekend, we can't respond."

Security Officer: "How about considering adopting an MDR service? We can hand off night and weekend coverage, and our team can focus on daytime hours and internal security policies."

CISO: "What about cost-effectiveness?"

Security Officer: "Building a 24/7 SOC in-house would require at least 8 people, and there are also SIEM and SOAR tool costs. MDR guarantees a faster MTTR at one-third of that cost."

Interviewer: "What is the difference between MSSP and MDR?"

Candidate: "An MSSP traditionally managed security equipment such as firewalls and IDS and forwarded alerts. MDR goes a step further and performs actual threat analysis, incident investigation, and response actions. If an MSSP is 'alert forwarding,' MDR is 'threat response.'"

Take a mock interview on this topic β†’ WIA SOOM AI Interview Β· Start for free

Reviewer: "Did you give the MDR team automatic isolation authority? If containment actions run immediately, the impact on business operations could be significant."

Author: "I set up the workflow so that only Critical is executed immediately at the MDR team's discretion, and High and below are executed after our team's approval."

⚠️ Cautions

πŸ“š Learn More