-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUSPTO_Drawings.html
More file actions
243 lines (212 loc) · 8.35 KB
/
USPTO_Drawings.html
File metadata and controls
243 lines (212 loc) · 8.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>USPTO Drawings -- Chain-Aware Ancestry Enforcement Engine</title>
<style>
/* ── Base Styles ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: "Times New Roman", Times, serif;
background: #fff;
color: #000;
padding: 0.75in;
}
h1 {
text-align: center;
font-size: 24pt;
font-weight: bold;
margin-bottom: 0.5in;
letter-spacing: 0.05em;
}
.figure-container {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.figure-container .mermaid {
width: 100%;
max-width: 7in;
}
.figure-container .mermaid svg {
width: 100% !important;
height: auto !important;
}
.page-break {
page-break-after: always;
break-after: page;
height: 0;
}
.sheet-label {
text-align: center;
font-size: 10pt;
color: #666;
margin-top: 0.25in;
font-style: italic;
}
/* ── Print Optimization ── */
@media print {
body {
background: #fff;
color: #000;
padding: 0.5in;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.page-break {
page-break-after: always;
break-after: page;
}
.sheet-label { color: #000; }
/* Force monochrome rendering */
.mermaid svg text { fill: #000 !important; }
.mermaid svg .node rect,
.mermaid svg .node polygon,
.mermaid svg .node circle { stroke: #000 !important; fill: #fff !important; }
.mermaid svg .edgePath .path { stroke: #000 !important; }
.mermaid svg .edgeLabel { background-color: #fff !important; }
.mermaid svg .label { color: #000 !important; }
.mermaid svg marker path { fill: #000 !important; }
}
@page {
size: letter;
margin: 0.75in;
}
</style>
</head>
<body>
<!-- ════════════════════════════════════════════════════ -->
<!-- FIG. 1 -->
<!-- ════════════════════════════════════════════════════ -->
<div class="figure-container">
<h1>FIG. 1</h1>
<div class="mermaid">
flowchart TD
A["Operating System Telemetry Event"] --> B["Entity Extraction<br/>(Process, IP, Domain, File)"]
B --> C{"Stage 1:<br/>Pre-Graph Allowlist Filter<br/>(flat attributes only)"}
C -- "Match: Known-Good" --> D["Drop Event<br/>(No Graph Write)"]
C -- "No Match" --> E{"Stage 2: FastBlocklist.evaluate()<br/>Has Rules?"}
E -- "No Rules Loaded" --> K["Write to Graph Database"]
E -- "Rules Loaded" --> F{"TIER 1: Fast-Path Buckets<br/>(Unscoped Rules)"}
F --> F1["1. IP Hash Set Lookup (O(1))"]
F1 -- "Miss" --> F2["2. CIDR Prefix Scan"]
F2 -- "Miss" --> F3["3. Domain Hash Set Lookup (O(1))"]
F3 -- "Miss" --> F4["4. Process Name Glob Match"]
F4 -- "Miss" --> F5["5. File Path Glob Match"]
F5 -- "Miss" --> F6["6. Chain Pattern Recursive Match"]
F6 -- "Miss" --> G{"TIER 2: Scoped Rules<br/>(Rules with chain_filter)"}
F1 -- "HIT" --> H["Synthesize SecurityFinding<br/>(severity: critical)"]
F2 -- "HIT" --> H
F3 -- "HIT" --> H
F4 -- "HIT" --> H
F5 -- "HIT" --> H
F6 -- "HIT" --> H
G --> G1["Reconstruct Process Ancestry<br/>via _build_chain_from_caches()"]
G1 --> G2{"For Each Scoped Rule:<br/>chain_filter matches?<br/>AND<br/>rule pattern matches?"}
G2 -- "BOTH Match" --> H
G2 -- "No Match (all rules)" --> K
H --> I["Trigger Immediate Response Action<br/>(Process Kill / Network Isolation)"]
I --> J["Skip Graph Write &<br/>LLM Analysis"]
K --> L["LLM-Based Analysis"]
L --> M{"Stage 3: Response Engine<br/>(Full Graph Context)"}
M -- "Blocklist Match" --> N["Execute Response Action"]
M -- "Allowlist Match" --> O["Suppress Response (Log Only)"]
M -- "No Rule Match" --> P["Apply Default Policy"]
</div>
<p class="sheet-label">Sheet 1 of 2</p>
</div>
<div class="page-break"></div>
<!-- ════════════════════════════════════════════════════ -->
<!-- FIG. 2 -->
<!-- ════════════════════════════════════════════════════ -->
<div class="figure-container">
<h1>FIG. 2</h1>
<div class="mermaid">
flowchart TD
START["Input: Current Process PID + Name"] --> A{"Is PidIndex<br/>bootstrapped?"}
A -- "Yes" --> B["Set primary source = PidIndex"]
A -- "No" --> C["Set primary source = Entity Extractor Caches"]
B --> D["Initialize: seen = {}, current = PID, ancestors = []"]
C --> D
D --> E{"current > 0<br/>AND<br/>current not in seen?"}
E -- "No" --> L["Build Final Chain"]
E -- "Yes" --> F["Add current to seen set<br/>(cycle detection)"]
F --> G["Lookup parent PID:<br/>1. Try PidIndex.get_parent_pid()<br/>2. Fallback: _ppid_cache.get()"]
G --> H{"Parent found<br/>AND parent > 0?"}
H -- "No" --> L
H -- "Yes" --> I["Lookup parent name:<br/>1. Try PidIndex.get_name()<br/>2. Fallback: _name_cache.get()"]
I --> J["Append parent name to ancestors"]
J --> K["Set current = parent PID"]
K --> E
L --> L1["chain = []"]
L1 --> L2{"Username known<br/>for original PID?"}
L2 -- "Yes" --> L3["Prepend 'USER:username' to chain"]
L2 -- "No" --> L4["Skip user prefix"]
L3 --> L5["Append reversed ancestors to chain"]
L4 --> L5
L5 --> L6["Append current process name to chain"]
L6 --> M["Result: e.g., [USER:alice, launchd, Terminal, bash, ncat]"]
M --> N["Pass chain to _match_chain_pattern()"]
N --> O["For each starting position<br/>in chain (start-unanchored):"]
O --> P{"Call _match_chain_recursive()<br/>with chain position and<br/>pattern position"}
P --> Q{"Pattern exhausted?"}
Q -- "Yes" --> R{"Chain also<br/>exhausted?"}
R -- "Yes" --> MATCH["MATCH: Return True"]
R -- "No" --> FAIL["Try next start position"]
Q -- "No, token is **" --> S["Try consuming 0, 1, 2, ..., N<br/>chain elements (backtracking)"]
S --> P
Q -- "No, token is *" --> T{"Chain element<br/>available?"}
T -- "Yes" --> U["Consume one element,<br/>advance pattern"]
U --> P
T -- "No" --> FAIL
Q -- "No, named token" --> V{"Chain element matches<br/>token via fnmatch<br/>(case-insensitive)?"}
V -- "Yes" --> W["Consume element,<br/>advance pattern"]
W --> P
V -- "No" --> FAIL
FAIL --> X{"More start<br/>positions?"}
X -- "Yes" --> O
X -- "No" --> NOMATCH["NO MATCH: Return False"]
</div>
<p class="sheet-label">Sheet 2 of 2</p>
</div>
<!-- ── Mermaid.js CDN ── -->
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
<script>
mermaid.initialize({
startOnLoad: true,
theme: 'neutral',
themeVariables: {
/* High-contrast monochrome for patent drawings */
primaryColor: '#ffffff',
primaryBorderColor: '#000000',
primaryTextColor: '#000000',
secondaryColor: '#ffffff',
secondaryBorderColor: '#000000',
secondaryTextColor: '#000000',
tertiaryColor: '#ffffff',
tertiaryBorderColor: '#000000',
tertiaryTextColor: '#000000',
lineColor: '#000000',
textColor: '#000000',
mainBkg: '#ffffff',
nodeBorder: '#000000',
clusterBkg: '#ffffff',
clusterBorder: '#000000',
titleColor: '#000000',
edgeLabelBackground: '#ffffff',
nodeTextColor: '#000000'
},
flowchart: {
htmlLabels: true,
curve: 'basis',
padding: 15,
nodeSpacing: 30,
rankSpacing: 40
},
securityLevel: 'loose'
});
</script>
</body>
</html>