guardvibe 0.6.4 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/build/data/rules/auth.d.ts +3 -0
- package/build/data/rules/auth.d.ts.map +1 -0
- package/build/data/rules/auth.js +100 -0
- package/build/data/rules/auth.js.map +1 -0
- package/build/data/rules/database.d.ts +3 -0
- package/build/data/rules/database.d.ts.map +1 -0
- package/build/data/rules/database.js +100 -0
- package/build/data/rules/database.js.map +1 -0
- package/build/data/rules/deployment.d.ts +3 -0
- package/build/data/rules/deployment.d.ts.map +1 -0
- package/build/data/rules/deployment.js +192 -0
- package/build/data/rules/deployment.js.map +1 -0
- package/build/data/rules/index.d.ts +1 -0
- package/build/data/rules/index.d.ts.map +1 -1
- package/build/data/rules/index.js +10 -0
- package/build/data/rules/index.js.map +1 -1
- package/build/data/rules/nextjs.d.ts +3 -0
- package/build/data/rules/nextjs.d.ts.map +1 -0
- package/build/data/rules/nextjs.js +148 -0
- package/build/data/rules/nextjs.js.map +1 -0
- package/build/index.js +62 -16
- package/build/index.js.map +1 -1
- package/build/plugins/loader.d.ts +18 -0
- package/build/plugins/loader.d.ts.map +1 -0
- package/build/plugins/loader.js +151 -0
- package/build/plugins/loader.js.map +1 -0
- package/build/plugins/types.d.ts +17 -0
- package/build/plugins/types.d.ts.map +1 -0
- package/build/plugins/types.js +2 -0
- package/build/plugins/types.js.map +1 -0
- package/build/tools/check-code.d.ts +3 -2
- package/build/tools/check-code.d.ts.map +1 -1
- package/build/tools/check-code.js +26 -4
- package/build/tools/check-code.js.map +1 -1
- package/build/tools/check-package-health.d.ts +29 -0
- package/build/tools/check-package-health.d.ts.map +1 -0
- package/build/tools/check-package-health.js +142 -0
- package/build/tools/check-package-health.js.map +1 -0
- package/build/tools/check-project.d.ts +2 -1
- package/build/tools/check-project.d.ts.map +1 -1
- package/build/tools/check-project.js +21 -3
- package/build/tools/check-project.js.map +1 -1
- package/build/tools/compliance-report.d.ts +2 -1
- package/build/tools/compliance-report.d.ts.map +1 -1
- package/build/tools/compliance-report.js +27 -3
- package/build/tools/compliance-report.js.map +1 -1
- package/build/tools/export-sarif.d.ts +2 -1
- package/build/tools/export-sarif.d.ts.map +1 -1
- package/build/tools/export-sarif.js +2 -2
- package/build/tools/export-sarif.js.map +1 -1
- package/build/tools/scan-dependencies.d.ts +1 -1
- package/build/tools/scan-dependencies.d.ts.map +1 -1
- package/build/tools/scan-dependencies.js +25 -2
- package/build/tools/scan-dependencies.js.map +1 -1
- package/build/tools/scan-directory.d.ts +2 -1
- package/build/tools/scan-directory.d.ts.map +1 -1
- package/build/tools/scan-directory.js +27 -4
- package/build/tools/scan-directory.js.map +1 -1
- package/build/tools/scan-secrets.d.ts +1 -1
- package/build/tools/scan-secrets.d.ts.map +1 -1
- package/build/tools/scan-secrets.js +10 -1
- package/build/tools/scan-secrets.js.map +1 -1
- package/build/tools/scan-staged.d.ts +2 -1
- package/build/tools/scan-staged.d.ts.map +1 -1
- package/build/tools/scan-staged.js +21 -3
- package/build/tools/scan-staged.js.map +1 -1
- package/build/utils/config.d.ts +1 -0
- package/build/utils/config.d.ts.map +1 -1
- package/build/utils/config.js +3 -0
- package/build/utils/config.js.map +1 -1
- package/build/utils/typosquat.d.ts +9 -0
- package/build/utils/typosquat.d.ts.map +1 -0
- package/build/utils/typosquat.js +101 -0
- package/build/utils/typosquat.js.map +1 -0
- package/package.json +7 -3
package/LICENSE
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/data/rules/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,eAAO,MAAM,SAAS,EAAE,YAAY,EAsHnC,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Security rules for Clerk, Auth.js, and general auth patterns
|
|
2
|
+
export const authRules = [
|
|
3
|
+
{
|
|
4
|
+
id: "VG420",
|
|
5
|
+
name: "Unprotected Route Handler",
|
|
6
|
+
severity: "high",
|
|
7
|
+
owasp: "A01:2025 Broken Access Control",
|
|
8
|
+
description: "Route handler accesses database without authentication check. Anyone can call this endpoint.",
|
|
9
|
+
pattern: /export\s+(?:async\s+)?function\s+(?:GET|POST|PUT|DELETE|PATCH)\s*\([^)]*\)\s*\{(?:(?!auth\s*\(|getServerSession|currentUser|getUser|requireAuth)[\s\S])*?(?:prisma|db|supabase)\.\w+/g,
|
|
10
|
+
languages: ["javascript", "typescript"],
|
|
11
|
+
fix: "Add authentication check at the start of every route handler that accesses data.",
|
|
12
|
+
fixCode: 'import { auth } from "@clerk/nextjs/server";\n\nexport async function GET() {\n const { userId } = await auth();\n if (!userId) return new Response("Unauthorized", { status: 401 });\n const data = await db.query(...);\n}',
|
|
13
|
+
compliance: ["SOC2:CC6.6", "PCI-DSS:Req6.5.10", "HIPAA:§164.312(d)"],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "VG421",
|
|
17
|
+
name: "Auth Without Middleware",
|
|
18
|
+
severity: "high",
|
|
19
|
+
owasp: "A01:2025 Broken Access Control",
|
|
20
|
+
description: "Importing auth() from Clerk without clerkMiddleware configured. auth() returns empty data without middleware.",
|
|
21
|
+
pattern: /import\s*\{[^}]*\bauth\b[^}]*\}\s*from\s*["']@clerk\/nextjs\/server["']/g,
|
|
22
|
+
languages: ["javascript", "typescript"],
|
|
23
|
+
fix: "Ensure clerkMiddleware() is configured in proxy.ts (Next.js 16) or middleware.ts.",
|
|
24
|
+
fixCode: '// proxy.ts or middleware.ts\nimport { clerkMiddleware } from "@clerk/nextjs/server";\nexport default clerkMiddleware();',
|
|
25
|
+
compliance: ["SOC2:CC6.6"],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "VG422",
|
|
29
|
+
name: "Clerk Secret Key Client Exposure",
|
|
30
|
+
severity: "critical",
|
|
31
|
+
owasp: "A07:2025 Sensitive Data Exposure",
|
|
32
|
+
description: "CLERK_SECRET_KEY is accessed in client-side code. This key grants full API access to your Clerk account.",
|
|
33
|
+
pattern: /["']use client["'][\s\S]*?CLERK_SECRET_KEY/g,
|
|
34
|
+
languages: ["javascript", "typescript"],
|
|
35
|
+
fix: "Never access CLERK_SECRET_KEY in client components. Use it only in server-side code.",
|
|
36
|
+
fixCode: '// Server-side only\nimport { clerkClient } from "@clerk/nextjs/server";\nconst users = await clerkClient.users.getUserList();',
|
|
37
|
+
compliance: ["SOC2:CC6.1", "HIPAA:§164.312(a)"],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "VG423",
|
|
41
|
+
name: "Auth.js Hardcoded Secret",
|
|
42
|
+
severity: "critical",
|
|
43
|
+
owasp: "A07:2025 Sensitive Data Exposure",
|
|
44
|
+
description: "NEXTAUTH_SECRET or AUTH_SECRET is hardcoded as a string literal instead of using an environment variable.",
|
|
45
|
+
pattern: /(?:NEXTAUTH_SECRET|AUTH_SECRET)\s*[:=]\s*["'][^"']{8,}["']/g,
|
|
46
|
+
languages: ["javascript", "typescript"],
|
|
47
|
+
fix: "Use environment variables for auth secrets. Generate with: npx auth secret",
|
|
48
|
+
fixCode: "# .env.local\nAUTH_SECRET= # Generated with: npx auth secret\n\n// auth.ts — AUTH_SECRET is read automatically from env",
|
|
49
|
+
compliance: ["SOC2:CC6.1", "PCI-DSS:Req2.3"],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "VG424",
|
|
53
|
+
name: "Session Token in localStorage",
|
|
54
|
+
severity: "high",
|
|
55
|
+
owasp: "A07:2025 Sensitive Data Exposure",
|
|
56
|
+
description: "Auth token or session stored in localStorage. localStorage is accessible to any JavaScript on the page, making it vulnerable to XSS attacks.",
|
|
57
|
+
pattern: /localStorage\.setItem\s*\(\s*["'](?:auth|session|token|jwt|access|refresh|bearer)\w*["']/gi,
|
|
58
|
+
languages: ["javascript", "typescript"],
|
|
59
|
+
fix: "Use httpOnly cookies for session tokens. They cannot be accessed by JavaScript.",
|
|
60
|
+
fixCode: '// Use httpOnly cookies instead\nresponse.cookies.set("session", token, {\n httpOnly: true,\n secure: true,\n sameSite: "lax",\n maxAge: 60 * 60 * 24,\n});',
|
|
61
|
+
compliance: ["SOC2:CC6.1", "PCI-DSS:Req6.5.10"],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "VG425",
|
|
65
|
+
name: "Auth Callback Open Redirect",
|
|
66
|
+
severity: "high",
|
|
67
|
+
owasp: "A01:2025 Broken Access Control",
|
|
68
|
+
description: "Auth callback URL accepts unvalidated redirect parameter. Attackers can redirect users to phishing sites after authentication.",
|
|
69
|
+
pattern: /(?:callbackUrl|redirect_uri|returnTo|next)\s*[=:]\s*(?:req\.query|searchParams\.get|request\.url|params)\b/g,
|
|
70
|
+
languages: ["javascript", "typescript"],
|
|
71
|
+
fix: "Validate callback URLs against an allowlist of trusted domains.",
|
|
72
|
+
fixCode: '// Validate callback URL\nconst callbackUrl = searchParams.get("callbackUrl") ?? "/";\nconst url = new URL(callbackUrl, request.url);\nif (url.origin !== new URL(request.url).origin) {\n redirect("/");\n}',
|
|
73
|
+
compliance: ["SOC2:CC6.6"],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "VG426",
|
|
77
|
+
name: "Missing Role Check on Admin Route",
|
|
78
|
+
severity: "high",
|
|
79
|
+
owasp: "A01:2025 Broken Access Control",
|
|
80
|
+
description: "Admin or dashboard route handler does not verify user role or permissions.",
|
|
81
|
+
pattern: /(?:\/admin|\/dashboard)[\s\S]*?export\s+(?:async\s+)?function\s+(?:GET|POST|PUT|DELETE|PATCH|default)\s*\([^)]*\)\s*\{(?:(?!role|permission|isAdmin|orgRole|checkRole)[\s\S])*?\}/g,
|
|
82
|
+
languages: ["javascript", "typescript"],
|
|
83
|
+
fix: "Always verify user roles and permissions in admin routes.",
|
|
84
|
+
fixCode: 'import { auth } from "@clerk/nextjs/server";\n\nexport async function GET() {\n const { userId, orgRole } = await auth();\n if (orgRole !== "org:admin") {\n return new Response("Forbidden", { status: 403 });\n }\n}',
|
|
85
|
+
compliance: ["SOC2:CC6.6", "HIPAA:§164.312(d)"],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "VG427",
|
|
89
|
+
name: "Supabase getSession Instead of getUser",
|
|
90
|
+
severity: "medium",
|
|
91
|
+
owasp: "A07:2025 Sensitive Data Exposure",
|
|
92
|
+
description: "Using supabase.auth.getSession() on the server side is insecure. The JWT can be spoofed. Use getUser() which validates the token with Supabase Auth server.",
|
|
93
|
+
pattern: /supabase\.auth\.getSession\s*\(/g,
|
|
94
|
+
languages: ["javascript", "typescript"],
|
|
95
|
+
fix: "Use supabase.auth.getUser() on the server side.",
|
|
96
|
+
fixCode: '// CORRECT: validates with Auth server\nconst { data: { user }, error } = await supabase.auth.getUser();\nif (error || !user) throw new Error("Unauthorized");',
|
|
97
|
+
compliance: ["SOC2:CC6.6"],
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/data/rules/auth.ts"],"names":[],"mappings":"AAEA,+DAA+D;AAC/D,MAAM,CAAC,MAAM,SAAS,GAAmB;IACvC;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,2BAA2B;QACjC,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,gCAAgC;QACvC,WAAW,EACT,8FAA8F;QAChG,OAAO,EACL,uLAAuL;QACzL,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;QACvC,GAAG,EAAE,kFAAkF;QACvF,OAAO,EACL,iOAAiO;QACnO,UAAU,EAAE,CAAC,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,CAAC;KACrE;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,yBAAyB;QAC/B,QAAQ,EAAE,MAAM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Q,EAAE,MAAM;QAChB,KAAK,EAAE,gCAAgC;QACvC,WAAW,EACT,gIAAgI;QAClI,OAAO,EACL,6GAA6G;QAC/G,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;QACvC,GAAG,EAAE,iEAAiE;QACtE,OAAO,EACL,+MAA+M;QACjN,UAAU,EAAE,CAAC,YAAY,CAAC;KAC3B;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,mCAAmC;QACzC,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,gCAAgC;QACvC,WAAW,EACT,4EAA4E;QAC9E,OAAO,EACL,oLAAoL;QACtL,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;QACvC,GAAG,EAAE,2DAA2D;QAChE,OAAO,EACL,8NAA8N;QAChO,UAAU,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;KAChD;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,wCAAwC;QAC9C,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,kCAAkC;QACzC,WAAW,EACT,6JAA6J;QAC/J,OAAO,EAAE,kCAAkC;QAC3C,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;QACvC,GAAG,EAAE,iDAAiD;QACtD,OAAO,EACL,gKAAgK;QAClK,UAAU,EAAE,CAAC,YAAY,CAAC;KAC3B;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../src/data/rules/database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,eAAO,MAAM,aAAa,EAAE,YAAY,EAmHvC,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Security rules for Supabase, Prisma, and Drizzle ORM
|
|
2
|
+
export const databaseRules = [
|
|
3
|
+
{
|
|
4
|
+
id: "VG430",
|
|
5
|
+
name: "Supabase Anon Key on Server",
|
|
6
|
+
severity: "high",
|
|
7
|
+
owasp: "A01:2025 Broken Access Control",
|
|
8
|
+
description: "Using the anon/public key server-side bypasses Row Level Security. Use the service_role key on the server.",
|
|
9
|
+
pattern: /createClient\s*\([\s\S]*?(?:NEXT_PUBLIC_SUPABASE_ANON_KEY|supabaseAnonKey)/g,
|
|
10
|
+
languages: ["javascript", "typescript"],
|
|
11
|
+
fix: "Use SUPABASE_SERVICE_ROLE_KEY on the server. The anon key is for client-side use with RLS.",
|
|
12
|
+
fixCode: '// Server-side: use service role key\nconst supabase = createClient(\n process.env.SUPABASE_URL!,\n process.env.SUPABASE_SERVICE_ROLE_KEY!\n);',
|
|
13
|
+
compliance: ["SOC2:CC6.6", "HIPAA:§164.312(a)"],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "VG431",
|
|
17
|
+
name: "Supabase Missing RLS Warning",
|
|
18
|
+
severity: "medium",
|
|
19
|
+
owasp: "A01:2025 Broken Access Control",
|
|
20
|
+
description: "Supabase client queries data. Ensure Row Level Security policies are configured on your tables.",
|
|
21
|
+
pattern: /supabase\s*\.from\s*\(\s*["']\w+["']\s*\)\s*\.(?:select|insert|update|delete|upsert)\s*\(/g,
|
|
22
|
+
languages: ["javascript", "typescript"],
|
|
23
|
+
fix: "Enable Row Level Security (RLS) on all Supabase tables and create appropriate policies.",
|
|
24
|
+
fixCode: "-- Enable RLS on tables\nALTER TABLE posts ENABLE ROW LEVEL SECURITY;\n\nCREATE POLICY \"Users can read own posts\"\n ON posts FOR SELECT\n USING (auth.uid() = user_id);",
|
|
25
|
+
compliance: ["SOC2:CC6.6"],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "VG432",
|
|
29
|
+
name: "Prisma Raw Query Injection",
|
|
30
|
+
severity: "critical",
|
|
31
|
+
owasp: "A03:2025 Injection",
|
|
32
|
+
description: "Prisma $queryRaw or $executeRaw with template literal interpolation. Use Prisma.sql tagged template for safe parameterization.",
|
|
33
|
+
pattern: /\.\$(?:queryRaw|executeRaw)`[^`]*\$\{(?!Prisma\.)/g,
|
|
34
|
+
languages: ["javascript", "typescript"],
|
|
35
|
+
fix: "Use Prisma.sql tagged template for safe parameterization.",
|
|
36
|
+
fixCode: 'import { Prisma } from "@prisma/client";\n\nconst result = await prisma.$queryRaw(\n Prisma.sql`SELECT * FROM users WHERE id = ${userId}`\n);',
|
|
37
|
+
compliance: ["SOC2:CC7.1", "PCI-DSS:Req6.5.1"],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "VG433",
|
|
41
|
+
name: "Prisma queryRawUnsafe Usage",
|
|
42
|
+
severity: "critical",
|
|
43
|
+
owasp: "A03:2025 Injection",
|
|
44
|
+
description: "$queryRawUnsafe and $executeRawUnsafe pass raw SQL strings without parameterization. Extremely dangerous with user input.",
|
|
45
|
+
pattern: /\.\$(?:queryRawUnsafe|executeRawUnsafe)\s*\(/g,
|
|
46
|
+
languages: ["javascript", "typescript"],
|
|
47
|
+
fix: "Replace with $queryRaw using Prisma.sql tagged template.",
|
|
48
|
+
fixCode: "const result = await prisma.$queryRaw(\n Prisma.sql`SELECT * FROM users WHERE id = ${userId}`\n);",
|
|
49
|
+
compliance: ["SOC2:CC7.1", "PCI-DSS:Req6.5.1"],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "VG434",
|
|
53
|
+
name: "Drizzle Unsafe SQL Interpolation",
|
|
54
|
+
severity: "critical",
|
|
55
|
+
owasp: "A03:2025 Injection",
|
|
56
|
+
description: "Drizzle sql tagged template with direct variable interpolation. Use sql.placeholder() for safe parameterization.",
|
|
57
|
+
pattern: /(?:db\.execute|db\.run|db\.get|db\.all)\s*\(\s*sql`[^`]*\$\{/g,
|
|
58
|
+
languages: ["javascript", "typescript"],
|
|
59
|
+
fix: "Use sql.placeholder() for dynamic values in Drizzle queries.",
|
|
60
|
+
fixCode: 'import { sql } from "drizzle-orm";\n\nconst result = await db.execute(\n sql`SELECT * FROM users WHERE id = ${sql.placeholder("id")}`,\n { id: userId }\n);',
|
|
61
|
+
compliance: ["SOC2:CC7.1", "PCI-DSS:Req6.5.1"],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "VG435",
|
|
65
|
+
name: "Database URL Client Exposure",
|
|
66
|
+
severity: "critical",
|
|
67
|
+
owasp: "A07:2025 Sensitive Data Exposure",
|
|
68
|
+
description: "DATABASE_URL or DIRECT_URL is accessed in client-side code. This exposes your database connection string to the browser.",
|
|
69
|
+
pattern: /["']use client["'][\s\S]*?process\.env\.(?:DATABASE_URL|DIRECT_URL)/g,
|
|
70
|
+
languages: ["javascript", "typescript"],
|
|
71
|
+
fix: "Never access database URLs in client components. Use Server Components or API routes.",
|
|
72
|
+
fixCode: "// Access database only server-side (no 'use client')\nexport default async function Page() {\n const data = await prisma.user.findMany();\n return <UserList users={data} />;\n}",
|
|
73
|
+
compliance: ["SOC2:CC6.1", "PCI-DSS:Req2.3", "HIPAA:§164.312(a)"],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "VG436",
|
|
77
|
+
name: "NEXT_PUBLIC Database URL",
|
|
78
|
+
severity: "critical",
|
|
79
|
+
owasp: "A07:2025 Sensitive Data Exposure",
|
|
80
|
+
description: "Database URL is prefixed with NEXT_PUBLIC_, exposing it in the client bundle.",
|
|
81
|
+
pattern: /NEXT_PUBLIC_\w*(?:DATABASE|DB|POSTGRES|MYSQL|MONGO|REDIS|SUPABASE_DB)\w*URL\s*=/gi,
|
|
82
|
+
languages: ["javascript", "typescript", "shell"],
|
|
83
|
+
fix: "Remove NEXT_PUBLIC_ prefix. Database URLs must only be server-side.",
|
|
84
|
+
fixCode: "# WRONG: exposed to client\n# NEXT_PUBLIC_DATABASE_URL=postgresql://...\n\n# CORRECT: server-side only\nDATABASE_URL=postgresql://...",
|
|
85
|
+
compliance: ["SOC2:CC6.1", "PCI-DSS:Req2.3", "HIPAA:§164.312(a)"],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "VG437",
|
|
89
|
+
name: "Supabase Service Role Key in Client",
|
|
90
|
+
severity: "critical",
|
|
91
|
+
owasp: "A07:2025 Sensitive Data Exposure",
|
|
92
|
+
description: "SUPABASE_SERVICE_ROLE_KEY is accessed in client-side code. This key bypasses RLS and grants full database access.",
|
|
93
|
+
pattern: /["']use client["'][\s\S]*?(?:SUPABASE_SERVICE_ROLE_KEY|SERVICE_ROLE)/g,
|
|
94
|
+
languages: ["javascript", "typescript"],
|
|
95
|
+
fix: "Never use the service role key in client code.",
|
|
96
|
+
fixCode: '// Server-side only\n"use server";\nconst adminClient = createClient(url, process.env.SUPABASE_SERVICE_ROLE_KEY!);',
|
|
97
|
+
compliance: ["SOC2:CC6.1", "HIPAA:§164.312(a)"],
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
//# sourceMappingURL=database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../src/data/rules/database.ts"],"names":[],"mappings":"AAEA,uDAAuD;AACvD,MAAM,CAAC,MAAM,aAAa,GAAmB;IAC3C;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,6BAA6B;QACnC,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,gCAAgC;QACvC,WAAW,EACT,4GAA4G;QAC9G,OAAO,EAAE,6EAA6E;QACtF,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;QACvC,GAAG,EAAE,4FAA4F;QACjG,OAAO,EACL,kJAAkJ;QACpJ,UAAU,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;KAChD;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,8BAA8B;QACpC,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,gCAAgC;QACvC,WAAW,EACT,iGAAiG;QACnG,OAAO,EACL,4FAA4F;QAC9F,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;QACvC,GAAG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,YAAY,CAAC;QACvC,GAAG,EAAE,uFAAuF;QAC5F,OAAO,EACL,qLAAqL;QACvL,UAAU,EAAE,CAAC,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,CAAC;KAClE;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,0BAA0B;QAChC,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,kCAAkC;QACzC,WAAW,EACT,+EAA+E;QACjF,OAAO,EACL,mFAAmF;QACrF,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC;QAChD,GAAG,EAAE,qEAAqE;QAC1E,OAAO,EACL,uIAAuI;QACzI,UAAU,EAAE,CAAC,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,CAAC;KAClE;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,qCAAqC;QAC3C,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,kCAAkC;QACzC,WAAW,EACT,mHAAmH;QACrH,OAAO,EAAE,uEAAuE;QAChF,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;QACvC,GAAG,EAAE,gDAAgD;QACrD,OAAO,EACL,oHAAoH;QACtH,UAAU,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;KAChD;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../../src/data/rules/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,eAAO,MAAM,eAAe,EAAE,YAAY,EA+NzC,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
// Security rules for deployment config files
|
|
2
|
+
export const deploymentRules = [
|
|
3
|
+
// vercel.json / vercel.ts
|
|
4
|
+
{
|
|
5
|
+
id: "VG500",
|
|
6
|
+
name: "Vercel CORS Wildcard",
|
|
7
|
+
severity: "high",
|
|
8
|
+
owasp: "A01:2025 Broken Access Control",
|
|
9
|
+
description: "Vercel config sets Access-Control-Allow-Origin to wildcard (*), allowing any website to make requests.",
|
|
10
|
+
pattern: /["']Access-Control-Allow-Origin["'][\s\S]*?["']\*["']/g,
|
|
11
|
+
languages: ["vercel-config", "json"],
|
|
12
|
+
fix: "Restrict CORS to specific trusted origins.",
|
|
13
|
+
fixCode: '// vercel.json\n{\n "headers": [{\n "source": "/api/(.*)",\n "headers": [{ "key": "Access-Control-Allow-Origin", "value": "https://yourdomain.com" }]\n }]\n}',
|
|
14
|
+
compliance: ["SOC2:CC6.6"],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "VG501",
|
|
18
|
+
name: "Vercel Internal Rewrite Exposure",
|
|
19
|
+
severity: "high",
|
|
20
|
+
owasp: "A01:2025 Broken Access Control",
|
|
21
|
+
description: "Vercel rewrites expose internal service URLs to the public internet.",
|
|
22
|
+
pattern: /["']rewrites["']\s*:\s*\[[\s\S]*?["']destination["']\s*:\s*["']https?:\/\/(?:localhost|127\.0\.0\.1|10\.|172\.(?:1[6-9]|2\d|3[01])\.|192\.168\.)/g,
|
|
23
|
+
languages: ["vercel-config", "json"],
|
|
24
|
+
fix: "Do not rewrite to internal network addresses. Use Vercel environment variables for service URLs.",
|
|
25
|
+
compliance: ["SOC2:CC6.6"],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "VG503",
|
|
29
|
+
name: "Vercel Cron Missing Secret Verification",
|
|
30
|
+
severity: "high",
|
|
31
|
+
owasp: "A01:2025 Broken Access Control",
|
|
32
|
+
description: "Cron jobs are configured but the endpoint may not verify CRON_SECRET. Anyone could trigger the cron endpoint manually.",
|
|
33
|
+
pattern: /["']crons["']\s*:\s*\[[\s\S]*?["']path["']\s*:\s*["'][^"']+["']/g,
|
|
34
|
+
languages: ["vercel-config", "json"],
|
|
35
|
+
fix: "Verify the CRON_SECRET header in your cron endpoint.",
|
|
36
|
+
fixCode: '// app/api/cron/route.ts\nexport async function GET(request: Request) {\n const authHeader = request.headers.get("authorization");\n if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {\n return new Response("Unauthorized", { status: 401 });\n }\n}',
|
|
37
|
+
compliance: ["SOC2:CC6.6"],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "VG504",
|
|
41
|
+
name: "Excessive Function Duration",
|
|
42
|
+
severity: "medium",
|
|
43
|
+
owasp: "A05:2025 Security Misconfiguration",
|
|
44
|
+
description: "Function maxDuration is set very high. Long-running functions increase costs and attack surface.",
|
|
45
|
+
pattern: /["']maxDuration["']\s*:\s*(?:[3-9]\d{2}|[1-9]\d{3,})/g,
|
|
46
|
+
languages: ["vercel-config", "json"],
|
|
47
|
+
fix: "Set maxDuration to the minimum required. Default 300s is sufficient for most use cases.",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "VG506",
|
|
51
|
+
name: "Hardcoded Secret in Vercel Config",
|
|
52
|
+
severity: "critical",
|
|
53
|
+
owasp: "A07:2025 Sensitive Data Exposure",
|
|
54
|
+
description: "Secret or API key hardcoded in vercel.json. This file is committed to git.",
|
|
55
|
+
pattern: /["'](?:SECRET|KEY|TOKEN|PASSWORD|CREDENTIAL)\w*["']\s*:\s*["'][A-Za-z0-9_\-]{12,}["']/gi,
|
|
56
|
+
languages: ["vercel-config", "json"],
|
|
57
|
+
fix: "Use Vercel environment variables (vercel env add) instead of hardcoding in config files.",
|
|
58
|
+
compliance: ["SOC2:CC6.1", "PCI-DSS:Req2.3"],
|
|
59
|
+
},
|
|
60
|
+
// next.config
|
|
61
|
+
{
|
|
62
|
+
id: "VG507",
|
|
63
|
+
name: "Wildcard Remote Image Pattern",
|
|
64
|
+
severity: "high",
|
|
65
|
+
owasp: "A05:2025 Security Misconfiguration",
|
|
66
|
+
description: "next.config allows images from any hostname. This enables SSRF and hotlinking attacks.",
|
|
67
|
+
pattern: /remotePatterns\s*:\s*\[[\s\S]*?hostname\s*:\s*["'](?:\*\*|\*)["']/g,
|
|
68
|
+
languages: ["nextjs-config", "javascript", "typescript"],
|
|
69
|
+
fix: "Restrict remotePatterns to specific trusted hostnames.",
|
|
70
|
+
fixCode: '// next.config.ts\nimages: {\n remotePatterns: [\n { protocol: "https", hostname: "images.example.com" },\n ]\n}',
|
|
71
|
+
compliance: ["SOC2:CC6.6"],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "VG509",
|
|
75
|
+
name: "Powered By Header Enabled",
|
|
76
|
+
severity: "low",
|
|
77
|
+
owasp: "A05:2025 Security Misconfiguration",
|
|
78
|
+
description: "X-Powered-By header reveals Next.js framework. This helps attackers target known vulnerabilities.",
|
|
79
|
+
pattern: /poweredByHeader\s*:\s*true/g,
|
|
80
|
+
languages: ["nextjs-config", "javascript", "typescript"],
|
|
81
|
+
fix: "Set poweredByHeader to false in next.config.ts.",
|
|
82
|
+
fixCode: "// next.config.ts\nconst config = {\n poweredByHeader: false,\n};",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: "VG510",
|
|
86
|
+
name: "Next Config CORS Wildcard",
|
|
87
|
+
severity: "high",
|
|
88
|
+
owasp: "A01:2025 Broken Access Control",
|
|
89
|
+
description: "Next.js config headers() sets Access-Control-Allow-Origin to wildcard (*).",
|
|
90
|
+
pattern: /headers\s*\(\s*\)\s*\{[\s\S]*?Access-Control-Allow-Origin[\s\S]*?["']\*["']/g,
|
|
91
|
+
languages: ["nextjs-config", "javascript", "typescript"],
|
|
92
|
+
fix: "Restrict CORS to specific trusted origins.",
|
|
93
|
+
compliance: ["SOC2:CC6.6"],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: "VG512",
|
|
97
|
+
name: "Source Maps in Production",
|
|
98
|
+
severity: "medium",
|
|
99
|
+
owasp: "A05:2025 Security Misconfiguration",
|
|
100
|
+
description: "Source maps enabled in production expose original source code to attackers.",
|
|
101
|
+
pattern: /devtool\s*:\s*["'](?:source-map|eval-source-map|cheap-source-map)["']/g,
|
|
102
|
+
languages: ["nextjs-config", "javascript", "typescript"],
|
|
103
|
+
fix: "Disable source maps in production.",
|
|
104
|
+
fixCode: "// next.config.ts\nconst config = {\n productionBrowserSourceMaps: false,\n};",
|
|
105
|
+
compliance: ["SOC2:CC6.1"],
|
|
106
|
+
},
|
|
107
|
+
// docker-compose.yml
|
|
108
|
+
{
|
|
109
|
+
id: "VG513",
|
|
110
|
+
name: "Docker Compose Public Port Binding",
|
|
111
|
+
severity: "medium",
|
|
112
|
+
owasp: "A05:2025 Security Misconfiguration",
|
|
113
|
+
description: "Port bound to 0.0.0.0 exposes the service to all network interfaces.",
|
|
114
|
+
pattern: /ports\s*:\s*\n\s*-\s*["']?0\.0\.0\.0:/gm,
|
|
115
|
+
languages: ["docker-compose", "yaml"],
|
|
116
|
+
fix: "Bind to 127.0.0.1 for local-only access.",
|
|
117
|
+
fixCode: '# Bind to localhost only\nports:\n - "127.0.0.1:3000:3000"',
|
|
118
|
+
compliance: ["SOC2:CC6.6"],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: "VG514",
|
|
122
|
+
name: "Docker Compose Hardcoded Secret",
|
|
123
|
+
severity: "critical",
|
|
124
|
+
owasp: "A07:2025 Sensitive Data Exposure",
|
|
125
|
+
description: "Secret hardcoded in docker-compose environment section. Use Docker secrets or .env file.",
|
|
126
|
+
pattern: /environment\s*:\s*\n(?:\s*-\s*|\s*\w+\s*:\s*)[\s\S]*?(?:SECRET|PASSWORD|TOKEN|KEY|CREDENTIAL)\w*\s*[=:]\s*\S{8,}/gi,
|
|
127
|
+
languages: ["docker-compose", "yaml"],
|
|
128
|
+
fix: "Use Docker secrets or reference a .env file instead of hardcoding.",
|
|
129
|
+
fixCode: "# Use .env file\nservices:\n app:\n env_file:\n - .env",
|
|
130
|
+
compliance: ["SOC2:CC6.1", "PCI-DSS:Req2.3"],
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: "VG515",
|
|
134
|
+
name: "Docker Compose Privileged Container",
|
|
135
|
+
severity: "critical",
|
|
136
|
+
owasp: "A05:2025 Security Misconfiguration",
|
|
137
|
+
description: "Container runs in privileged mode with full host access. This is a severe security risk.",
|
|
138
|
+
pattern: /privileged\s*:\s*true/g,
|
|
139
|
+
languages: ["docker-compose", "yaml"],
|
|
140
|
+
fix: "Remove privileged: true. Use specific capabilities (cap_add) if needed.",
|
|
141
|
+
fixCode: "# Instead of privileged: true, use specific capabilities\nservices:\n app:\n cap_add:\n - NET_ADMIN",
|
|
142
|
+
compliance: ["SOC2:CC6.1"],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: "VG516",
|
|
146
|
+
name: "Docker Compose Host Volume Mount",
|
|
147
|
+
severity: "high",
|
|
148
|
+
owasp: "A05:2025 Security Misconfiguration",
|
|
149
|
+
description: "Mounting the entire host filesystem gives the container excessive access.",
|
|
150
|
+
pattern: /volumes\s*:\s*\n\s*-\s*["']?(?:\/:|\/etc|\/var|\/root|\/home)\s*:/gm,
|
|
151
|
+
languages: ["docker-compose", "yaml"],
|
|
152
|
+
fix: "Mount only specific directories needed by the application.",
|
|
153
|
+
fixCode: "# Mount only what's needed\nvolumes:\n - ./data:/app/data",
|
|
154
|
+
compliance: ["SOC2:CC6.1"],
|
|
155
|
+
},
|
|
156
|
+
// fly.toml / render.yaml / netlify.toml
|
|
157
|
+
{
|
|
158
|
+
id: "VG517",
|
|
159
|
+
name: "Platform Config Hardcoded Secret",
|
|
160
|
+
severity: "critical",
|
|
161
|
+
owasp: "A07:2025 Sensitive Data Exposure",
|
|
162
|
+
description: "Secret hardcoded in deployment platform config file. These files are committed to git.",
|
|
163
|
+
pattern: /\[env\][\s\S]*?(?:SECRET|PASSWORD|TOKEN|KEY|CREDENTIAL)\w*\s*=\s*["']?[A-Za-z0-9_\-]{12,}/gi,
|
|
164
|
+
languages: ["fly-config", "render-config", "netlify-config", "toml"],
|
|
165
|
+
fix: "Use your platform's secret management (fly secrets set, Render env groups, Netlify env vars).",
|
|
166
|
+
fixCode: '# fly.toml — don\'t put secrets here\n# Instead: fly secrets set SECRET_KEY=value\n\n[env]\n LOG_LEVEL = "info"',
|
|
167
|
+
compliance: ["SOC2:CC6.1", "PCI-DSS:Req2.3"],
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
id: "VG518",
|
|
171
|
+
name: "Platform Internal Port Exposed",
|
|
172
|
+
severity: "medium",
|
|
173
|
+
owasp: "A05:2025 Security Misconfiguration",
|
|
174
|
+
description: "Internal service port (database, cache) is exposed publicly.",
|
|
175
|
+
pattern: /internal_port\s*=\s*(?:5432|3306|6379|27017|9200|2379)/g,
|
|
176
|
+
languages: ["fly-config", "toml"],
|
|
177
|
+
fix: "Don't expose database or cache ports publicly. Use internal networking.",
|
|
178
|
+
compliance: ["SOC2:CC6.6"],
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: "VG520",
|
|
182
|
+
name: "Missing HTTPS Redirect",
|
|
183
|
+
severity: "medium",
|
|
184
|
+
owasp: "A05:2025 Security Misconfiguration",
|
|
185
|
+
description: "No HTTP to HTTPS redirect configured. Traffic may be sent unencrypted.",
|
|
186
|
+
pattern: /force_https\s*=\s*false/g,
|
|
187
|
+
languages: ["fly-config", "toml"],
|
|
188
|
+
fix: "Enable force_https to redirect all HTTP traffic to HTTPS.",
|
|
189
|
+
compliance: ["SOC2:CC6.1", "PCI-DSS:Req4.1"],
|
|
190
|
+
},
|
|
191
|
+
];
|
|
192
|
+
//# sourceMappingURL=deployment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../../src/data/rules/deployment.ts"],"names":[],"mappings":"AAEA,6CAA6C;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,0BAA0B;IAC1B;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,sBAAsB;QAC5B,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,gCAAgC;QACvC,WAAW,EACT,wGA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A4D;QAC9D,UAAU,EAAE,CAAC,YAAY,CAAC;KAC3B;IAED,wCAAwC;IACxC;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,kCAAkC;QACxC,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,kCAAkC;QACzC,WAAW,EACT,wFAAwF;QAC1F,OAAO,EACL,6FAA6F;QAC/F,SAAS,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,CAAC;QACpE,GAAG,EAAE,+FAA+F;QACpG,OAAO,EACL,kHAAkH;QACpH,UAAU,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;KAC7C;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,gCAAgC;QACtC,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,oCAAoC;QAC3C,WAAW,EACT,8DAA8D;QAChE,OAAO,EAAE,yDAAyD;QAClE,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,GAAG,EAAE,yEAAyE;QAC9E,UAAU,EAAE,CAAC,YAAY,CAAC;KAC3B;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,wBAAwB;QAC9B,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,oCAAoC;QAC3C,WAAW,EACT,wEAAwE;QAC1E,OAAO,EAAE,0BAA0B;QACnC,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,GAAG,EAAE,2DAA2D;QAChE,UAAU,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;KAC7C;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/rules/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/rules/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW/C,eAAO,MAAM,UAAU,qCAUtB,CAAC;AAGF,eAAO,MAAM,YAAY,qCAAa,CAAC"}
|
|
@@ -3,11 +3,21 @@ import { goRules } from "./go.js";
|
|
|
3
3
|
import { dockerfileRules } from "./dockerfile.js";
|
|
4
4
|
import { cicdRules } from "./cicd.js";
|
|
5
5
|
import { terraformRules } from "./terraform.js";
|
|
6
|
+
import { nextjsRules } from "./nextjs.js";
|
|
7
|
+
import { authRules } from "./auth.js";
|
|
8
|
+
import { databaseRules } from "./database.js";
|
|
9
|
+
import { deploymentRules } from "./deployment.js";
|
|
6
10
|
export const owaspRules = [
|
|
7
11
|
...coreRules,
|
|
8
12
|
...goRules,
|
|
9
13
|
...dockerfileRules,
|
|
10
14
|
...cicdRules,
|
|
11
15
|
...terraformRules,
|
|
16
|
+
...nextjsRules,
|
|
17
|
+
...authRules,
|
|
18
|
+
...databaseRules,
|
|
19
|
+
...deploymentRules,
|
|
12
20
|
];
|
|
21
|
+
// Alias for clarity — these are the built-in rules without plugins
|
|
22
|
+
export const builtinRules = owaspRules;
|
|
13
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/rules/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/rules/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,GAAG,SAAS;IACZ,GAAG,OAAO;IACV,GAAG,eAAe;IAClB,GAAG,SAAS;IACZ,GAAG,cAAc;IACjB,GAAG,WAAW;IACd,GAAG,SAAS;IACZ,GAAG,aAAa;IAChB,GAAG,eAAe;CACnB,CAAC;AAEF,mEAAmE;AACnE,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs.d.ts","sourceRoot":"","sources":["../../../src/data/rules/nextjs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,eAAO,MAAM,WAAW,EAAE,YAAY,EAkLrC,CAAC"}
|