Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.

Remove telemetry, data exfiltration, and harden security#1

Merged
maroun2 merged 1 commit into
mainfrom
remove-telemetry
Apr 22, 2026
Merged

Remove telemetry, data exfiltration, and harden security#1
maroun2 merged 1 commit into
mainfrom
remove-telemetry

Conversation

@maroun2
Copy link
Copy Markdown
Owner

@maroun2 maroun2 commented Apr 2, 2026

Summary

Security audit of this ForgeCode fork found extensive telemetry and data exfiltration. This PR removes all of it and hardens security defaults.

  • Remove PostHog telemetry completely — gutted forge_tracker crate (no-op stubs preserve API surface), removed email harvesting, machine fingerprinting, and all data collection. Removed posthog-rs and machineid-rs dependencies.
  • Remove source code upload to ForgeCode servers — all gRPC methods return no-op, ForgeGrpcClient stubbed out, services_url cleared from .forge.toml.
  • Remove auto-update (curl|sh)on_update() replaced with no-op, update-informer dependency removed.
  • Harden security defaults — restrict default permissions to ~/** and /tmp/** (was **/* allow-all), redact Debug output on all secret types, add x-api-key to header sanitization, set chmod 600 on credential files, filter MCP env vars to safe whitelist.

29 files changed, 231 insertions, 1,803 deletions

What was removed

Category What Where
PostHog telemetry HTTP POST to us.i.posthog.com/capture/ forge_tracker/src/collect/posthog.rs
Email harvesting ~/.ssh/*.pub, git config, macOS Apple ID forge_tracker/src/dispatch.rs
Machine fingerprinting Hardware-based device ID forge_tracker/src/client_id/
Source code upload gRPC to api.forgecode.dev forge_repo/src/context_engine.rs
Auto-update curl -fsSL https://forgecode.dev/cli | sh forge_main/src/update.rs

Test plan

  • cargo check --workspace — PASS
  • cargo test --workspace — PASS (all tests green)
  • Verify no network calls to posthog.com, api.forgecode.dev, or forgecode.dev/cli at runtime
  • Verify credential files are created with 600 permissions
  • Verify MCP clients only receive whitelisted env vars

Phase 1 - Remove PostHog telemetry:
- Gut forge_tracker crate, replace with no-op stubs preserving API surface
- Remove PostHog HTTP collector, machine fingerprinting, email harvesting
- Remove posthog-rs and machineid-rs dependencies
- Remove POSTHOG_API_SECRET from CI workflows and forge_ci
- Keep local file-based logging (daily rolling), remove PostHogWriter

Phase 2 - Remove source code upload:
- No-op all gRPC methods in ForgeContextEngineRepository
- No-op ForgeGrpcClient (dummy channel, no connections)
- Clear default services_url in .forge.toml
- Handle empty services_url gracefully in ForgeInfra init

Phase 3 - Remove auto-update:
- Replace on_update() with no-op stub
- Remove update-informer dependency
- Remove auto-update config from .forge.toml
- Call sites in ui.rs unchanged (they call the no-op)

Phase 4 - Security hardening:
- Restrict default permissions to home dir + /tmp (was allow all)
- Redact Debug impl on all secret types (ApiKey, tokens, etc.)
- Add x-api-key to header sanitization
- Set chmod 600 on credential files after writing
- Filter env vars for MCP clients to safe whitelist
@autofix-troubleshooter
Copy link
Copy Markdown

Hi! I'm the autofix logoautofix.ci troubleshooter bot.

It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃

@maroun2 maroun2 merged commit 65b664d into main Apr 22, 2026
9 of 10 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants