메뉴
HN
Hacker News 25일 전

초보자를 위한 위협 모델링(Threat Modeling) 비공식 가이드

IMP
8/10
핵심 요약

보안 전문가가 아닌 일반 개발자와 기획자를 위해 '위협 모델링'의 개념과 필수 질문들을 알기 쉽게 설명한 글입니다. 시스템의 자산, 가정, 수용할 위험 등을 명확히 정의하고 문서화하여 지속적으로 업데이트하는 것이 안전한 제품을 설계하는 핵심이라고 강조합니다.

번역된 본문

하이브리드 양자 후내성 암호(Hybrid Post-Quantum Cryptography)에 대한 지치는 대화, 엔드투엔드 암호화 메시징 앱에 대한 엔드포인트 공격으로 궤변을 부리는 무지한 사람들, 그리고 어리석은 정치인들이 우리 모두에게 더 많은 '연령 확인' 같은 헛소리를 강요하는 와중에 일어난 게시판 토론으로 길고 지친 하루를 보낸 후, 대부분의 사람들에게 '위협 모델(Threat Model)'이라는 문구가 생소한 개념이라는 것이 아주 명확해졌습니다. 물론 그들이 아는 것이라고는 그저 유행어뿐이겠지만 말이죠.

솔직히 말씀드리자면: 여러 블록체인이 포함된 새로운 스타트업을 위한 공식적인 위협 모델 문서를 작성하는 방법에 대해 100개 이상의 인용이 달린 학술 자료를 찾고 오셨다면, 이 글은 아마도 여러분에게 맞지 않는 블로그일 것입니다. 아마 STRIDE와 시스템 이론(system theory)부터 시작하는 것이 좋을 겁니다. 하지만 훌륭한 위협 모델이 대답해야 할 질문이 무엇인지에 대한 직관을 쌓고 싶고, 완전히 처음부터 시작하고 싶다면 제대로 찾아오셨습니다. 자, 그럼 위협 모델링에 대해 이야기해 봅시다.

초보자를 위한 위협 모델링 개략적인 수준에서, 이것을 너무 깊게 생각하지 마세요. 위협 모델은 일부 정보보안(infosec) 전문가들이 실제로 전문으로 삼는 공식적인 사이버 보안 프로세스이지만, 새로운 제품이나 서비스를 개발하는 설계 및 아키텍처 단계에서 비공식적인 위협 모델을 실행한다고 해서 막을 사람은 아무도 없습니다. 오히려 더 나은 결과를 얻을 수 있을 것입니다.

위협 모델은 최소한 다음과 같은 기본적인 질문에 답해야 합니다:

  1. 애초에 우리가 보호하려는 것은 무엇인가? 이 질문에 답할 수 없다면, 해야 할 기초 작업이 산더미처럼 많은 것입니다.
  2. 누가/무엇이 우리가 보호하는 것에 해를 가하려 하는가? 해커, 활동가, 사이버 스토커, 소셜 미디어 괴롭힘 네트워크 자연재해 / 나쁜 카르마 저임금과 과로에 시달리다 못해 폭발해버린 직원 모두에게 피해를 주는 멍청한 법안을 통과시키기 위해 대기업 로비스트에게 돈을 받은 어리석은 입법자들 국가 단위의 공격자!!!!1oneon
  3. (2)가 어떻게 (1)을 공격할 수 있는가? 여기에 공격 시나리오를 적습니다. 여기에 머피의 법칙(무엇이든 잘못될 수 있다면 잘못된다)을 적용합니다.
  4. (3)이 발생하는 것을 막기 위해 우리는 무엇을 할 것인가? 여기에도 역시 머피의 법칙이 적용됩니다!

자, 그리고요. 이 항목들을 체크했다면 어떤 의미에서는 여러분의 문서를 '위협 모델'이라고 부를 수 있습니다. 하지만 이것은 종종 실제로는 쓸모가 없는데, 왜냐하면 몇 가지 중요한 세부 사항이 생략되기 때문입니다.

  1. 자산(1)이 어떻게 연결/관련되어 있는가? 목록이 아닌 그래프(graph)로 생각하세요. 모든 대상의 가치가 동일하지는 않습니다.
  2. 우리는 어떤 가정을 하고 있는가? (특히 (4)와 (5)에 대해) 이에 대해서는 아래에서 더 말하겠습니다.
  3. 우리가 의도적으로 다루지 않기로 한 위협은 무엇인가? 아무도 예측할 수 없는 먼 미래에 누군가가 상상할 수 있는 모든 가능한 공격을 해결하는 것은 불가능하므로, 그런 척하지 마세요.

아이러니하게도 너무 많은 사람들이 가정(6)을 당연하게 여기지만, 자신의 가정이 무엇인지 명확히 하는 것은 믿을 수 없을 정도로 중요합니다. 가정 중 하나가 틀렸다면, 모델은 (운이 좋으면) 불완전하거나 수용된 위험 목록(7)을 재고해야 할 것입니다.

예를 들어 보겠습니다: 보이지 않는 도롱뇽(Invisible Salamanders) 공격은 일부 엔드투엔드 암호화 메시징 설계에서 신고(abuse reporting) 기능을 무력화시키지만, 오직 신고 기능을 도입했을 때만 그렇습니다. 이 공격이 가능한 이유는 해당 AEAD 스킴(AES-GCM, ChaCha20-Poly1305)에 포함된 가정 중 하나가 주어진 메시지에 대해 '오직 하나의 유효한 키만 존재한다'는 것이기 때문입니다. 주어진 메시지에 대해 여러 개의 유효한 키를 도입하는 순간(또는 혼란스러운 대리인을 도입하는 순간), 알고리즘의 보안 보장 범위를 벗어나게 되며 이는 공격자 입장에서는 아주 재미있는 트릭이 됩니다.

자신의 가정을 명확히 하면 스스로의 '알지 못하는 알지 못함(미지의 위험)'을 식별할 수 있습니다. 완벽할 필요는 없습니다. 사실 위협 모델은 특정 시점의 스냅샷이 아니라 살아있는 문서(living documents)여야 합니다. 적절하다고 판단될 때마다 업데이트해야 합니다.

시작하는 방법 전문적으로 위협 모델링을 수행하려는 경우, '위협 모델링 선언문(Threat Modeling Manifesto)'을 읽어보는 것이 좋을 것입니다. 제가 접근하는 방식은 다음과 같습니다.

첫째, 위의 7가지 항목을 빠르게 복사하고 붙여넣을 수 있는 형식으로 적어보세요. 이것이 필요할 것입니다. 다음으로, 설계 중인 시스템의 구성 요소를 (가급적 큰 모눈 종이나 디지털 동등물에) 매핑해 보세요...

원문 보기
원문 보기 (영어)
After a long day of exhausting conversations about Hybrid Post-Quantum Cryptography , random jackasses trying to play gotcha with endpoint attacks against end-to-end encrypted messaging apps, and message board discussions in the wake of dumb politicians pushing more "age verification" bullshit on us all, it's become abundantly clear to me that the phrase "threat model" is a foreign concept to most people. Except, y'know, as a buzzword. To be up front: If you're here looking for an academic resource with over 100 citations on how to write a formal threat model document for your new startup which involves multiple blockchains, this probably isn't the gay furry blog for you. Maybe start with STRIDE and system theory . But if you're looking to build an intuition for what questions a good threat model should answer, and you're starting from zero, you're probably in the right place. So let's talk about threat modeling. Threat Modeling For Neophytes At a high level, don't overthink this too much. While a threat model is a formal cybersecurity process that some infosec folks actually specialize in, you can run informal threat models in the design and architecture phases of developing a new product or service and no one can stop you. You might just end up with a better result. A threat model should, at minimum, answer these basic questions: What are we even protecting to begin with? If you can't answer this, you have a lot of ground work to do. Who/what wants to harm what we're protecting? Hackers, activists, cyber-stalkers, social media harassment networks Natural disasters / bad karma Underpaid and overworked employees who get fed up Idiotic legislatures paid by large corporate lobbyists to pass stupid laws that hurt everyone Nation State Adversaries!!!!1oneon How might (2) attack (1)? Attack scenarios go here Murphy's Law goes here What will we do to prevent (3) from happening? Murphy's Law also goes here! And, like, okay. If you can check those off, you can call your document a threat model in some sense. However, this is often useless in practice because some crucial details are omitted. How are the assets (1) related / connected? Think in graphs, not lists . Not all targets are equal value. What assumptions are we making, especially with (4) and (5)? I'll say more about this below. What threats are we deliberately not addressing? You literally cannot address every possible attack that any person will ever imagine in the unforeseeable future, so don't pretend to. Too many people take assumptions (6) for granted, ironically, but it's incredibly important to be as clear about what your assumptions are. If one of your assumptions is wrong, then your model is incomplete (at best), or your list of accepted risks (7) needs to be reconsidered. For example: The Invisible Salamanders attack breaks abuse reporting in some end-to-end encrypted messaging designs, but only if you introduce abuse reporting. The attack is possible because one of the assumptions that went into the AEAD schemes in question (AES-GCM, ChaCha20-Poly1305) is that there is only one valid key for a given message. The second you introduce multiple valid keys for a given message (or confused deputies for that matter), you've gone outside the security guarantees of your algorithm-which, as an attacker, makes for a fun trick . Being clear about your assumptions allows you to identify your own unknown unknowns. You don't have to be perfect. In fact: Threat models are supposed to be living documents, not point-in-time snapshots. Update them whenever you deem appropriate. How to Get Started If you're looking to do threat modeling professionally, you probably want to read the Threat Modeling Manifesto . Here's how I approach it. First, write down the 7 items above in a format that you can vaguely copy and paste rapidly. You're going to need it. Next, map out (on a large piece of graph paper, preferably-or the digital equivalent) the components of the system you're designing or analyzing. If any widget directly talks to, depends on, or interacts with another widget, you need that relationship drawn in whatever convention is most useful to you. Once this is setup, you want to draw a box around the entire graph, and then pretend you're playing Fortnite: Every so often, the box gets smaller and focused more on each individual component. Each iteration, note all the inputs and outputs to each component, and try to answer as many of the 7 items as you can. Repeat until you've drilled down as far as your abstraction allows you, then brainstorm what assumptions you have about the layers you aren't drilling deeper into. What you're doing is starting at the highest level and working your way down into more specific pieces. Your database probably doesn't depend on the security of X25519 the same way that your load balancer does. But your database also probably shouldn't have an RSS feed built into it either. Take note of inappropriate relationships and aim to sever them if you can. Example: My Own Work You may or may not already be aware that I'm working on delivering key transparency to the Fediverse . The work is being tracked on publickey.directory if you're curious about the state of it after this blog post goes live. This work began with a specification , which includes a prominently featured threat model . The threat model is organized into the following sections: Assumptions (stated up front) Assets Actors (both attackers and people we want to protect), given role names The risks, which have one of four statuses attached Prevented by design : Attack simply won't work lol 😀 Mitigated : Attacks shouldn't succeed, unless an assumption is wrong. Most interesting for researchers to focus on. Addressable : There's a way to mitigate the risk, but it requires effort or care. Operators should be aware of this. Open : This is a risk we cannot or will not mitigate. These are the attacks that will succeed. This threat model isn't perfect, of course. I didn't perfectly relate the assets and actors to each other in a human-readable graph. There might be blind spots in the risks section I never considered. I might have forgotten to write down some assumption that matters for the security of the system. If you can look at my project's threat model and see its shortcomings, you probably understand the assignment well enough to write your own. But enough thinly-veiled shameless self-promotion. You won't learn much only looking at my example of fur-in-the game. We also need an example of a bad threat model doc, and boy howdy do I have one ready. Bad Example: Matrix's Threat Model I've picked on Matrix before ( twice ), so if you've read those blogs, this won't be news to you. This is Matrix's threat model (latest, v1.18): 9. Security Threat Model 9.1 Denial of Service The attacker could attempt to prevent delivery of messages to or from the victim in order to: Disrupt service or marketing campaign of a commercial competitor. Censor a discussion or censor a participant in a discussion. Perform general vandalism. 9.1.1 Threat: Resource Exhaustion An attacker could cause the victim’s server to exhaust a particular resource (e.g. open TCP connections, CPU, memory, disk storage) 9.1.2 Threat: Unrecoverable Consistency Violations An attacker could send messages which created an unrecoverable “split-brain” state in the cluster such that the victim’s servers could no longer derive a consistent view of the chatroom state. 9.1.3 Threat: Bad History An attacker could convince the victim to accept invalid messages which the victim would then include in their view of the chatroom history. Other servers in the chatroom would reject the invalid messages and potentially reject the victims messages as well since they depended on the invalid messages. 9.1.4 Threat: Block Network Traffic An attacker could try to firewall traffic between the victim’s server and some or all of the other servers in the chatroom. 9.1.5 Threat: High Volume of M