Skip to content

feat: add email domain health workflow and security page polish#104

Merged
jonathanhaaswriter merged 7 commits into
mainfrom
droid/email-domain-health-and-spacing
Jun 15, 2026
Merged

feat: add email domain health workflow and security page polish#104
jonathanhaaswriter merged 7 commits into
mainfrom
droid/email-domain-health-and-spacing

Conversation

@dcoln25-writer

@dcoln25-writer dcoln25-writer commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a new Email Domain Health workflow end-to-end: proto RPCs, Go handlers, persistence models + migration, Connect/web API wrappers, and a dedicated /security/email-domain-health page
  • integrate Email Domain Health into Security Graph with a summary card and navigation entry
  • harden mail-auth evaluation so malformed/permissive records do not appear healthy:
    • flag SPF ?all
    • validate DMARC p= to none|quarantine|reject
    • treat invalid DKIM p= key material as an issue (not healthy)
  • expand domain discovery to include connected saas_identities email/external identifiers so domains are found even when integration account ids are slugs
  • add graceful frontend fallback for unimplemented/404 RPC responses on Email Domain Health loading
  • normalize spacing rhythm across Security Graph, Email Domain Health, and Findings pages

Validation

  • go build ./...
  • go vet ./...
  • go test ./... -short
  • npm run typecheck
  • npm run test:api
  • npm run build:web

Introduce end-to-end domain health checks (SPF/DKIM/DMARC), persistence, and UI surfaces so operators can triage mail-auth posture from Security Graph and a dedicated page.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@dcoln25-writer dcoln25-writer force-pushed the droid/email-domain-health-and-spacing branch from 304af3d to ce5989f Compare June 15, 2026 05:56
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Droid finished @dcoln25-writer's task —— View job


Security Review

The Email Domain Health feature is well structured: handlers are session-authenticated and scoped by organization_id, SQL is parameterized, and normalizeDomainCandidate rejects IPs and internal suffixes. Two non-blocking issues remain: DKIM key size is derived from the encoded SPKI byte length rather than the RSA modulus (inaccurate displayed bits and skewed thresholds), and the unconditional refresh path performs unbounded, unthrottled DNS resolution that an authenticated user could abuse for resource exhaustion.

Comment thread internal/bootstrap/email_domain_health.go Outdated
Comment thread internal/bootstrap/email_domain_health.go
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Droid encountered an error —— View job


Security Review

Droid is reviewing code and running a security check…

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Droid finished @dcoln25-writer's task —— View job


Security Review

The Email Domain Health feature is well structured and the two prior review comments (DKIM key-bit calculation and refresh-handler throttling) are addressed at this head SHA. The main remaining concern is that the list/ensure read path still performs unbounded, unthrottled outbound DNS on every page load, lacking the rate limit and bulk cap applied to the refresh handler. Secondary correctness issues are an Ed25519 DKIM false-positive that forces domains to FAILING and an empty refresh-all response when no domains are stale.

Comment thread internal/bootstrap/email_domain_health.go Outdated
Comment thread internal/bootstrap/email_domain_health.go Outdated
Comment thread internal/bootstrap/email_domain_health.go Outdated
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Droid encountered an error —— View job


Security Review

Droid is reviewing code and running a security check…

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Droid finished @dcoln25-writer's task —— View job


Security Review

The Email Domain Health feature is well structured, and all five previously flagged issues (DKIM key-bit calculation, list/refresh DNS rate-limiting, Ed25519 false-positive, and refresh-all empty result) are resolved at this head SHA. Remaining items are non-blocking: the getEmailDomainHealth read path still triggers outbound DNS without the rate limit applied to the other handlers, the list endpoint returns an incomplete set on first load for orgs with >10 domains, raw DNS error strings are surfaced to clients, and a nested-route highlight glitch in the sidebar nav.

Comment thread internal/bootstrap/email_domain_health.go
Comment thread internal/bootstrap/email_domain_health.go Outdated
Comment thread internal/bootstrap/email_domain_health.go Outdated
Comment thread apps/web/components/layout/top-nav.tsx
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Droid encountered an error —— View job


Security Review

Droid is reviewing code and running a security check…

Add Salesforce provider/catalog support (Connected App client ID+secret flow), tighten connector rules UX, and remove the legacy per-connector Checks dialog. Harden email-domain health with accurate DKIM key sizing, Ed25519 support, list/get/refresh throttling and caps, sanitized DNS lookup error details, and complete discovered-domain list responses; also fix sidebar nested active-state highlighting.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@dcoln25-writer

Copy link
Copy Markdown
Contributor Author

Repushed at .

Addressed the follow-up review items on this branch:

  • Added explicit list/get email-domain request rate limiting (with policy assertions in tests).
  • Kept refresh DNS work bounded by stale-window + bulk cap and preserved refresh-all current-row behavior when nothing is stale.
  • Ensured list responses include discovered-but-not-yet-checked domains as placeholders.
  • Sanitized DNS lookup error details returned to clients (no raw resolver internals).
  • Fixed nested sidebar active-state highlighting so Email Domain Health no longer double-highlights.

@dcoln25-writer

Copy link
Copy Markdown
Contributor Author

Repushed at 53de11e.

Addressed the follow-up review items on this branch:

  • Added explicit list/get email-domain request rate limiting (with policy assertions in tests).
  • Kept refresh DNS work bounded by stale-window + bulk cap and preserved refresh-all current-row behavior when nothing is stale.
  • Ensured list responses include discovered-but-not-yet-checked domains as UNKNOWN placeholders.
  • Sanitized DNS lookup error details returned to clients (no raw resolver internals).
  • Fixed nested /security/* sidebar active-state highlighting so Email Domain Health no longer double-highlights.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Droid finished @dcoln25-writer's task —— View job


Security Review

No issues found. The Email Domain Health feature is well structured: handlers are session-authenticated and org-scoped, SQL is parameterized, and DNS read/refresh paths are rate-limited and bulk-capped. All previously flagged issues are resolved at this head SHA and no new high-confidence, actionable issues were found.

@jonathanhaaswriter jonathanhaaswriter merged commit c298839 into main Jun 15, 2026
16 checks passed
@jonathanhaaswriter jonathanhaaswriter deleted the droid/email-domain-health-and-spacing branch June 15, 2026 08:41
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