Skip to content

feat(honeytoken): Salesforce provider plugin (epic #256 Task 5) - #269

Open
LiorFink00 wants to merge 1 commit into
feat/honeytoken-datadogfrom
feat/honeytoken-salesforce
Open

feat(honeytoken): Salesforce provider plugin (epic #256 Task 5)#269
LiorFink00 wants to merge 1 commit into
feat/honeytoken-datadogfrom
feat/honeytoken-salesforce

Conversation

@LiorFink00

Copy link
Copy Markdown
Collaborator

What

Task 5 of epic #256 — second honeytoken provider: create a canary Salesforce Connected App and detect its use.

  • Authenticates via the OAuth 2.0 JWT Bearer flow (RS256-signed assertion).
  • create_token() — create a Connected App as the canary; resolves its durable record Id.
  • revoke_token() — delete the Connected App (404 → already gone, idempotent).
  • poll_usage() — queries LoginHistory (login attempts + source IP) and OAuthToken (token usage counts) for the canary app; each row becomes a usage event with a stable event_id for dedup.

Adaptation

Ported from the enterprise plugin, rewritten on httpx (dropping requests) and adding pyjwt>=2.8 to deps — cryptography (needed for RS256) is already a dependency, and CI installs via pip install -e ".[dev]". Config: instance_url, consumer_key, username (strings), private_key (secret PEM).

Testing

6 tests against faked httpx + jwt (no real org/key): connect success/failure, config validation, create→resolve-id, idempotent revoke, poll collecting both login + oauth events. Loader discovers it as honeytoken. Full suite: 414 passed, 1 skipped; ruff clean.

Stacked

Based on #268 (Task 4) → #267 → …. AWS plugin (Task 6) next, then the UI.

🤖 Generated with Claude Code

Task 5 of epic #256. Second honeytoken provider: create a canary Salesforce
Connected App and detect use.

- Authenticates via the OAuth 2.0 JWT Bearer flow (RS256-signed assertion).
- create_token(): create a Connected App as the canary; resolves its durable Id.
- revoke_token(): delete the Connected App (404 = already gone, idempotent).
- poll_usage(): query LoginHistory (login attempts, with source IP) AND OAuthToken
  (token usage counts) for the canary app; each row becomes a usage event with a
  stable event_id for dedup.

Ported from the enterprise plugin, rewritten on httpx (dropping requests) and
adding pyjwt>=2.8 (cryptography, needed for RS256, is already a dependency).
Config: instance_url, consumer_key, username (strings), private_key (secret PEM).

6 tests against faked httpx + jwt (no real org/key): connect success/failure,
config validation, create→resolve id, idempotent revoke, poll collecting both
login and oauth events. Full suite: 414 passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018DARDAxeg4NM8FKoyGMQZy
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.

1 participant