Skip to content

Commit 43d4854

Browse files
committed
feat: Replace SARIF with patterns.toml examples
- Remove SARIF format example and command - Add patterns.toml configuration examples: - Python library (PyCA cryptography) with import and API patterns - C/C++ library (OpenSSL) with include and function patterns - Show how to define library detection rules - Demonstrate regex patterns for different languages - All examples are copyable with working copy buttons - Maintains clean black and white aesthetic - More practical examples showing tool configuration
1 parent a045f65 commit 43d4854

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

static/index.html

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,32 @@ <h4>JSONL Format</h4>
207207
</div>
208208

209209
<div class="output-section">
210-
<h4>SARIF Format</h4>
210+
<h4>Patterns Configuration</h4>
211211
<div class="code-block">
212-
<button class="copy-btn" onclick="copyToClipboard('{\"version\":\"2.1.0\",\"runs\":[{\"tool\":{\"driver\":{\"name\":\"cipherscope\"}},\"results\":[{\"ruleId\":\"detector-rust\",\"message\":{\"text\":\"RustCrypto library detected\"},\"locations\":[{\"physicalLocation\":{\"artifactLocation\":{\"uri\":\"src/main.rs\"},\"region\":{\"startLine\":12}}]}]}]}')">Copy</button>
213-
{"version":"2.1.0","runs":[{"tool":{"driver":{"name":"cipherscope"}},"results":[{"ruleId":"detector-rust","message":{"text":"RustCrypto library detected"},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"src/main.rs"},"region":{"startLine":12}}]}]}]}
212+
<button class="copy-btn" onclick="copyToClipboard('[[library]]\nname = \"PyCA cryptography\"\nlanguages = [\"Python\"]\n[library.patterns]\ninclude = [\"^\\\\s*from\\\\s+cryptography\\\\b\"]\napis = [\"\\\\bFernet(\\\\(\\\\)\", \"\\\\.encrypt(\\\\(\\\\)\", \"\\\\.decrypt(\\\\(\\\\)\"]')">Copy</button>
213+
[[library]]
214+
name = "PyCA cryptography"
215+
languages = ["Python"]
216+
[library.patterns]
217+
include = ["^\\s*from\\s+cryptography\\b"]
218+
apis = ["\\bFernet\\(", "\\.encrypt\\(", "\\.decrypt\\("]
214219
</div>
220+
<p style="margin-top: 0.8rem; color: #666; font-size: 0.9rem;">
221+
Define import patterns and API calls for each library
222+
</p>
223+
224+
<div class="code-block" style="margin-top: 1rem;">
225+
<button class="copy-btn" onclick="copyToClipboard('[[library]]\nname = \"OpenSSL\"\nlanguages = [\"C\", \"C++\"]\n[library.patterns]\ninclude = [\"^\\\\s*#\\\\s*include\\\\s*<openssl/[A-Za-z0-9_./-]+>\"]\napis = [\"\\\\bEVP_[A-Za-z0-9_]+\\\\s*\\\\(\\\\)\", \"\\\\bRSA_[A-Za-z0-9_]+\\\\s*\\\\(\\\\)\"]')">Copy</button>
226+
[[library]]
227+
name = "OpenSSL"
228+
languages = ["C", "C++"]
229+
[library.patterns]
230+
include = ["^\\s*#\\s*include\\s*<openssl/[A-Za-z0-9_./-]+>"]
231+
apis = ["\\bEVP_[A-Za-z0-9_]+\\s*\\(", "\\bRSA_[A-Za-z0-9_]+\\s*\\("]
232+
</div>
233+
<p style="margin-top: 0.8rem; color: #666; font-size: 0.9rem;">
234+
C/C++ libraries use include patterns and function calls
235+
</p>
215236
</div>
216237
</div>
217238

@@ -247,10 +268,6 @@ <h4 style="color: #000; margin-bottom: 0.8rem; font-size: 1rem;">Output Formats<
247268
<button class="copy-btn" onclick="copyToClipboard('cryptofind . --json > findings.jsonl')">Copy</button>
248269
cryptofind . --json > findings.jsonl
249270
</div>
250-
<div class="code-block" style="margin: 0.5rem 0;">
251-
<button class="copy-btn" onclick="copyToClipboard('cryptofind . --sarif findings.sarif')">Copy</button>
252-
cryptofind . --sarif findings.sarif
253-
</div>
254271
</div>
255272
</div>
256273

0 commit comments

Comments
 (0)