diff --git a/.claude/rules/docs-pages.md b/.claude/rules/docs-pages.md index 1fce303..9b4af3f 100644 --- a/.claude/rules/docs-pages.md +++ b/.claude/rules/docs-pages.md @@ -1,6 +1,7 @@ --- paths: - "internal/handler/docs*" + - "internal/handler/home*" - "internal/handler/render.go" - "internal/handler/openapi.go" - "internal/handler/changelog.go" @@ -20,6 +21,29 @@ from it. **Adding a page is one table row.** Tests that apply to only some pages (`docsPagesWithLanguageTabs()`) rather than re-list. Do not spell the page set out anywhere else — not in the router, not in a test, not in a template's nav. +## The home page is not a docs page + +`home.html` is the company page at `/`, served by `Handler.Home`. **It is not a row in +`docsPages`.** It is the front door: same design language as the docs, different page. + +- **Shared:** `docs_styles.css` for the tokens, typefaces, page background, code blocks, + tags and theme toggle; `docs.js` for the toggle and the copy buttons; `htmlPageCSP`; and + the template data, so its price and payment link come from the same config keys. +- **Its own:** the header, the hero and its fan-out diagram, the plan panels, the contact + panel — all in the page's inline ` + + + +
+
+ Security Accelerated + +
+ +
+
+

Domain and IP intelligence for security teams.

+

Security Accelerated builds the Intelligence API. Ask about a domain and one request returns its registration, DNS, certificates, email security and more. Ask about an IP address and it returns location, network owner, abuse contact and more. That is a sample: the docs list everything available today.

+ + +
+ + +

The lookups you name run side by side, and one that fails does not fail the rest. Add risk and the document carries an aggregate score as well.

+
+
+ +
+
+

Intelligence API

+

One REST API for domains and IP addresses. You name the lookups you want, and the answer to “what is this thing?” comes back as a single document your tooling can read.

+ +
+

For a domain

+
    +
  • WHOIS registration
  • +
  • DNS records
  • +
  • TLS certificate
  • +
  • HTTP headers
  • +
  • Email security SPF, DKIM, DMARC, MTA-STS, TLS-RPT, BIMI
  • +
  • DNSSEC and CAA
  • +
  • Subdomains
  • +
  • Certificate transparency
  • +
  • BGP and ASN
  • +
  • Technology fingerprinting
  • +
  • Reputation Pro
  • +
  • Threat intelligence Pro
  • +
  • Aggregate risk score
  • +
+

Domain reference

+
+ +
+

For an IP address

+
    +
  • GeoIP
  • +
  • ASN
  • +
  • Reverse DNS
  • +
  • Abuse contact
  • +
  • Threat intelligence Pro
  • +
+

IP reference

+
+
+ +
+

Request

+
curl -s https://api.securityaccelerated.com/v1/domain/lookup \
+  -H 'X-API-Key: YOUR_KEY' \
+  -H 'Content-Type: application/json' \
+  -d '{"domains": ["example.com"],
+       "lookups": ["dns", "ssl", "email_security", "risk"]}'
+

Response, trimmed

+
{
+  "results": [
+    {
+      "domain": "example.com",
+      "dns": {
+        "cache_hit": false,
+        "a": ["23.192.228.80"],
+        "ns": ["a.iana-servers.net", "b.iana-servers.net"]
+      },
+      "ssl": {
+        "cache_hit": true,
+        "issuer": "DigiCert Global G3 TLS ECC SHA384 2020 CA1",
+        "not_after": "2027-01-15T23:59:59Z",
+        "days_until_expiry": 91
+      },
+      "email_security": {
+        "cache_hit": false,
+        "spf": { "raw": "v=spf1 -all", "all": "-all" },
+        "dmarc": { "raw": "v=DMARC1; p=reject", "policy": "reject" }
+      },
+      "risk": { "cache_hit": false, "score": 12, "risk_level": "low" }
+    }
+  ]
+}
+
+
+ +
+

Plans

+

Two plans. They differ in request volume, batch size, and access to reputation and threat intelligence.

+
+
+

Free

+

$0

+
    +
  • 5 requests a minute
  • +
  • 1 domain or IP per request
  • +
  • Every lookup except reputation and threat intelligence
  • +
  • Aggregate risk score
  • +
  • Usage statistics and self-service key rotation
  • +
+
+
+

Pro

+ {{if .ProPrice}}

{{.ProPrice}}

{{end}} +
    +
  • 120 requests a minute
  • +
  • 20 domains or IPs per request
  • +
  • Every lookup, including reputation and threat intelligence
  • +
  • Aggregate risk score
  • +
  • Usage statistics and self-service key rotation
  • +
+ {{if .ProPaymentLink}}Get a Pro key{{else}}

Contact us for a Pro key.

{{end}} +
+
+

A Pro key is self-service: subscribe, copy the key from the confirmation page, and rotate it yourself whenever you need to. The docs have the full comparison.

+
+ +
+

Read the code before you send it anything

+

The source is published so you can evaluate the service before you trust it with a query. It is source-available with all rights reserved, not open source.

+
+
+
You get what worked
+
A lookup that fails says why in a per-result errors array. The rest of the response still arrives.
+
+
+
Failures are never cached
+
Only successful lookups are stored, so an upstream outage is not replayed to you later as an answer.
+
+
+
One path out for lookups
+
Every HTTP and TLS connection a lookup makes goes through a single SSRF-prevention layer that checks the address at dial time, after DNS resolution.
+
+
+
The release process is in the repo
+
How a version reaches production, and the approval it waits for, is written down next to the code.
+
+
+ +
+ +
+

Contact

+
+
+
Questions and support
+
support@securityaccelerated.com
+
+
+
Security reports
+
How to report a vulnerability
+
+
+
+
+ + +
+ + + + diff --git a/internal/handler/home_test.go b/internal/handler/home_test.go new file mode 100644 index 0000000..a8b08ce --- /dev/null +++ b/internal/handler/home_test.go @@ -0,0 +1,110 @@ +package handler + +import ( + "net/http" + "net/http/httptest" + "regexp" + "strings" + "testing" + + "github.com/spf13/viper" +) + +// allSitePages adds the company page to the docs pages for the one docs rule +// that applies to it: docs.js runs there too, so the controls it injects must +// not be written into the markup. The docs nav and table rules do not apply; +// the home page has its own nav and no tables. +func allSitePages() []docsPage { + return append(allDocsHTML(), docsPage{Path: "/", HTML: homeHTML, Tmpl: homeTmpl}) +} + +func getHome(t *testing.T, cfg *viper.Viper) string { + t.Helper() + r := docsRouterWithData(nil, cfg, nil) + w := httptest.NewRecorder() + r.ServeHTTP(w, httptest.NewRequest(http.MethodGet, "/", http.NoBody)) + + if w.Code != http.StatusOK { + t.Fatalf("status = %d, want %d", w.Code, http.StatusOK) + } + if ct := w.Header().Get("Content-Type"); !strings.Contains(ct, "text/html") { + t.Errorf("Content-Type = %q, want text/html", ct) + } + // The API-wide CSP is default-src 'none'; without the page override the + // stylesheets, the fonts and the scripts are blocked and the page renders + // unstyled. + if got := w.Header().Get("Content-Security-Policy"); got != htmlPageCSP { + t.Errorf("Content-Security-Policy = %q, want %q", got, htmlPageCSP) + } + return w.Body.String() +} + +// The root used to be a 301 to /docs. It now answers for the company, and the +// docs have to stay one link away from it. +func TestHome_ServesCompanyPage(t *testing.T) { + body := getHome(t, nil) + + for _, want := range []string{ + "Security Accelerated", + `href="/docs"`, + `href="/docs/domain"`, + `href="/docs/ip"`, + "mailto:support@securityaccelerated.com", + ``, + ``, + ``, + } { + if !strings.Contains(body, want) { + t.Errorf("home page does not contain %q", want) + } + } + + // Blocked silently by the CSP, so nothing but this test would notice. + if strings.Contains(body, "