# אבטחת טפסי החברה

> תיעוד מקור. מקור: docs/security/company-forms-controls.md · 6a466bf.

**Scope:** Public contact form and careers general-application form only. This does not modify product authentication, business tenants, billing or approved company assets.

## Implemented controls

- Dedicated `company_private.form_submissions` and `company_private.form_rate_limits` tables in the existing Supabase project. Both use enabled + forced RLS, with no public `SELECT`/DML grants and no direct browser access.
- Service-role-only RPCs restrict private writes and access to Cloudflare Turnstile's verification secret stored in **Supabase Vault**. The browser sees only the public Turnstile sitekey.
- Turnstile token validation on the server with verified `hostname` and `action`; all other submissions fail closed. The user must acknowledge the linked privacy policy.
- Application limits field size, content type, payload bytes, same-origin requests and retries. A pseudonymous, salted fingerprint is rate-limited atomically to 5 successful submissions/hour.
- No CV file uploads, ID documents, payment details or medical information are requested. Optional professional URL must be HTTPS.
- Contact records expire after 365 days; general career applications after 180 days. A daily `pg_cron` job deletes expired form records and old rate counters.
- Form content is not included in application logging and is never routed into EV customer-tenant APIs.

## Operational handling

- The submissions reside in Supabase project `LinkNodesEnergy` (region Singapore), private schema `company_private`, not in the public browser-facing API. Authorized company administrators must review and resolve them via secure database administration. **No automated email notifications or ATS integration are claimed.**
- Cloudflare widget: `LinkNodes Energy — Public Contact & Careers Forms`, domains `linknodesenergy.com` and `www.linknodesenergy.com`.
- Cloudflare secret is kept in Vault under `lne_company_forms_turnstile`; never commit it or expose it in frontend environment variables.
- Next.js site uses `NEXT_PUBLIC_TURNSTILE_SITE_KEY` (public), `/api/company/submit` (website-only), and Supabase Edge Function `lne-company-forms` (verifies challenge before private RPC).
- The migration was applied in Supabase as `lne_company_contact_careers_private_forms`. The SQL is backed up at `infra/company-forms/schema.sql`. It is intentionally outside the existing EV product migration generator to avoid rewriting approved product schema artifacts.
- Privacy requests: `info@linknodesenergy.com`. Company staff must verify the requester and review deletion/access requests, keeping a documented case history separately.

### Website target and Frankfurt cutover

The website route reads the server-only `COMPANY_FORMS_SUPABASE_URL` on each POST. Set it to a hosted Supabase HTTPS origin, without credentials, a port, a path, a query or a fragment; a trailing slash is accepted. The route appends `/functions/v1/lne-company-forms`. An unset or empty value preserves the existing Singapore target. A malformed configured value returns `503 SERVICE_UNAVAILABLE` without sending the form elsewhere; upstream redirects are also rejected. This setting is separate from the product's `NEXT_PUBLIC_SUPABASE_URL` and never needs a browser environment variable.

Before switching the website setting to Frankfurt, verify that the target has the private company-form schema and service-only RPCs, the `lne-company-forms` Edge Function, its Turnstile Vault secret and hostname/action checks, and the retention job. Then set the Frankfurt origin on the **website** deployment and redeploy it. Product database configuration alone does not move company forms. Keep the current target until those dependencies are verified; do not copy secret values into source or browser configuration.

## Compliance status and remaining evidence

These engineering controls **do not establish full GDPR compliance, ISO/IEC 27001 certification or a SOC 2 Type I/II report**.

Before making such claims, obtain:

1. Controller identity, lawful-basis review, full Article 13 notice and international-transfer arrangements (including the Supabase Singapore processing location), current processor agreements and subprocessor inventory.
2. Rights-request procedures, verified access/deletion handling, incident-response policy, retention exceptions and evidence of completed cron runs.
3. ISO 27001 ISMS scope, risk assessment, controls, independent certification audit and remediation; and SOC 2 control design, evidence period, independent CPA examination and final report.
4. Signed hiring/privacy terms, authorized staff access process, automated monitoring and delivery/notification workflow as needed.

**Do not display GDPR/ISO/SOC 2 certification badges or attestations on the public site.**
