Security Scan
Run a full security audit of the current codebase. Produce a findings report
that serves as ISO 27001 evidence that the check was performed.
GoConnection context
- ISO 27001 active — findings are not optional suggestions, they are compliance items
- All secrets must be in Azure Key Vault (
goconnection-keyvault, North Europe, RBAC mode)
- Key Vault secret naming:
Section--Key convention (maps to Section:Key in .NET config)
- SQL Server:
Clientes.*, GoConnection.* schemas; OCGoConnection.* via linked server
- Deploy target: SRVGOB (IIS, Windows Server 2019) — no container runtime
- Auth: MSAL/Entra ID for internal apps, JWT for APIs, static tokens for agent iframes
- Stack: .NET 8/10 ASP.NET Core, Razor Pages, Worker Services; Python Flask (GC_Tools only)
Workflow
1. Read before scanning
Before looking for issues, understand what the app does:
- Read README and any docs in
docs/
- Read the entry point (Program.cs, app.py, etc.)
- Read the dependency manifest (.csproj, requirements.txt, package.json)
Do not flag things as issues if you have not understood the context.
2. Scan these areas in order
A. Credentials and secrets
- Any connection string, API key, password, token, or secret in any file
- appsettings.json, app.config, web.config, .env files
- Hardcoded values that look like secrets even in commented-out code
- Check git history awareness: flag if sensitive-looking values are present that should have been caught earlier
B. Authentication and authorisation
- Every HTTP endpoint — is auth enforced?
- Every SignalR hub — is auth enforced?
- Admin or privileged routes — are they restricted correctly?
- Token validation — is it present, is it correct?
C. Input validation and injection
- SQL built by string concatenation anywhere in the codebase
- User-controlled values reaching the filesystem (path traversal)
- User-controlled values reaching external HTTP calls (SSRF)
- Missing input validation on any public endpoint parameter
D. Error handling and logging
- Empty catch blocks on security-relevant operations
- PII (names, CPFs, phone numbers, emails, agent IDs) logged without masking
- Exceptions that reveal internal structure in HTTP responses (stack traces in 500s)
E. Dependencies
- Any dependency that is obviously outdated or has known CVEs
- Dependencies pulled from non-standard sources
- Note: deep CVE analysis is out of scope — flag obvious cases only
F. Configuration and infrastructure
- Config values that belong in Key Vault but are in config files
- CORS policy — is it too broad?
- HTTPS enforcement — is it present?
- Any debug or development flags that could be enabled in production
G. ISO 27001 specific
- Missing audit log entries for state-changing operations (create, update, delete on sensitive data)
- Missing access control on any data that contains PII
- Any data retention or deletion mechanism (or absence of one) for personal data
3. Write the report
Save to docs/security-scan-YYYY-MM-DD.md.
Use this structure:
# Security Scan — [App Name]
**Date:** YYYY-MM-DD
**Repo:** [repo name]
**Scanned by:** Cursor / security-scan skill
---
## Summary
[2–3 sentences: what was scanned, overall posture, how many findings.]
---
## Findings
### CRITICAL
| # | File | Line | Description | Recommended fix |
|---|---|---|---|---|
| C1 | path/to/file.cs | 42 | [what it is] | [what to do] |
### HIGH
| # | File | Line | Description | Recommended fix |
|---|---|---|---|---|
### MEDIUM
| # | File | Line | Description | Recommended fix |
|---|---|---|---|---|
### LOW / INFORMATIONAL
| # | File | Line | Description | Recommended fix |
|---|---|---|---|---|
---
## Clean areas
[List the areas checked where no issues were found. This section is mandatory —
it is evidence that the check was performed, not just that findings were found.]
---
## Recommended next steps
[Ordered list of the top 3–5 actions to take, by priority.]
Severity definitions
| Severity |
Definition |
| Critical |
Exploitable now or exposes credentials/PII directly. Block deploy. |
| High |
Significant risk that is likely to be exploited or cause data loss. Fix before next release. |
| Medium |
Real issue but requires specific conditions or attacker knowledge. Fix in current sprint. |
| Low |
Defence-in-depth or best practice gap. Fix when convenient. |
Rules
- Report file path and line number for every finding — no vague "somewhere in the codebase"
- Do not reproduce credential values — reference by file and line only
- Do not suggest architectural rewrites — findings and fixes should be surgical
- Do not flag things already covered by the global Cursor rules as findings unless
they are actually present in the code
- If unsure whether something is a real vulnerability in this context, include it
at Medium with the uncertainty stated explicitly
- Do not skip the Clean areas section — it is ISO 27001 evidence that the check was performed
- Do not modify source files during the scan
1---2name: security-scan3description: Run a full security audit of the current codebase and produce a dated findings report saved to docs/. Use when the user says "security scan", "run security-scan", "audit this codebase for security issues", or "I need ISO 27001 evidence for this repo". Also triggers before a major release or after a significant feature is merged. Output is a markdown report saved to docs/security-scan-YYYY-MM-DD.md.4---56# Security Scan78Run a full security audit of the current codebase. Produce a findings report9that serves as ISO 27001 evidence that the check was performed.1011## GoConnection context1213- ISO 27001 active — findings are not optional suggestions, they are compliance items14- All secrets must be in Azure Key Vault (`goconnection-keyvault`, North Europe, RBAC mode)15- Key Vault secret naming: `Section--Key` convention (maps to `Section:Key` in .NET config)16- SQL Server: `Clientes.*`, `GoConnection.*` schemas; `OCGoConnection.*` via linked server17- Deploy target: SRVGOB (IIS, Windows Server 2019) — no container runtime18- Auth: MSAL/Entra ID for internal apps, JWT for APIs, static tokens for agent iframes19- Stack: .NET 8/10 ASP.NET Core, Razor Pages, Worker Services; Python Flask (GC_Tools only)2021---2223## Workflow2425### 1. Read before scanning2627Before looking for issues, understand what the app does:28- Read README and any docs in `docs/`29- Read the entry point (Program.cs, app.py, etc.)30- Read the dependency manifest (.csproj, requirements.txt, package.json)3132Do not flag things as issues if you have not understood the context.3334### 2. Scan these areas in order3536**A. Credentials and secrets**37- Any connection string, API key, password, token, or secret in any file38- appsettings.json, app.config, web.config, .env files39- Hardcoded values that look like secrets even in commented-out code40- Check git history awareness: flag if sensitive-looking values are present that should have been caught earlier4142**B. Authentication and authorisation**43- Every HTTP endpoint — is auth enforced?44- Every SignalR hub — is auth enforced?45- Admin or privileged routes — are they restricted correctly?46- Token validation — is it present, is it correct?4748**C. Input validation and injection**49- SQL built by string concatenation anywhere in the codebase50- User-controlled values reaching the filesystem (path traversal)51- User-controlled values reaching external HTTP calls (SSRF)52- Missing input validation on any public endpoint parameter5354**D. Error handling and logging**55- Empty catch blocks on security-relevant operations56- PII (names, CPFs, phone numbers, emails, agent IDs) logged without masking57- Exceptions that reveal internal structure in HTTP responses (stack traces in 500s)5859**E. Dependencies**60- Any dependency that is obviously outdated or has known CVEs61- Dependencies pulled from non-standard sources62- Note: deep CVE analysis is out of scope — flag obvious cases only6364**F. Configuration and infrastructure**65- Config values that belong in Key Vault but are in config files66- CORS policy — is it too broad?67- HTTPS enforcement — is it present?68- Any debug or development flags that could be enabled in production6970**G. ISO 27001 specific**71- Missing audit log entries for state-changing operations (create, update, delete on sensitive data)72- Missing access control on any data that contains PII73- Any data retention or deletion mechanism (or absence of one) for personal data7475### 3. Write the report7677Save to `docs/security-scan-YYYY-MM-DD.md`.7879Use this structure:8081```markdown82# Security Scan — [App Name]83**Date:** YYYY-MM-DD 84**Repo:** [repo name] 85**Scanned by:** Cursor / security-scan skill 8687---8889## Summary9091[2–3 sentences: what was scanned, overall posture, how many findings.]9293---9495## Findings9697### CRITICAL9899| # | File | Line | Description | Recommended fix |100|---|---|---|---|---|101| C1 | path/to/file.cs | 42 | [what it is] | [what to do] |102103### HIGH104105| # | File | Line | Description | Recommended fix |106|---|---|---|---|---|107108### MEDIUM109110| # | File | Line | Description | Recommended fix |111|---|---|---|---|---|112113### LOW / INFORMATIONAL114115| # | File | Line | Description | Recommended fix |116|---|---|---|---|---|117118---119120## Clean areas121122[List the areas checked where no issues were found. This section is mandatory —123it is evidence that the check was performed, not just that findings were found.]124125---126127## Recommended next steps128129[Ordered list of the top 3–5 actions to take, by priority.]130```131132---133134## Severity definitions135136| Severity | Definition |137|---|---|138| **Critical** | Exploitable now or exposes credentials/PII directly. Block deploy. |139| **High** | Significant risk that is likely to be exploited or cause data loss. Fix before next release. |140| **Medium** | Real issue but requires specific conditions or attacker knowledge. Fix in current sprint. |141| **Low** | Defence-in-depth or best practice gap. Fix when convenient. |142143---144145## Rules146147- Report file path and line number for every finding — no vague "somewhere in the codebase"148- Do not reproduce credential values — reference by file and line only149- Do not suggest architectural rewrites — findings and fixes should be surgical150- Do not flag things already covered by the global Cursor rules as findings unless151 they are actually present in the code152- If unsure whether something is a real vulnerability in this context, include it153 at Medium with the uncertainty stated explicitly154- Do not skip the Clean areas section — it is ISO 27001 evidence that the check was performed155- Do not modify source files during the scan