check-post 0.0.0-stage → 0.1.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 +21 -0
- package/README.md +141 -2
- package/dist/cli.js +51 -0
- package/dist/commands/init.js +218 -0
- package/dist/commands/list.js +50 -0
- package/dist/commands/run.js +149 -0
- package/dist/commands/shared.js +12 -0
- package/dist/commands/status.js +31 -0
- package/dist/core/adapters/claude-code.js +145 -0
- package/dist/core/adapters/index.js +14 -0
- package/dist/core/adapters/types.js +1 -0
- package/dist/core/discovery.js +183 -0
- package/dist/core/events.js +1 -0
- package/dist/core/gate.js +111 -0
- package/dist/core/process.js +20 -0
- package/dist/core/project.js +67 -0
- package/dist/core/runners/ai.js +91 -0
- package/dist/core/runners/command.js +48 -0
- package/dist/core/scheduler.js +157 -0
- package/dist/core/stage-file.js +61 -0
- package/dist/core/types.js +62 -0
- package/dist/ui/format.js +46 -0
- package/dist/ui/plain.js +47 -0
- package/dist/ui/tui/App.js +207 -0
- package/package.json +67 -4
- package/presets/angular/01-lint.md +4 -0
- package/presets/angular/02-unit-test.md +4 -0
- package/presets/angular/03-build.md +4 -0
- package/presets/angular/04-security/01-secrets.md +19 -0
- package/presets/angular/04-security/02-xss-audit.md +17 -0
- package/presets/angular/04-security/03-env-audit.md +11 -0
- package/presets/angular/04-security/04-dependency.md +5 -0
- package/presets/angular/04-security/_group.md +4 -0
- package/presets/angular/05-code-standard.md +15 -0
- package/presets/angular/context.md +2 -0
- package/presets/nextjs/01-lint.md +4 -0
- package/presets/nextjs/02-unit-test.md +4 -0
- package/presets/nextjs/03-build.md +4 -0
- package/presets/nextjs/04-security/01-secrets.md +19 -0
- package/presets/nextjs/04-security/02-xss-audit.md +16 -0
- package/presets/nextjs/04-security/03-env-audit.md +11 -0
- package/presets/nextjs/04-security/04-dependency.md +5 -0
- package/presets/nextjs/04-security/_group.md +4 -0
- package/presets/nextjs/05-code-standard.md +15 -0
- package/presets/nextjs/context.md +1 -0
- package/presets/node/01-lint.md +4 -0
- package/presets/node/02-unit-test.md +4 -0
- package/presets/node/03-build.md +4 -0
- package/presets/node/04-security/01-secrets.md +19 -0
- package/presets/node/04-security/02-injection-audit.md +15 -0
- package/presets/node/04-security/03-env-audit.md +11 -0
- package/presets/node/04-security/04-dependency.md +5 -0
- package/presets/node/04-security/_group.md +4 -0
- package/presets/node/05-code-standard.md +15 -0
- package/presets/node/context.md +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,69 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "check-post",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Pipeline CI/CD lokal: stage dari file Markdown, dijalankan oleh AI CLI (Claude Code). Gate GREEN = boleh deploy.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ci",
|
|
7
|
+
"cd",
|
|
8
|
+
"pipeline",
|
|
9
|
+
"claude",
|
|
10
|
+
"claude-code",
|
|
11
|
+
"ai",
|
|
12
|
+
"security-audit",
|
|
13
|
+
"code-review",
|
|
14
|
+
"cli",
|
|
15
|
+
"markdown"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://github.com/raisulkhairi/check-post#readme",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/raisulkhairi/check-post/issues"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/raisulkhairi/check-post.git"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"author": "Raisul khairi",
|
|
27
|
+
"type": "module",
|
|
28
|
+
"bin": {
|
|
29
|
+
"check-post": "dist/cli.js",
|
|
30
|
+
"checkpost": "dist/cli.js"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"presets"
|
|
35
|
+
],
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=22"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "rm -rf dist && tsc -p tsconfig.json && chmod +x dist/cli.js",
|
|
41
|
+
"dev": "tsx src/cli.tsx",
|
|
42
|
+
"test": "vitest run",
|
|
43
|
+
"prepare": "npm run build",
|
|
44
|
+
"prepublishOnly": "npm test",
|
|
45
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@inquirer/prompts": "8.8.1",
|
|
49
|
+
"commander": "15.1.0",
|
|
50
|
+
"execa": "10.2.1",
|
|
51
|
+
"gray-matter": "4.0.3",
|
|
52
|
+
"ink": "8.0.0",
|
|
53
|
+
"picocolors": "1.1.1",
|
|
54
|
+
"react": "19.3.1",
|
|
55
|
+
"zod": "4.6.7"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/node": "26.6.6",
|
|
59
|
+
"@types/react": "19.3.0",
|
|
60
|
+
"tsx": "4.23.15",
|
|
61
|
+
"typescript": "7.0.2",
|
|
62
|
+
"vite": "8.3.8",
|
|
63
|
+
"vitest": "5.1.1"
|
|
64
|
+
},
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"registry": "https://registry.npmjs.org/",
|
|
67
|
+
"access": "public"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
fail_on: high
|
|
3
|
+
---
|
|
4
|
+
# Secrets & API key
|
|
5
|
+
|
|
6
|
+
Cari kredensial yang di-hardcode di source code yang ikut di-commit:
|
|
7
|
+
- API key, token, password, private key, connection string berisi password
|
|
8
|
+
- URL yang menyertakan kredensial (`https://user:pass@...`)
|
|
9
|
+
- Token JWT atau bearer token yang ditulis langsung
|
|
10
|
+
|
|
11
|
+
Cara kerja:
|
|
12
|
+
1. Pakai Grep dengan pola seperti `api[_-]?key`, `secret`, `token`, `password`, `Bearer `, `-----BEGIN`, `sk_live`, `AKIA`.
|
|
13
|
+
2. Baca konteks setiap hasil untuk memastikan nilainya benar-benar rahasia.
|
|
14
|
+
|
|
15
|
+
Severity:
|
|
16
|
+
- critical: secret asli yang terlihat aktif
|
|
17
|
+
- high: kemungkinan besar secret asli
|
|
18
|
+
- low: placeholder atau contoh (mis. `xxx`, `changeme`, `your-api-key`)
|
|
19
|
+
Abaikan file test, mock, dan fixture kecuali isinya terlihat seperti secret asli.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths: ["src/**/*.ts", "src/**/*.html"]
|
|
3
|
+
fail_on: high
|
|
4
|
+
---
|
|
5
|
+
# XSS audit (Angular)
|
|
6
|
+
|
|
7
|
+
Angular sudah melakukan sanitasi otomatis, jadi fokus pada celah yang melewatinya:
|
|
8
|
+
- Pemakaian `DomSanitizer.bypassSecurityTrustHtml/Url/ResourceUrl/Script/Style` dengan data yang bisa dikontrol user atau API
|
|
9
|
+
- Binding `[innerHTML]`, `[outerHTML]`, `[srcdoc]` berisi data dari user, query param, atau API tanpa sanitasi yang jelas
|
|
10
|
+
- Manipulasi DOM langsung: `ElementRef.nativeElement.innerHTML`, `Renderer2.setProperty(..., 'innerHTML', ...)`, `document.write`, `insertAdjacentHTML`
|
|
11
|
+
- `[href]`/`[src]` yang dibangun dari input user (risiko `javascript:` URL)
|
|
12
|
+
- `eval`, `new Function`, `setTimeout` dengan string
|
|
13
|
+
|
|
14
|
+
Severity:
|
|
15
|
+
- high: data dari user/query param/API mengalir ke salah satu sink di atas tanpa sanitasi
|
|
16
|
+
- medium: sumber data tidak jelas
|
|
17
|
+
- low: data statis/terkontrol penuh
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
fail_on: high
|
|
3
|
+
---
|
|
4
|
+
# Audit konfigurasi environment
|
|
5
|
+
|
|
6
|
+
Jangan pernah membaca isi file env atau file rahasia; cukup gunakan nama variabel.
|
|
7
|
+
Periksa:
|
|
8
|
+
1. File konfigurasi environment yang berisi rahasia tercantum di `.gitignore`.
|
|
9
|
+
2. Tidak ada nilai rahasia (key, token, password) yang di-hardcode sebagai fallback, mis. `process.env.X || "nilai-asli"`.
|
|
10
|
+
3. Variabel yang terekspos ke browser (bundle client) tidak berisi rahasia.
|
|
11
|
+
4. Bila ada file contoh (`.env.example` dsb.), bandingkan nama variabelnya dengan yang dipakai di kode.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
fail_on: medium
|
|
3
|
+
---
|
|
4
|
+
# Code standard
|
|
5
|
+
|
|
6
|
+
Baca dokumen konvensi project bila ada (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `README.md`),
|
|
7
|
+
lalu periksa kode di `src/` terhadap konvensi tersebut.
|
|
8
|
+
|
|
9
|
+
Tambahan aturan umum:
|
|
10
|
+
- Tidak ada tipe `any` yang tidak perlu
|
|
11
|
+
- Tidak ada `console.log` tertinggal di kode produksi
|
|
12
|
+
- Tidak ada kode yang dikomentari dalam blok besar
|
|
13
|
+
|
|
14
|
+
Laporkan maksimal 15 temuan paling penting. Gunakan medium untuk pelanggaran konvensi yang tertulis eksplisit,
|
|
15
|
+
low untuk saran gaya.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
fail_on: high
|
|
3
|
+
---
|
|
4
|
+
# Secrets & API key
|
|
5
|
+
|
|
6
|
+
Cari kredensial yang di-hardcode di source code yang ikut di-commit:
|
|
7
|
+
- API key, token, password, private key, connection string berisi password
|
|
8
|
+
- URL yang menyertakan kredensial (`https://user:pass@...`)
|
|
9
|
+
- Token JWT atau bearer token yang ditulis langsung
|
|
10
|
+
|
|
11
|
+
Cara kerja:
|
|
12
|
+
1. Pakai Grep dengan pola seperti `api[_-]?key`, `secret`, `token`, `password`, `Bearer `, `-----BEGIN`, `sk_live`, `AKIA`.
|
|
13
|
+
2. Baca konteks setiap hasil untuk memastikan nilainya benar-benar rahasia.
|
|
14
|
+
|
|
15
|
+
Severity:
|
|
16
|
+
- critical: secret asli yang terlihat aktif
|
|
17
|
+
- high: kemungkinan besar secret asli
|
|
18
|
+
- low: placeholder atau contoh (mis. `xxx`, `changeme`, `your-api-key`)
|
|
19
|
+
Abaikan file test, mock, dan fixture kecuali isinya terlihat seperti secret asli.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths: ["src/**/*.{ts,tsx,js,jsx}", "app/**/*.{ts,tsx,js,jsx}", "pages/**/*.{ts,tsx,js,jsx}", "components/**/*.{ts,tsx,js,jsx}"]
|
|
3
|
+
fail_on: high
|
|
4
|
+
---
|
|
5
|
+
# XSS audit (React/Next.js)
|
|
6
|
+
|
|
7
|
+
Periksa:
|
|
8
|
+
- `dangerouslySetInnerHTML` berisi data dari user, query string, CMS, atau API tanpa sanitasi (mis. DOMPurify)
|
|
9
|
+
- `href`/`src` yang dibangun dari input user (risiko `javascript:` URL)
|
|
10
|
+
- Data `searchParams`/`params` yang dirender atau dipakai di redirect tanpa validasi
|
|
11
|
+
- `eval`, `new Function`, manipulasi `innerHTML` langsung
|
|
12
|
+
|
|
13
|
+
Severity:
|
|
14
|
+
- high: data tidak tepercaya mengalir ke sink tanpa sanitasi
|
|
15
|
+
- medium: sumber data tidak jelas
|
|
16
|
+
- low: data statis/terkontrol penuh
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
fail_on: high
|
|
3
|
+
---
|
|
4
|
+
# Audit konfigurasi environment
|
|
5
|
+
|
|
6
|
+
Jangan pernah membaca isi file env atau file rahasia; cukup gunakan nama variabel.
|
|
7
|
+
Periksa:
|
|
8
|
+
1. File konfigurasi environment yang berisi rahasia tercantum di `.gitignore`.
|
|
9
|
+
2. Tidak ada nilai rahasia (key, token, password) yang di-hardcode sebagai fallback, mis. `process.env.X || "nilai-asli"`.
|
|
10
|
+
3. Variabel yang terekspos ke browser (bundle client) tidak berisi rahasia.
|
|
11
|
+
4. Bila ada file contoh (`.env.example` dsb.), bandingkan nama variabelnya dengan yang dipakai di kode.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
fail_on: medium
|
|
3
|
+
---
|
|
4
|
+
# Code standard
|
|
5
|
+
|
|
6
|
+
Baca dokumen konvensi project bila ada (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `README.md`),
|
|
7
|
+
lalu periksa kode di `src/` terhadap konvensi tersebut.
|
|
8
|
+
|
|
9
|
+
Tambahan aturan umum:
|
|
10
|
+
- Tidak ada tipe `any` yang tidak perlu
|
|
11
|
+
- Tidak ada `console.log` tertinggal di kode produksi
|
|
12
|
+
- Tidak ada kode yang dikomentari dalam blok besar
|
|
13
|
+
|
|
14
|
+
Laporkan maksimal 15 temuan paling penting. Gunakan medium untuk pelanggaran konvensi yang tertulis eksplisit,
|
|
15
|
+
low untuk saran gaya.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Project ini adalah aplikasi Next.js (React, TypeScript). Abaikan folder `node_modules/`, `.next/`, `out/`, dan `coverage/`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
fail_on: high
|
|
3
|
+
---
|
|
4
|
+
# Secrets & API key
|
|
5
|
+
|
|
6
|
+
Cari kredensial yang di-hardcode di source code yang ikut di-commit:
|
|
7
|
+
- API key, token, password, private key, connection string berisi password
|
|
8
|
+
- URL yang menyertakan kredensial (`https://user:pass@...`)
|
|
9
|
+
- Token JWT atau bearer token yang ditulis langsung
|
|
10
|
+
|
|
11
|
+
Cara kerja:
|
|
12
|
+
1. Pakai Grep dengan pola seperti `api[_-]?key`, `secret`, `token`, `password`, `Bearer `, `-----BEGIN`, `sk_live`, `AKIA`.
|
|
13
|
+
2. Baca konteks setiap hasil untuk memastikan nilainya benar-benar rahasia.
|
|
14
|
+
|
|
15
|
+
Severity:
|
|
16
|
+
- critical: secret asli yang terlihat aktif
|
|
17
|
+
- high: kemungkinan besar secret asli
|
|
18
|
+
- low: placeholder atau contoh (mis. `xxx`, `changeme`, `your-api-key`)
|
|
19
|
+
Abaikan file test, mock, dan fixture kecuali isinya terlihat seperti secret asli.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
fail_on: high
|
|
3
|
+
---
|
|
4
|
+
# Injection audit
|
|
5
|
+
|
|
6
|
+
Periksa:
|
|
7
|
+
- Query SQL/NoSQL yang dibangun dengan string concatenation atau template literal dari input request
|
|
8
|
+
- `child_process.exec`/`execSync` dengan input request
|
|
9
|
+
- Path file dari input request tanpa normalisasi (path traversal)
|
|
10
|
+
- Endpoint tanpa validasi input atau tanpa pemeriksaan otorisasi pada data milik user lain
|
|
11
|
+
|
|
12
|
+
Severity:
|
|
13
|
+
- critical/high: input request mengalir ke sink tanpa validasi
|
|
14
|
+
- medium: validasi ada tetapi lemah
|
|
15
|
+
- low: hardening
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
fail_on: high
|
|
3
|
+
---
|
|
4
|
+
# Audit konfigurasi environment
|
|
5
|
+
|
|
6
|
+
Jangan pernah membaca isi file env atau file rahasia; cukup gunakan nama variabel.
|
|
7
|
+
Periksa:
|
|
8
|
+
1. File konfigurasi environment yang berisi rahasia tercantum di `.gitignore`.
|
|
9
|
+
2. Tidak ada nilai rahasia (key, token, password) yang di-hardcode sebagai fallback, mis. `process.env.X || "nilai-asli"`.
|
|
10
|
+
3. Variabel yang terekspos ke browser (bundle client) tidak berisi rahasia.
|
|
11
|
+
4. Bila ada file contoh (`.env.example` dsb.), bandingkan nama variabelnya dengan yang dipakai di kode.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
fail_on: medium
|
|
3
|
+
---
|
|
4
|
+
# Code standard
|
|
5
|
+
|
|
6
|
+
Baca dokumen konvensi project bila ada (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `README.md`),
|
|
7
|
+
lalu periksa kode di `src/` terhadap konvensi tersebut.
|
|
8
|
+
|
|
9
|
+
Tambahan aturan umum:
|
|
10
|
+
- Tidak ada tipe `any` yang tidak perlu
|
|
11
|
+
- Tidak ada `console.log` tertinggal di kode produksi
|
|
12
|
+
- Tidak ada kode yang dikomentari dalam blok besar
|
|
13
|
+
|
|
14
|
+
Laporkan maksimal 15 temuan paling penting. Gunakan medium untuk pelanggaran konvensi yang tertulis eksplisit,
|
|
15
|
+
low untuk saran gaya.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Project ini adalah aplikasi/API Node.js. Abaikan folder `node_modules/`, `dist/`, `build/`, dan `coverage/`.
|