-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocsConfiguration.tsx
More file actions
114 lines (95 loc) · 4.33 KB
/
Copy pathDocsConfiguration.tsx
File metadata and controls
114 lines (95 loc) · 4.33 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
import DocsLayout from "@/components/DocsLayout";
const DocsConfiguration = () => {
return (
<DocsLayout>
<div className="space-y-6 pt-8 md:pt-12">
<h1 className="text-4xl font-bold text-primary mb-10 mt-6">Configuration Guide</h1>
<div className="text-lg text-muted-foreground mb-8">
Set up SECOM in your development environment.
</div>
<div className="prose prose-slate max-w-none">
<h2>Configuring SECOM</h2>
<p>
Adopting the SECOM convention in your project is straightforward and doesn't require
installing any special software. However, to get the most out of SECOM, we recommend
setting up a few tools to help enforce the convention and streamline your workflow.
</p>
<h3>1. Set Up a Git Commit Template</h3>
<p>
Start by creating a file named <code>secom-template.txt</code> with the following content:
</p>
<pre className="bg-muted p-4 rounded-md overflow-x-auto">
<code className="text-black">
security(CWE-XXX): Concise summary of the fix{"\n\n"}
# Detailed description:{"\n"}
# - What was the vulnerability?{"\n"}
# - How was it fixed?{"\n"}
# - What's the impact?{"\n"}
# - References (issues, CVEs, etc.)
</code>
</pre>
<p>
Then configure Git to use this template by running:
</p>
<pre className="bg-muted p-4 rounded-md overflow-x-auto">
<code className="text-black">
git config --global commit.template /path/to/secom-template.txt
</code>
</pre>
<h3>2. Install SECOMlint</h3>
<p>
SECOMlint is a tool that checks your commit messages for compliance with the SECOM convention.
</p>
<p>
To install SECOMlint:
</p>
<pre className="bg-muted p-4 rounded-md overflow-x-auto">
<code className="text-black">
npm install -g @tqrg/secomlint
</code>
</pre>
<p>
Visit the <a href="https://tqrg.github.io/secomlint/" className="text-primary hover:underline" target="_blank" rel="noopener noreferrer">SECOMlint website</a> for more detailed instructions.
</p>
<h3>3. Set Up Git Hooks (Recommended)</h3>
<p>
To automatically check your commit messages for compliance with SECOM, you can set up a
Git commit-msg hook:
</p>
<ol>
<li>Create a file named <code className="text-black">commit-msg</code> in your <code className="text-black">.git/hooks/</code> directory</li>
<li>Make it executable with <code className="text-black">chmod +x .git/hooks/commit-msg</code></li>
<li>Add the following content to the file:</li>
</ol>
<pre className="bg-muted p-4 rounded-md overflow-x-auto">
<code className="text-black">
#!/bin/sh{"\n"}
# Run SECOMlint on security-related commits{"\n"}
if grep -q '^security(' "$1"; then{"\n"}
{" "}secomlint "$1" || exit 1{"\n"}
fi{"\n"}
exit 0
</code>
</pre>
<h3>4. Configure Your IDE (Optional)</h3>
<p>
For an even smoother experience, consider installing extensions for your IDE:
</p>
<ul>
<li>VS Code: Install the "SECOM Linter" extension from the marketplace</li>
<li>JetBrains IDEs: Install the "SECOM" plugin</li>
</ul>
<h2>Next Steps</h2>
<p>
Now that you have SECOM configured, you can:
</p>
<ul>
<li>Read the <a href="/docs/convention" className="text-primary hover:underline">convention overview</a> to understand the format</li>
<li>Check out the <a href="/docs/reference" className="text-primary hover:underline">reference guide</a> for examples and templates</li>
</ul>
</div>
</div>
</DocsLayout>
);
};
export default DocsConfiguration;