agentleFS
pranataa-labspranataa-labs/Workflow-Master/skills/security-audit/SKILL.md

security-audit

Skill2 starsChanged 8 days agoMITView on GitHub

Four-phase autonomous security audit (Reconnaissance, Vulnerability Hunting, Proof Validation, Structured Patching) aligned with OWASP Top 10 2021 and ASVS. Includes stack-specific checklists for Laravel, Node/Express/Next.js, React/Vite SPAs, and Python (Flask/FastAPI/Streamlit), dependency audit commands, security header verification, and a findings report template. Use before any release, after adding endpoints, auth, file upload, or payment flows, and whenever the user asks for a security review, pentest-style check, or vulnerability scan.

  • Reads credentials
  • Installs packages

192 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use create-stories, story-done and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • lilangMaxSkill

    create-stories

    Break a single epic into implementable story files. Reads the epic, its GDD, governing ADRs, and control manifest. Each story embeds its GDD requirement TR-ID, ADR guidance, acceptance criteria, story type, and test evidence path. Run after /create-epics for each epic.

    Also in 11 projects that use this

  • lilangMaxSkill

    story-done

    End-of-story completion review. Reads the story file, verifies each acceptance criterion against the implementation, checks for GDD/ADR deviations, prompts code review, updates story status to Complete, and surfaces the next ready story from the sprint.

    Also in 11 projects that use this

  • nicepkgSkill

    community-led-growth

    Expert in community-led growth (CLG) - leveraging user communities to drive acquisition, retention, and expansion. Covers building developer communities, user groups, ambassador programs, and turning customers into advocates. Knows the difference between community as a feature vs community as a growth engine, and how to measure community ROI. Use when "community-led, CLG, ambassador program, champion program, user community, developer community, word of mouth, user group, " mentioned.

    Also in 5 projects that use this

  • nicepkgSkill

    ph-community-outreach

    Engage Reddit, Indie Hackers, Hacker News and other communities for Product Hunt launches. Use this skill to identify relevant communities, craft appropriate posts, and drive cross-platform engagement without appearing spammy.

    Also in 5 projects that use this

  • +7 more from lilangMax
  • +1 more from nicepkg

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 173 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Commit dengan fix(security): <ringkasan>.

    line 125

“Common” is measured: kept by at least 6 in 10 of the 173 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Security Audit

Implementasi prosedural dari protokol audit 4 fase pada Rule 19 Bagian 4 dan baseline Rule 05. Tujuan: menemukan celah nyata dengan nol false positive, lalu menambalnya beserta regression test.

Rule terkait: 05 (Security Baseline), 02 (Backend), 19 §4 (Audit Protocol), 18 (Auth & Session Boundaries).

Batas etika: audit hanya dilakukan pada kode dan lingkungan milik pengguna. Jangan memindai, menyerang, atau menguji sistem pihak ketiga.


Fase 1: Reconnaissance (Pemetaan Permukaan Serangan)

Kumpulkan inventaris sebelum mencari celah.

InventarisCara mendapatkan
Rute dan endpointLaravel: php artisan route:list. Express/Next: cari app.get/post, router., folder app/api, pages/api. FastAPI: @app.get/post.
Middleware auth per ruteTandai rute publik, rute member, rute admin
Titik inputForm, query string, header, cookie, upload file, webhook
Sink berbahayaQuery mentah, eval, exec, shell, render HTML mentah, path file dinamis, redirect dinamis
Secret dan konfigurasi.env, config/, variabel lingkungan di frontend (VITE_*, NEXT_PUBLIC_*)
Dependensipackage.json, composer.json, requirements.txt

Variabel yang berawalan VITE_ atau NEXT_PUBLIC_ selalu terekspos ke browser. Secret di sana dianggap bocor.


Fase 2: Vulnerability Hunting (OWASP Top 10)

OWASPYang diperiksaPola rentan yang dicari
A01 Broken Access ControlIDOR, rute admin tanpa middleware, aksi member oleh tamuOrder::find($id) tanpa cek user_id; findById(req.params.id) tanpa filter pemilik
A02 Cryptographic FailuresHash password, enkripsi, cookiemd5/sha1 untuk password; cookie sesi tanpa HttpOnly, Secure, SameSite
A03 InjectionSQL, NoSQL, command, XSSDB::raw("... $input"), template string di query, {!! $x !!}, dangerouslySetInnerHTML, innerHTML =, subprocess(..., shell=True)
A04 Insecure DesignRate limit, logika bisnisLogin dan OTP tanpa throttle; harga dikirim dari client dan dipercaya server
A05 Security MisconfigurationDebug mode, CORS, headerAPP_DEBUG=true di produksi; Access-Control-Allow-Origin: * dengan credentials; header keamanan tidak ada
A06 Vulnerable ComponentsDependensiHasil npm audit, composer audit, pip-audit level high/critical
A07 Auth FailuresSesi, reset passwordToken reset tidak kedaluwarsa; sesi tidak di-regenerate setelah login; enumerasi user lewat pesan error
A08 Integrity FailuresUpload, deserialisasiUpload tanpa validasi MIME dan ekstensi; file tersimpan di folder publik yang dapat dieksekusi; unserialize/pickle.loads data pengguna
A09 Logging FailuresLogPassword, token, atau data PII tertulis ke log
A10 SSRFFetch URL dari inputfetch(req.body.url), Http::get($request->url) tanpa allowlist

Pemeriksaan Dependensi

npm audit --omit=dev            # Node
composer audit                  # PHP
pip-audit                       # Python (pip install pip-audit di venv)

Pemeriksaan Header (Aplikasi Berjalan)

curl.exe -sI http://localhost:8000 | Select-String "content-security-policy|x-frame-options|x-content-type-options|strict-transport-security|referrer-policy"

Header minimum: Content-Security-Policy, X-Frame-Options: DENY (atau frame-ancestors di CSP), X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin, dan Strict-Transport-Security di HTTPS.

Checklist per Stack

Laravel

  • Semua rute admin di dalam grup auth + middleware role; prefix admin diobfuskasi (Rule 05)
  • Policy/Gate dipakai untuk resource milik user
  • $fillable didefinisikan; tidak ada $guarded = [] pada model sensitif
  • Validasi via FormRequest; upload memakai mimes: dan max:
  • APP_DEBUG=false dan APP_ENV=production untuk rilis

Node / Express / Next.js

  • helmet atau header setara; CORS dengan allowlist origin
  • Validasi body dengan zod/joi; query memakai parameter binding
  • Server Actions dan route handler memeriksa sesi, bukan hanya UI
  • Rate limit pada login, register, reset password

React / Vite SPA

  • Tidak ada secret di bundle (grep folder dist/ untuk sk-, AIza, secret)
  • Tidak ada dangerouslySetInnerHTML untuk data eksternal tanpa sanitasi (DOMPurify)
  • Tautan target="_blank" memakai rel="noreferrer"
  • Pengecekan peran di frontend hanya untuk tampilan; otorisasi tetap di server

Python (Flask / FastAPI / Streamlit)

  • debug=False di produksi; SECRET_KEY dari environment
  • Tidak ada eval, pickle.loads, yaml.load tanpa SafeLoader pada data pengguna
  • Path file divalidasi (cegah ../); upload dibatasi ukuran dan tipe
  • API key model (Gemini, OpenAI) hanya di server, tidak dikirim ke client

Fase 3: Proof Validation (Nol False Positive)

Setiap kandidat temuan wajib divalidasi sebelum dilaporkan:

  1. Lacak aliran data dari source (input pengguna) ke sink (query, HTML, shell, file).
  2. Periksa mitigasi di antaranya: validasi, escape otomatis framework, middleware, ORM binding.
  3. Buktikan dengan salah satu: test otomatis yang mereproduksi, permintaan curl ke lingkungan lokal, atau penjelasan baris demi baris yang menunjukkan tidak ada mitigasi.
  4. Bila mitigasi ada, tandai "bukan celah" dan jangan dilaporkan sebagai temuan.

Penilaian keparahan:

TingkatKriteria
CriticalEksekusi kode jarak jauh, bypass auth penuh, kebocoran secret produksi
HighIDOR pada data sensitif, SQL injection, stored XSS
MediumReflected XSS, CSRF pada aksi non-kritis, header keamanan hilang
LowInformasi versi terekspos, praktik buruk tanpa jalur eksploitasi

Fase 4: Structured Patching

  1. Tambal di baris yang rentan dengan perbaikan minimal dan idiomatis untuk framework tersebut.
  2. Tambahkan regression test yang gagal sebelum tambalan dan lulus sesudahnya (skill verify-and-test).
  3. Jalankan diff-review sebelum commit.
  4. Commit dengan fix(security): <ringkasan>; jangan mencantumkan detail eksploit di pesan commit repo publik.
  5. Bila secret pernah ter-push: rotasi kunci terlebih dahulu, baru bersihkan riwayat.

Laporan

Gunakan template resources/audit-report-template.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.