@neuralaxis/vibedoctor 0.1.3 → 0.2.1

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.
Files changed (112) hide show
  1. package/README.md +298 -115
  2. package/dist/adapters/biome.js +135 -21
  3. package/dist/adapters/dpdp.d.ts +6 -0
  4. package/dist/adapters/dpdp.js +34 -0
  5. package/dist/adapters/index.d.ts +1 -0
  6. package/dist/adapters/index.js +3 -1
  7. package/dist/adapters/osvScanner.js +136 -17
  8. package/dist/adapters/presidio.js +6 -2
  9. package/dist/adapters/privacyDetector.d.ts +24 -1
  10. package/dist/adapters/privacyDetector.js +86 -2
  11. package/dist/adapters/shared.d.ts +6 -0
  12. package/dist/agentPack/templates/skills.js +159 -53
  13. package/dist/cli/commands/dpdp.d.ts +35 -0
  14. package/dist/cli/commands/dpdp.js +103 -0
  15. package/dist/cli/commands/init.js +105 -50
  16. package/dist/cli/commands/privacyReview.js +3 -4
  17. package/dist/cli/commands/scan.js +4 -1
  18. package/dist/cli/commands/setup.d.ts +13 -17
  19. package/dist/cli/commands/setup.js +138 -200
  20. package/dist/cli/index.js +84 -0
  21. package/dist/core/capability.d.ts +92 -0
  22. package/dist/core/capability.js +122 -0
  23. package/dist/core/config.d.ts +57 -0
  24. package/dist/core/config.js +194 -7
  25. package/dist/core/credentialHeuristics.d.ts +28 -0
  26. package/dist/core/credentialHeuristics.js +179 -0
  27. package/dist/core/engine.d.ts +21 -0
  28. package/dist/core/engine.js +484 -84
  29. package/dist/core/executable.d.ts +18 -0
  30. package/dist/core/executable.js +137 -0
  31. package/dist/core/fileRole.d.ts +24 -0
  32. package/dist/core/fileRole.js +125 -0
  33. package/dist/core/finding.d.ts +125 -1
  34. package/dist/core/finding.js +63 -5
  35. package/dist/core/findingNormalizer.d.ts +33 -0
  36. package/dist/core/findingNormalizer.js +171 -0
  37. package/dist/core/projectDetector.d.ts +13 -0
  38. package/dist/core/projectDetector.js +100 -15
  39. package/dist/core/relevance.d.ts +87 -0
  40. package/dist/core/relevance.js +367 -0
  41. package/dist/core/scanPlanner.d.ts +12 -0
  42. package/dist/core/scanPlanner.js +61 -29
  43. package/dist/core/semverLite.d.ts +27 -0
  44. package/dist/core/semverLite.js +163 -0
  45. package/dist/core/suppressions.d.ts +96 -0
  46. package/dist/core/suppressions.js +302 -0
  47. package/dist/core/toolRegistry.d.ts +58 -0
  48. package/dist/core/toolRegistry.js +247 -0
  49. package/dist/core/toolRunner.d.ts +23 -2
  50. package/dist/core/toolRunner.js +61 -93
  51. package/dist/core/toolVerification.d.ts +87 -0
  52. package/dist/core/toolVerification.js +370 -0
  53. package/dist/dpdp/artifacts.d.ts +11 -0
  54. package/dist/dpdp/artifacts.js +120 -0
  55. package/dist/dpdp/catalogue.d.ts +14 -0
  56. package/dist/dpdp/catalogue.js +661 -0
  57. package/dist/dpdp/collectors/confidence.d.ts +9 -0
  58. package/dist/dpdp/collectors/confidence.js +25 -0
  59. package/dist/dpdp/collectors/dependencies.d.ts +7 -0
  60. package/dist/dpdp/collectors/dependencies.js +63 -0
  61. package/dist/dpdp/collectors/index.d.ts +24 -0
  62. package/dist/dpdp/collectors/index.js +71 -0
  63. package/dist/dpdp/collectors/lifecycle.d.ts +2 -0
  64. package/dist/dpdp/collectors/lifecycle.js +202 -0
  65. package/dist/dpdp/collectors/optionalScanners.d.ts +14 -0
  66. package/dist/dpdp/collectors/optionalScanners.js +437 -0
  67. package/dist/dpdp/collectors/privacyBridge.d.ts +13 -0
  68. package/dist/dpdp/collectors/privacyBridge.js +152 -0
  69. package/dist/dpdp/collectors/safeguards.d.ts +5 -0
  70. package/dist/dpdp/collectors/safeguards.js +186 -0
  71. package/dist/dpdp/collectors/schema.d.ts +6 -0
  72. package/dist/dpdp/collectors/schema.js +122 -0
  73. package/dist/dpdp/collectors/shared.d.ts +10 -0
  74. package/dist/dpdp/collectors/shared.js +43 -0
  75. package/dist/dpdp/context.d.ts +28 -0
  76. package/dist/dpdp/context.js +195 -0
  77. package/dist/dpdp/dataMap.d.ts +7 -0
  78. package/dist/dpdp/dataMap.js +339 -0
  79. package/dist/dpdp/evaluators.d.ts +20 -0
  80. package/dist/dpdp/evaluators.js +522 -0
  81. package/dist/dpdp/evidence.d.ts +11 -0
  82. package/dist/dpdp/evidence.js +123 -0
  83. package/dist/dpdp/findings.d.ts +44 -0
  84. package/dist/dpdp/findings.js +286 -0
  85. package/dist/dpdp/gates.d.ts +14 -0
  86. package/dist/dpdp/gates.js +47 -0
  87. package/dist/dpdp/index.d.ts +16 -0
  88. package/dist/dpdp/index.js +32 -0
  89. package/dist/dpdp/legalSources.d.ts +10 -0
  90. package/dist/dpdp/legalSources.js +104 -0
  91. package/dist/dpdp/paths.d.ts +25 -0
  92. package/dist/dpdp/paths.js +85 -0
  93. package/dist/dpdp/report.d.ts +6 -0
  94. package/dist/dpdp/report.js +222 -0
  95. package/dist/dpdp/reviewQueue.d.ts +3 -0
  96. package/dist/dpdp/reviewQueue.js +88 -0
  97. package/dist/dpdp/scan.d.ts +26 -0
  98. package/dist/dpdp/scan.js +310 -0
  99. package/dist/dpdp/scoring.d.ts +41 -0
  100. package/dist/dpdp/scoring.js +237 -0
  101. package/dist/dpdp/types.d.ts +312 -0
  102. package/dist/dpdp/types.js +86 -0
  103. package/dist/index.d.ts +1 -0
  104. package/dist/index.js +1 -0
  105. package/dist/mcp/tools/dpdp.d.ts +11 -0
  106. package/dist/mcp/tools/dpdp.js +151 -0
  107. package/dist/mcp/tools/index.js +3 -1
  108. package/dist/reporters/html.js +57 -13
  109. package/dist/reporters/json.js +12 -1
  110. package/dist/reporters/markdown.js +46 -4
  111. package/dist/reporters/sarif.js +54 -5
  112. package/package.json +4 -1
@@ -0,0 +1,661 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DPDP_CATALOGUE_META = exports.DPDP_CONTROLS = void 0;
4
+ exports.getControlById = getControlById;
5
+ exports.controlsByDomain = controlsByDomain;
6
+ exports.controlsForVerificationClass = controlsForVerificationClass;
7
+ const legalSources_1 = require("./legalSources");
8
+ const SV = legalSources_1.LEGAL_SOURCE_MANIFEST_VERSION;
9
+ const ALL_STATUS = [
10
+ "VERIFIED",
11
+ "VIOLATED",
12
+ "PARTIAL",
13
+ "NOT_OBSERVED",
14
+ "NEEDS_CONTEXT",
15
+ "NOT_APPLICABLE",
16
+ "SKIPPED",
17
+ "ERROR"
18
+ ];
19
+ function control(partial) {
20
+ return {
21
+ possibleStatuses: ALL_STATUS,
22
+ sourceVersion: SV,
23
+ ...partial
24
+ };
25
+ }
26
+ /**
27
+ * Machine-readable DPDP obligation catalogue for technical readiness assessment.
28
+ * Every control has verification class, legal reference, and evaluator linkage where deterministic.
29
+ */
30
+ exports.DPDP_CONTROLS = [
31
+ control({
32
+ id: "DPDP-APP-001",
33
+ title: "Personal data processing inventory from code",
34
+ domain: "applicability_and_inventory",
35
+ technicalIntent: "Identify whether the codebase appears to collect, store, or transmit personal data.",
36
+ legalSourceIds: ["DPDP-ACT-2023"],
37
+ legalCitations: ["Section 2 (definitions)", "Section 3 (application)"],
38
+ applicability: { when: "Always for application codebases", requiresPersonalData: false },
39
+ verificationClass: "DETERMINISTIC",
40
+ evidenceRequirements: ["Detected personal-data categories, fields, or collection points"],
41
+ evaluatorId: "inventory-personal-data",
42
+ severityRules: { defaultSeverity: "info", violatedSeverity: "medium", partialSeverity: "low" },
43
+ limitations: ["Cannot prove absence of personal data outside scanned paths"],
44
+ remediation: "Document data categories and ensure inventory matches implementation surfaces.",
45
+ humanReviewQuestions: ["Does the product process personal data outside this repository?"]
46
+ }),
47
+ control({
48
+ id: "DPDP-APP-002",
49
+ title: "Applicability determination requires organisational context",
50
+ domain: "exemptions_and_applicability",
51
+ technicalIntent: "Flag when legal applicability cannot be established from code alone.",
52
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-ENFORCEMENT-NOTIFICATION"],
53
+ legalCitations: ["Section 3", "Section 17", "Enforcement notification"],
54
+ applicability: { when: "Always" },
55
+ verificationClass: "HUMAN_REVIEW",
56
+ evidenceRequirements: ["Declared organisation context or legal determination"],
57
+ severityRules: { defaultSeverity: "info", violatedSeverity: "info" },
58
+ limitations: ["Legal applicability is not a code property"],
59
+ remediation: "Record organisation context in .vibedoctor/dpdp/context.yml and obtain legal review where needed.",
60
+ humanReviewQuestions: [
61
+ "Is the organisation a Data Fiduciary under DPDP for this processing?",
62
+ "Do any statutory exemptions apply?"
63
+ ]
64
+ }),
65
+ control({
66
+ id: "DPDP-NOTICE-001",
67
+ title: "Notice presentation technical signal",
68
+ domain: "notice",
69
+ technicalIntent: "Detect implementation signals for privacy notice / notice versioning.",
70
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
71
+ legalCitations: ["Section 5", "Rules: Notice requirements"],
72
+ applicability: { when: "When personal data is collected", requiresPersonalData: true },
73
+ verificationClass: "TECHNICAL_SIGNAL",
74
+ evidenceRequirements: ["Notice templates, notice version fields, privacy policy routes"],
75
+ evaluatorId: "notice-signals",
76
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
77
+ limitations: ["Notice adequacy and language quality require human review"],
78
+ remediation: "Implement notice delivery at collection points with version tracking.",
79
+ humanReviewQuestions: ["Is the notice itemised, clear, and presented before or at collection?"]
80
+ }),
81
+ control({
82
+ id: "DPDP-CONSENT-001",
83
+ title: "Consent capture implementation",
84
+ domain: "consent",
85
+ technicalIntent: "Detect consent capture APIs, flags, or records in code/schema.",
86
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
87
+ legalCitations: ["Section 6"],
88
+ applicability: { when: "When processing relies on consent", requiresPersonalData: true },
89
+ verificationClass: "TECHNICAL_SIGNAL",
90
+ evidenceRequirements: ["Consent fields, endpoints, or SDKs"],
91
+ evaluatorId: "consent-capture",
92
+ severityRules: { defaultSeverity: "high", violatedSeverity: "high", partialSeverity: "medium" },
93
+ limitations: ["Cannot verify free, specific, informed, unconditional consent quality"],
94
+ remediation: "Implement explicit consent capture with purpose binding before processing.",
95
+ humanReviewQuestions: ["Is consent free, specific, informed, unconditional and unambiguous?"]
96
+ }),
97
+ control({
98
+ id: "DPDP-CONSENT-002",
99
+ title: "Consent metadata completeness",
100
+ domain: "consent",
101
+ technicalIntent: "Require timestamp, purpose identifier, and notice version when consent is stored.",
102
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
103
+ legalCitations: ["Section 6", "Rules: consent records"],
104
+ applicability: { when: "When consent capture signals exist", requiresPersonalData: true },
105
+ verificationClass: "DETERMINISTIC",
106
+ evidenceRequirements: ["Consent model fields for timestamp, purpose, notice version"],
107
+ evaluatorId: "consent-metadata",
108
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
109
+ limitations: ["Schema signals may not reflect runtime consent manager behaviour"],
110
+ remediation: "Store consent_given_at, purpose_id, and notice_version with each consent record.",
111
+ humanReviewQuestions: ["Who is the system of record for consent proofs?"]
112
+ }),
113
+ control({
114
+ id: "DPDP-WITHDRAW-001",
115
+ title: "Consent withdrawal path",
116
+ domain: "withdrawal",
117
+ technicalIntent: "Detect withdrawal/opt-out endpoints or equivalent flows.",
118
+ legalSourceIds: ["DPDP-ACT-2023"],
119
+ legalCitations: ["Section 6(4)"],
120
+ applicability: { when: "When consent-based processing is present", requiresPersonalData: true },
121
+ verificationClass: "TECHNICAL_SIGNAL",
122
+ evidenceRequirements: ["Withdrawal endpoints, unsubscribe, revoke consent handlers"],
123
+ evaluatorId: "consent-withdrawal",
124
+ severityRules: { defaultSeverity: "high", violatedSeverity: "high", partialSeverity: "medium" },
125
+ limitations: ["Ease of withdrawal relative to grant requires UX review"],
126
+ remediation: "Provide a withdrawal API/UI that is as easy as giving consent and propagates to processors.",
127
+ humanReviewQuestions: ["Can a Data Principal withdraw consent as easily as they gave it?"]
128
+ }),
129
+ control({
130
+ id: "DPDP-PURPOSE-001",
131
+ title: "Purpose identifier technical binding",
132
+ domain: "purpose_limitation",
133
+ technicalIntent: "Detect purpose identifiers bound to collection or consent records.",
134
+ legalSourceIds: ["DPDP-ACT-2023"],
135
+ legalCitations: ["Section 4", "Section 6", "Section 8"],
136
+ applicability: { when: "When personal data is processed", requiresPersonalData: true },
137
+ verificationClass: "TECHNICAL_SIGNAL",
138
+ evidenceRequirements: ["purpose_id fields, purpose enums, purpose-tagged pipelines"],
139
+ evaluatorId: "purpose-binding",
140
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
141
+ limitations: ["Secondary use policies cannot be fully validated statically"],
142
+ remediation: "Tag processing pipelines and consent with purpose identifiers and enforce purpose checks.",
143
+ humanReviewQuestions: ["Are purposes limited to those disclosed at collection?"]
144
+ }),
145
+ control({
146
+ id: "DPDP-MIN-001",
147
+ title: "API over-fetching of personal data objects",
148
+ domain: "data_minimisation",
149
+ technicalIntent: "Detect whole user/customer objects returned from APIs without projection.",
150
+ legalSourceIds: ["DPDP-ACT-2023"],
151
+ legalCitations: ["Section 8 (data minimisation principle via fiduciary duties)"],
152
+ applicability: { when: "When personal data APIs exist", requiresPersonalData: true },
153
+ verificationClass: "DETERMINISTIC",
154
+ evidenceRequirements: ["API handlers serialising full user objects"],
155
+ evaluatorId: "api-overfetch",
156
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium" },
157
+ limitations: ["Cannot prove field necessity for every business case"],
158
+ remediation: "Return DTOs with explicit field selection rather than whole entities.",
159
+ humanReviewQuestions: ["Is each returned field necessary for the stated purpose?"]
160
+ }),
161
+ control({
162
+ id: "DPDP-MIN-002",
163
+ title: "Broad database selection of personal records",
164
+ domain: "data_minimisation",
165
+ technicalIntent: "Detect SELECT * or unscoped findMany on personal-data models.",
166
+ legalSourceIds: ["DPDP-ACT-2023"],
167
+ legalCitations: ["Section 8"],
168
+ applicability: { when: "When ORM/SQL access to personal data exists", requiresPersonalData: true },
169
+ verificationClass: "TECHNICAL_SIGNAL",
170
+ evidenceRequirements: ["Broad query patterns on user/customer models"],
171
+ evaluatorId: "broad-db-select",
172
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
173
+ limitations: ["Some admin tooling legitimately needs broad reads"],
174
+ remediation: "Scope queries and project only required columns for each use case.",
175
+ humanReviewQuestions: ["Which roles need full-record access and why?"]
176
+ }),
177
+ control({
178
+ id: "DPDP-ACC-001",
179
+ title: "Accuracy and correction technical path",
180
+ domain: "accuracy",
181
+ technicalIntent: "Detect correction/update endpoints for personal data profiles.",
182
+ legalSourceIds: ["DPDP-ACT-2023"],
183
+ legalCitations: ["Section 12"],
184
+ applicability: { when: "When personal data is stored", requiresPersonalData: true },
185
+ verificationClass: "TECHNICAL_SIGNAL",
186
+ evidenceRequirements: ["Profile update/correction routes"],
187
+ evaluatorId: "correction-path",
188
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
189
+ limitations: ["Downstream processor propagation not fully visible"],
190
+ remediation: "Implement authenticated correction flows and cascade updates to processors.",
191
+ humanReviewQuestions: ["How are inaccurate records corrected across processors?"]
192
+ }),
193
+ control({
194
+ id: "DPDP-SEC-001",
195
+ title: "PII in application logs",
196
+ domain: "security_safeguards",
197
+ technicalIntent: "Detect unsanitized personal data written to logs.",
198
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
199
+ legalCitations: ["Section 8", "Rules: reasonable security safeguards"],
200
+ applicability: { when: "When personal data is processed", requiresPersonalData: true },
201
+ verificationClass: "DETERMINISTIC",
202
+ evidenceRequirements: ["Logger calls with PII keywords or values"],
203
+ evaluatorId: "pii-in-logs",
204
+ severityRules: { defaultSeverity: "high", violatedSeverity: "high" },
205
+ limitations: ["Dynamic log payloads may evade static detection"],
206
+ remediation: "Redact or structure-log with allowlists; never log raw identifiers.",
207
+ humanReviewQuestions: ["What is the log retention and access control policy?"]
208
+ }),
209
+ control({
210
+ id: "DPDP-SEC-002",
211
+ title: "PII in LLM prompts or embeddings",
212
+ domain: "security_safeguards",
213
+ technicalIntent: "Detect personal data sent to LLM APIs, prompts, or vector stores.",
214
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
215
+ legalCitations: ["Section 8", "Section 16"],
216
+ applicability: { when: "When LLM or embedding integrations exist", requiresPersonalData: true },
217
+ verificationClass: "DETERMINISTIC",
218
+ evidenceRequirements: ["Prompt construction with user fields; embedding upserts of personal text"],
219
+ evaluatorId: "pii-in-llm",
220
+ severityRules: { defaultSeverity: "high", violatedSeverity: "critical" },
221
+ limitations: ["Runtime prompt assembly may be indirect"],
222
+ remediation: "Minimise/redact PII before model calls; document processor terms for AI vendors.",
223
+ humanReviewQuestions: ["Are LLM providers acting as processors under contract?"]
224
+ }),
225
+ control({
226
+ id: "DPDP-SEC-003",
227
+ title: "PII in URLs or query strings",
228
+ domain: "security_safeguards",
229
+ technicalIntent: "Detect personal data placed in URL paths or query parameters.",
230
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
231
+ legalCitations: ["Section 8"],
232
+ applicability: { when: "When HTTP APIs handle personal data", requiresPersonalData: true },
233
+ verificationClass: "DETERMINISTIC",
234
+ evidenceRequirements: ["Route templates or URL builders with email/phone/aadhaar tokens"],
235
+ evaluatorId: "pii-in-urls",
236
+ severityRules: { defaultSeverity: "high", violatedSeverity: "high" },
237
+ limitations: ["Server logs of URLs may still capture PII even if code is fixed later"],
238
+ remediation: "Move identifiers into authenticated request bodies or opaque tokens.",
239
+ humanReviewQuestions: ["Are access logs scrubbed of query-string PII?"]
240
+ }),
241
+ control({
242
+ id: "DPDP-SEC-004",
243
+ title: "Browser storage of personal data",
244
+ domain: "security_safeguards",
245
+ technicalIntent: "Detect localStorage/sessionStorage/cookie storage of personal data.",
246
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
247
+ legalCitations: ["Section 8"],
248
+ applicability: { when: "When client-side storage is used", requiresPersonalData: true },
249
+ verificationClass: "DETERMINISTIC",
250
+ evidenceRequirements: ["Browser storage writes of email/phone/tokens with PII"],
251
+ evaluatorId: "browser-storage-pii",
252
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "high", partialSeverity: "medium" },
253
+ limitations: ["HttpOnly cookie policy requires runtime/config review"],
254
+ remediation: "Avoid storing raw PII in browser storage; prefer short-lived opaque session tokens.",
255
+ humanReviewQuestions: ["What is the XSS residual risk for client-stored personal data?"]
256
+ }),
257
+ control({
258
+ id: "DPDP-SEC-005",
259
+ title: "Insecure HTTP transmission of personal data",
260
+ domain: "security_safeguards",
261
+ technicalIntent: "Detect cleartext HTTP endpoints used with personal-data APIs.",
262
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
263
+ legalCitations: ["Section 8", "Rules: security safeguards"],
264
+ applicability: { when: "When network transmission of personal data exists", requiresPersonalData: true },
265
+ verificationClass: "DETERMINISTIC",
266
+ evidenceRequirements: ["http:// URLs for APIs handling personal data"],
267
+ evaluatorId: "insecure-http",
268
+ severityRules: { defaultSeverity: "high", violatedSeverity: "critical" },
269
+ limitations: ["TLS termination outside repo is not visible"],
270
+ remediation: "Use HTTPS for all personal-data transport; enforce HSTS where applicable.",
271
+ humanReviewQuestions: ["Is TLS terminated and re-encrypted correctly in production?"]
272
+ }),
273
+ control({
274
+ id: "DPDP-SEC-006",
275
+ title: "Authentication on personal-data routes",
276
+ domain: "security_safeguards",
277
+ technicalIntent: "Detect personal-data routes lacking auth middleware signals.",
278
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
279
+ legalCitations: ["Section 8"],
280
+ applicability: { when: "When personal-data routes exist", requiresPersonalData: true },
281
+ verificationClass: "TECHNICAL_SIGNAL",
282
+ evidenceRequirements: ["Route definitions with/without auth middleware"],
283
+ evaluatorId: "route-auth",
284
+ severityRules: { defaultSeverity: "high", violatedSeverity: "critical", partialSeverity: "high" },
285
+ limitations: ["Framework-global auth guards may be invisible to local patterns"],
286
+ remediation: "Apply authentication and authorisation middleware to all personal-data endpoints.",
287
+ humanReviewQuestions: ["Is object-level authorisation enforced for every principal resource?"]
288
+ }),
289
+ control({
290
+ id: "DPDP-SEC-007",
291
+ title: "Hardcoded production personal data or sensitive fixtures",
292
+ domain: "security_safeguards",
293
+ technicalIntent: "Detect high-confidence identifier values embedded in source/fixtures.",
294
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
295
+ legalCitations: ["Section 8"],
296
+ applicability: { when: "Always when personal data values appear in repo", requiresPersonalData: true },
297
+ verificationClass: "DETERMINISTIC",
298
+ evidenceRequirements: ["Regulated identifiers or realistic PII values in code"],
299
+ evaluatorId: "hardcoded-pii",
300
+ severityRules: { defaultSeverity: "high", violatedSeverity: "high" },
301
+ limitations: ["Synthetic test data may look real"],
302
+ remediation: "Replace with clearly synthetic fixtures; never commit production personal data.",
303
+ humanReviewQuestions: ["Are any committed values real production identifiers?"]
304
+ }),
305
+ control({
306
+ id: "DPDP-SEC-008",
307
+ title: "Debug endpoints exposing personal records",
308
+ domain: "security_safeguards",
309
+ technicalIntent: "Detect debug/admin dump endpoints returning user records.",
310
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
311
+ legalCitations: ["Section 8"],
312
+ applicability: { when: "When debug routes exist near personal data", requiresPersonalData: true },
313
+ verificationClass: "DETERMINISTIC",
314
+ evidenceRequirements: ["debug/dump routes returning users"],
315
+ evaluatorId: "debug-exposure",
316
+ severityRules: { defaultSeverity: "critical", violatedSeverity: "critical" },
317
+ limitations: ["Environment gating may not be visible statically"],
318
+ remediation: "Remove or strictly gate debug endpoints; never expose personal dumps in production.",
319
+ humanReviewQuestions: ["Are debug routes disabled in production deployments?"]
320
+ }),
321
+ control({
322
+ id: "DPDP-SEC-009",
323
+ title: "Weak or reversible masking of identifiers",
324
+ domain: "security_safeguards",
325
+ technicalIntent: "Detect trivial masking that preserves most of the identifier.",
326
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
327
+ legalCitations: ["Section 8"],
328
+ applicability: { when: "When masking helpers exist", requiresPersonalData: true },
329
+ verificationClass: "TECHNICAL_SIGNAL",
330
+ evidenceRequirements: ["Masking functions that only hide 1-2 characters"],
331
+ evaluatorId: "weak-masking",
332
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium" },
333
+ limitations: ["Context-specific display masking may be acceptable"],
334
+ remediation: "Use irreversible hashing or strong partial masking for logs and non-essential displays.",
335
+ humanReviewQuestions: ["Is masking used for security or only for display convenience?"]
336
+ }),
337
+ control({
338
+ id: "DPDP-SEC-010",
339
+ title: "Missing audit signals on sensitive personal-data operations",
340
+ domain: "security_safeguards",
341
+ technicalIntent: "Detect export/delete/admin personal-data operations without audit logging signals.",
342
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
343
+ legalCitations: ["Section 8", "Section 10"],
344
+ applicability: { when: "When sensitive personal-data operations exist", requiresPersonalData: true },
345
+ verificationClass: "TECHNICAL_SIGNAL",
346
+ evidenceRequirements: ["Sensitive ops with/without audit trail calls"],
347
+ evaluatorId: "audit-signals",
348
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
349
+ limitations: ["External SIEM integration may not appear in app code"],
350
+ remediation: "Emit immutable audit events for access, export, correction, deletion, and admin overrides.",
351
+ humanReviewQuestions: ["Where are audit logs retained and who can access them?"]
352
+ }),
353
+ control({
354
+ id: "DPDP-BREACH-001",
355
+ title: "Personal-data breach preparedness signals",
356
+ domain: "breach_preparedness",
357
+ technicalIntent: "Detect incident/breach runbooks, alerting hooks, or notification templates.",
358
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
359
+ legalCitations: ["Section 8", "Rules: personal data breach"],
360
+ applicability: { when: "When personal data is processed", requiresPersonalData: true },
361
+ verificationClass: "TECHNICAL_SIGNAL",
362
+ evidenceRequirements: ["breach/incident handlers, runbooks, notification templates"],
363
+ evaluatorId: "breach-preparedness",
364
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
365
+ limitations: ["Operational readiness cannot be proven from code alone"],
366
+ remediation: "Implement breach detection hooks and documented notification workflows.",
367
+ humanReviewQuestions: ["Is there a tested personal-data breach response plan with timelines?"]
368
+ }),
369
+ control({
370
+ id: "DPDP-RET-001",
371
+ title: "Retention or TTL mechanism for personal data stores",
372
+ domain: "retention",
373
+ technicalIntent: "Detect retention fields, TTL, or lifecycle configs on personal-data stores.",
374
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
375
+ legalCitations: ["Section 8", "Rules: retention"],
376
+ applicability: { when: "When personal data is stored", requiresPersonalData: true },
377
+ verificationClass: "DETERMINISTIC",
378
+ evidenceRequirements: ["deletedAt/expiresAt/TTL/lifecycle config on PII stores"],
379
+ evaluatorId: "retention-mechanism",
380
+ severityRules: { defaultSeverity: "high", violatedSeverity: "high", partialSeverity: "medium" },
381
+ limitations: ["Policy periods vs technical TTL need human alignment"],
382
+ remediation: "Add retention fields and scheduled deletion jobs matching purpose-limited periods.",
383
+ humanReviewQuestions: ["What is the lawful retention period for each purpose?"]
384
+ }),
385
+ control({
386
+ id: "DPDP-ERA-001",
387
+ title: "Erasure / account deletion path",
388
+ domain: "erasure",
389
+ technicalIntent: "Detect hard/soft delete and account deletion flows for personal data.",
390
+ legalSourceIds: ["DPDP-ACT-2023"],
391
+ legalCitations: ["Section 12"],
392
+ applicability: { when: "When personal data is stored", requiresPersonalData: true },
393
+ verificationClass: "DETERMINISTIC",
394
+ evidenceRequirements: ["delete account endpoints, hard delete, soft delete"],
395
+ evaluatorId: "erasure-path",
396
+ severityRules: { defaultSeverity: "high", violatedSeverity: "high", partialSeverity: "medium" },
397
+ limitations: ["Backups and processor erasure lag may be invisible"],
398
+ remediation: "Implement verified erasure including backups/processors within stated timelines.",
399
+ humanReviewQuestions: ["How are backups and processor copies erased after a request?"]
400
+ }),
401
+ control({
402
+ id: "DPDP-ERA-002",
403
+ title: "Retained personal data without visible deletion path",
404
+ domain: "erasure",
405
+ technicalIntent: "Flag personal-data storage without any deletion/TTL/erasure signals.",
406
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
407
+ legalCitations: ["Section 8", "Section 12"],
408
+ applicability: { when: "When personal data stores exist", requiresPersonalData: true },
409
+ verificationClass: "DETERMINISTIC",
410
+ evidenceRequirements: ["PII stores vs deletion signals"],
411
+ evaluatorId: "storage-without-deletion",
412
+ severityRules: { defaultSeverity: "high", violatedSeverity: "high" },
413
+ limitations: ["External data warehouses may hold copies"],
414
+ remediation: "Ensure every personal-data store has a documented and implemented deletion path.",
415
+ humanReviewQuestions: ["Is any personal data kept indefinitely for legal holds?"]
416
+ }),
417
+ control({
418
+ id: "DPDP-ACC-RIGHT-001",
419
+ title: "Data Principal access / export endpoint",
420
+ domain: "data_principal_access",
421
+ technicalIntent: "Detect data export/access/download-my-data endpoints.",
422
+ legalSourceIds: ["DPDP-ACT-2023"],
423
+ legalCitations: ["Section 11"],
424
+ applicability: { when: "When personal data is stored", requiresPersonalData: true },
425
+ verificationClass: "TECHNICAL_SIGNAL",
426
+ evidenceRequirements: ["export/access/download routes"],
427
+ evaluatorId: "access-export",
428
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
429
+ limitations: ["Completeness of export packages needs review"],
430
+ remediation: "Provide authenticated access/export of personal data held by the fiduciary.",
431
+ humanReviewQuestions: ["Does the export include all purposes and processors?"]
432
+ }),
433
+ control({
434
+ id: "DPDP-CORR-001",
435
+ title: "Correction request implementation",
436
+ domain: "correction",
437
+ technicalIntent: "Detect correction request workflows distinct from generic profile edits where present.",
438
+ legalSourceIds: ["DPDP-ACT-2023"],
439
+ legalCitations: ["Section 12"],
440
+ applicability: { when: "When personal data is stored", requiresPersonalData: true },
441
+ verificationClass: "TECHNICAL_SIGNAL",
442
+ evidenceRequirements: ["correction request handlers"],
443
+ evaluatorId: "correction-path",
444
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
445
+ limitations: ["Operational SLAs not visible in code"],
446
+ remediation: "Expose correction request APIs with tracking and authentication.",
447
+ humanReviewQuestions: ["What is the turnaround SLA for correction requests?"]
448
+ }),
449
+ control({
450
+ id: "DPDP-GRIEV-001",
451
+ title: "Grievance handling technical signal",
452
+ domain: "grievance_handling",
453
+ technicalIntent: "Detect grievance/complaint submission and privacy contact signals.",
454
+ legalSourceIds: ["DPDP-ACT-2023"],
455
+ legalCitations: ["Section 13"],
456
+ applicability: { when: "When personal data is processed", requiresPersonalData: true },
457
+ verificationClass: "TECHNICAL_SIGNAL",
458
+ evidenceRequirements: ["grievance endpoints, privacy contact emails"],
459
+ evaluatorId: "grievance-handling",
460
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
461
+ limitations: ["Effectiveness of redressal is operational"],
462
+ remediation: "Publish grievance contact and implement tracked grievance intake.",
463
+ humanReviewQuestions: ["Who is the designated grievance officer and what is the SLA?"]
464
+ }),
465
+ control({
466
+ id: "DPDP-NOM-001",
467
+ title: "Nomination-related implementation signal",
468
+ domain: "nomination",
469
+ technicalIntent: "Detect nomination fields or flows for Data Principal rights exercise after incapacity/death.",
470
+ legalSourceIds: ["DPDP-ACT-2023"],
471
+ legalCitations: ["Section 14"],
472
+ applicability: { when: "When long-lived personal accounts exist", requiresPersonalData: true },
473
+ verificationClass: "TECHNICAL_SIGNAL",
474
+ evidenceRequirements: ["nominee fields, nomination APIs"],
475
+ evaluatorId: "nomination-signal",
476
+ severityRules: { defaultSeverity: "low", violatedSeverity: "low", partialSeverity: "info" },
477
+ limitations: ["Applicability depends on product context"],
478
+ remediation: "Where relevant, support nominee registration and authenticated exercise of rights.",
479
+ humanReviewQuestions: ["Does product context require nomination support under Section 14?"]
480
+ }),
481
+ control({
482
+ id: "DPDP-CHILD-001",
483
+ title: "Children's data processing signals",
484
+ domain: "childrens_data",
485
+ technicalIntent: "Detect age/DOB/child flags and child-oriented processing paths.",
486
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
487
+ legalCitations: ["Section 9"],
488
+ applicability: { when: "When children's data may be processed", requiresChildren: true },
489
+ verificationClass: "TECHNICAL_SIGNAL",
490
+ evidenceRequirements: ["age gates, child flags, under-18 checks"],
491
+ evaluatorId: "childrens-data",
492
+ severityRules: { defaultSeverity: "high", violatedSeverity: "critical", partialSeverity: "high" },
493
+ limitations: ["Age verification strength requires specialised review"],
494
+ remediation: "Implement verifiable age assurance and restrict tracking/ads for children as required.",
495
+ humanReviewQuestions: ["Does the service knowingly process children's personal data?"]
496
+ }),
497
+ control({
498
+ id: "DPDP-CHILD-002",
499
+ title: "Guardian / parental consent flow",
500
+ domain: "guardian_consent",
501
+ technicalIntent: "Detect guardian/parental consent implementation when children's data is present.",
502
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
503
+ legalCitations: ["Section 9"],
504
+ applicability: { when: "When children's data signals exist", requiresChildren: true },
505
+ verificationClass: "DETERMINISTIC",
506
+ evidenceRequirements: ["parental/guardian consent flows"],
507
+ evaluatorId: "guardian-consent",
508
+ severityRules: { defaultSeverity: "critical", violatedSeverity: "critical", partialSeverity: "high" },
509
+ limitations: ["Identity of guardian cannot be proven statically"],
510
+ remediation: "Implement verifiable parental/guardian consent before processing children's data.",
511
+ humanReviewQuestions: ["How is guardian identity verified in production?"]
512
+ }),
513
+ control({
514
+ id: "DPDP-PROC-001",
515
+ title: "External processors and recipients inventory",
516
+ domain: "processors_and_recipients",
517
+ technicalIntent: "Detect analytics, messaging, payments, identity, cloud, and LLM processor SDKs.",
518
+ legalSourceIds: ["DPDP-ACT-2023"],
519
+ legalCitations: ["Section 8", "definitions of Data Processor"],
520
+ applicability: { when: "When third-party services receive personal data", requiresPersonalData: true },
521
+ verificationClass: "DETERMINISTIC",
522
+ evidenceRequirements: ["SDK imports, API clients to third parties"],
523
+ evaluatorId: "external-processors",
524
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
525
+ limitations: ["Contracts and DPAs are not in code"],
526
+ remediation: "Maintain processor inventory and ensure contracts include processing instructions.",
527
+ humanReviewQuestions: ["Are written contracts in place with each processor?"]
528
+ }),
529
+ control({
530
+ id: "DPDP-XBR-001",
531
+ title: "Cross-border or external-service technical signals",
532
+ domain: "cross_border_signals",
533
+ technicalIntent: "Detect overseas regions, foreign SaaS endpoints, or cross-border transfer config.",
534
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
535
+ legalCitations: ["Section 16"],
536
+ applicability: { when: "When external services or regions are configured", requiresCrossBorder: true },
537
+ verificationClass: "TECHNICAL_SIGNAL",
538
+ evidenceRequirements: ["region configs, foreign endpoints"],
539
+ evaluatorId: "cross-border-signals",
540
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
541
+ limitations: ["Actual transfer location depends on vendor routing"],
542
+ remediation: "Document transfer destinations and align with permitted geographies / conditions.",
543
+ humanReviewQuestions: ["Which jurisdictions receive personal data in production?"]
544
+ }),
545
+ control({
546
+ id: "DPDP-SDF-001",
547
+ title: "Significant Data Fiduciary technical obligations",
548
+ domain: "significant_data_fiduciary",
549
+ technicalIntent: "Detect DPO contact, independent audit hooks, and record-keeping signals if SDF applies.",
550
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
551
+ legalCitations: ["Section 10"],
552
+ applicability: { when: "When organisation is or may be a Significant Data Fiduciary", requiresSdf: true },
553
+ verificationClass: "HUMAN_REVIEW",
554
+ evidenceRequirements: ["DPO contacts, audit logging, data protection impact assessments"],
555
+ evaluatorId: "sdf-signals",
556
+ severityRules: { defaultSeverity: "high", violatedSeverity: "high", partialSeverity: "medium" },
557
+ limitations: ["SDF designation is organisational/legal, not inferred solely from code"],
558
+ remediation: "If designated SDF, implement DPO, audits, and DPIA processes with technical evidence trails.",
559
+ humanReviewQuestions: ["Has the organisation been notified/designated as a Significant Data Fiduciary?"]
560
+ }),
561
+ control({
562
+ id: "DPDP-REQ-001",
563
+ title: "Rights request authentication and tracking",
564
+ domain: "data_principal_access",
565
+ technicalIntent: "Detect authentication and ticket/tracking around principal rights requests.",
566
+ legalSourceIds: ["DPDP-ACT-2023"],
567
+ legalCitations: ["Section 11", "Section 12", "Section 13"],
568
+ applicability: { when: "When rights endpoints exist", requiresPersonalData: true },
569
+ verificationClass: "TECHNICAL_SIGNAL",
570
+ evidenceRequirements: ["request auth, request IDs, status tracking"],
571
+ evaluatorId: "rights-request-tracking",
572
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium", partialSeverity: "low" },
573
+ limitations: ["Identity proofing strength needs human review"],
574
+ remediation: "Authenticate requesters and track request lifecycle to completion.",
575
+ humanReviewQuestions: ["How is Data Principal identity verified for rights requests?"]
576
+ }),
577
+ control({
578
+ id: "DPDP-EXPORT-001",
579
+ title: "Unprotected personal-data exports",
580
+ domain: "security_safeguards",
581
+ technicalIntent: "Detect export endpoints without auth or with broad dump behaviour.",
582
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
583
+ legalCitations: ["Section 8", "Section 11"],
584
+ applicability: { when: "When export endpoints exist", requiresPersonalData: true },
585
+ verificationClass: "DETERMINISTIC",
586
+ evidenceRequirements: ["export handlers lacking auth signals"],
587
+ evaluatorId: "unprotected-export",
588
+ severityRules: { defaultSeverity: "critical", violatedSeverity: "critical" },
589
+ limitations: ["Gateway-level auth may be external"],
590
+ remediation: "Require strong authentication and authorisation on all personal-data exports.",
591
+ humanReviewQuestions: ["Who can export personal data in production and how is it logged?"]
592
+ }),
593
+ control({
594
+ id: "DPDP-NOTICE-002",
595
+ title: "Notice and consent adequacy (human review)",
596
+ domain: "notice",
597
+ technicalIntent: "Capture that notice/consent legal adequacy cannot be certified from code.",
598
+ legalSourceIds: ["DPDP-ACT-2023", "DPDP-RULES-2025"],
599
+ legalCitations: ["Section 5", "Section 6"],
600
+ applicability: { when: "When personal data is collected", requiresPersonalData: true },
601
+ verificationClass: "HUMAN_REVIEW",
602
+ evidenceRequirements: ["Policy documents, UX flows, language review"],
603
+ severityRules: { defaultSeverity: "info", violatedSeverity: "info" },
604
+ limitations: ["Outside deterministic scope"],
605
+ remediation: "Commission product/legal review of notices and consent UX.",
606
+ humanReviewQuestions: [
607
+ "Does notice describe purposes, rights, and grievance contact clearly?",
608
+ "Is consent itemised for distinct purposes?"
609
+ ]
610
+ }),
611
+ control({
612
+ id: "DPDP-PROC-002",
613
+ title: "Processor contracts and instructions (human review)",
614
+ domain: "processors_and_recipients",
615
+ technicalIntent: "Ensure processor contractual arrangements are reviewed outside code.",
616
+ legalSourceIds: ["DPDP-ACT-2023"],
617
+ legalCitations: ["Section 8"],
618
+ applicability: { when: "When processors are used", requiresProcessors: true },
619
+ verificationClass: "DECLARED_EVIDENCE",
620
+ evidenceRequirements: ["Declared contracts / DPAs in evidence.yml"],
621
+ severityRules: { defaultSeverity: "medium", violatedSeverity: "medium" },
622
+ limitations: ["Contracts are not executable evidence"],
623
+ remediation: "Attach processor contract references as declared evidence; never treat as deterministic pass.",
624
+ humanReviewQuestions: ["Do contracts bind processors to fiduciary instructions and security?"]
625
+ }),
626
+ control({
627
+ id: "DPDP-THIRD-001",
628
+ title: "Whole user objects sent to third parties",
629
+ domain: "processors_and_recipients",
630
+ technicalIntent: "Detect shipping full user objects to analytics/error/LLM vendors.",
631
+ legalSourceIds: ["DPDP-ACT-2023"],
632
+ legalCitations: ["Section 8"],
633
+ applicability: { when: "When third-party SDKs exist", requiresPersonalData: true },
634
+ verificationClass: "DETERMINISTIC",
635
+ evidenceRequirements: ["SDK calls with user objects"],
636
+ evaluatorId: "third-party-user-object",
637
+ severityRules: { defaultSeverity: "high", violatedSeverity: "high" },
638
+ limitations: ["SDK auto-PII collection may be config-driven"],
639
+ remediation: "Send only necessary attributes; scrub PII before third-party calls.",
640
+ humanReviewQuestions: ["What data categories does each vendor actually receive?"]
641
+ })
642
+ ];
643
+ function getControlById(id) {
644
+ return exports.DPDP_CONTROLS.find((controlDef) => controlDef.id === id);
645
+ }
646
+ function controlsByDomain() {
647
+ const grouped = {};
648
+ for (const item of exports.DPDP_CONTROLS) {
649
+ grouped[item.domain] = grouped[item.domain] ?? [];
650
+ grouped[item.domain].push(item);
651
+ }
652
+ return grouped;
653
+ }
654
+ function controlsForVerificationClass(vc) {
655
+ return exports.DPDP_CONTROLS.filter((controlDef) => controlDef.verificationClass === vc);
656
+ }
657
+ exports.DPDP_CATALOGUE_META = {
658
+ version: SV,
659
+ controlCount: exports.DPDP_CONTROLS.length,
660
+ disclaimer: "This catalogue supports DPDP technical readiness and engineering-risk assessment. It is not a legal certification instrument."
661
+ };