Securing your website is not just about installing an SSL certificate — it’s about building multiple layers of protection that work together. From HTTPS and TLS to modern HTTP security headers like Content Security Policy (CSP), every setting contributes to protecting your visitors, your data, and your brand’s credibility. In this article, we’ll break down what each HubSpot domain security setting does, why it’s important, and how to configure them properly — even if you’re not a security expert.
When you connect a domain to HubSpot, the platform automatically provisions a standard SAN SSL certificate through Google Trust Services. This ensures that your site loads securely over HTTPS — encrypting data between the visitor’s browser and your server.
Key points:
If you prefer to use a custom certificate, you can purchase the Custom SSL Add-on, which allows you to upload your own certificates directly in HubSpot.
Tip: If your domain uses a Certification Authority Authorization (CAA) record, make sure it includes pki.goog. Otherwise, HubSpot won’t be able to provision or renew your SSL certificate.
If you’re migrating your site to HubSpot, you can pre-provision your SSL certificate to avoid downtime. During the domain connection process, HubSpot provides DNS records you can add to your registrar before completing the setup.
Sometimes HubSpot may ask you to add a DCV record. This ensures ongoing SSL validation, especially for reverse proxy domains.
Steps:
Once your domain is connected and secured with SSL, HubSpot allows you to customize additional domain-level security settings.
Turning on “Require HTTPS” ensures all pages and assets load securely. Any mixed content (HTTP resources on HTTPS pages) will be blocked.
Example: If an image is loaded from http://example.com/image.jpg, it won’t display on a secure page. Always use https:// links.
HubSpot servers support TLS 1.0 and above by default. You can restrict connections to TLS 1.2+ for stronger encryption and modern browser compatibility.
Security headers tell browsers how to handle content and connections on your website. They prevent attacks such as cross-site scripting (XSS), clickjacking, and data injection. HubSpot allows you to enable these headers for each connected domain.
HSTS enforces HTTPS by telling browsers to automatically convert all HTTP requests into HTTPS.
Recommended settings:
Example Header:
Protects your website from clickjacking attacks by controlling whether your pages can be loaded in <iframe> elements.
Options:
Example:
Adds a basic layer of protection for older browsers by blocking pages when cross-site scripting is detected.
Recommended setting:
Prevents MIME type sniffing, which can lead to code execution vulnerabilities.
Recommended setting:
Controls how much referral data is sent when users navigate away from your site.
Example:
Example Header:
Controls access to browser features such as camera, microphone, or geolocation.
Example:
This tells the browser that only your site can request location data, and microphone access is disabled.
A Content Security Policy is a powerful browser mechanism that helps prevent malicious code from executing on your site — even if an attacker injects it.
CSP defines which content sources are trusted for loading scripts, styles, images, frames, and other resources.
|
Directive |
Description |
Example |
|---|---|---|
|
default-src |
Fallback for all other directives. |
'self' |
|
script-src |
Allowed sources for JavaScript. |
'self' https://js.hs-scripts.com |
|
style-src |
Allowed sources for CSS. |
'self' 'unsafe-inline' |
|
img-src |
Allowed image sources. |
'self' data: |
|
frame-src |
Allowed iframes or embedded content. |
'self' https://*.hubspot.com |
|
connect-src |
Allowed AJAX or API calls. |
'self' https://*.hubapi.com |
If you’re testing your CSP configuration, enable CSP Report-Only mode first. This allows browsers to report policy violations without blocking content — a safe way to fine-tune your directives.
Example:
Not all domain security settings in HubSpot are available to every account.
If you have a Content Hub Starter, Professional, or Enterprise plan, you can enable a broader range of security headers to improve protection and compliance across your hosted content.
This header controls whether your pages can be embedded in <iframe>, <frame>, <embed>, or <object> elements. It helps prevent clickjacking attacks by restricting where your content can be displayed.
Options:
Setup: Navigate to Settings → Content → Domains & URLs → Actions → Update domain security settings → Security headers tab, then select X-Frame-Options and choose the directive that best fits your needs.
This header adds an extra layer of protection for users on older browsers by blocking or sanitizing pages that trigger cross-site scripting (XSS) detection.
Options:
Setup: Under Security headers, select X-XSS-Protection, choose a setting from the dropdown, and click Save.
Prevents browsers from MIME type sniffing, which can lead to executing unexpected or unsafe content types. Setting this header to nosniff ensures browsers only process files according to their declared MIME type.
Setup: In Security headers, select X-Content-Type-Options and click Save.
The Content-Security-Policy header defines which resources (scripts, styles, images, iframes, etc.) are allowed to load on your website. This is one of the most powerful defenses against cross-site scripting (XSS), data injection, and content hijacking.
Setup:
Important: HubSpot automatically generates unique nonces for all HubSpot-hosted scripts.
To maintain full platform functionality, include the required domains and directives in your policy.
Here’s a condensed version of the most essential domains to include:
|
Domain / Wildcard |
Directive(s) |
Purpose |
|---|---|---|
|
*.hubapi.com |
connect-src |
API requests, form submissions |
|
*.hubspot.com |
script-src, img-src, connect-src, frame-src |
Core HubSpot scripts and embedded tools |
|
*.hsforms.com |
script-src, img-src, frame-src, connect-src, child-src |
Forms and surveys |
|
*.hsadspixel.net |
script-src |
Ads tracking |
|
*.hs-analytics.net |
script-src |
Analytics tracking |
|
*.usemessages.com |
script-src |
Conversations and chatflows |
|
*.hubspot.net |
script-src, img-src, frame-src |
Static assets and hosted files |
(For the full list, refer to HubSpot’s documentation.)
Use this mode to test your CSP rules without enforcing them.
Violations will be logged instead of blocked — ideal when experimenting with new directives.
Setup: Enable Content-Security-Policy-Report-Only, define your policy directives, and toggle the nonce option if needed.
Controls how much referrer information (the URL of the previous page) is shared with external sites. This is useful for privacy protection and analytics accuracy.
Example directives:
Defines which browser features and APIs can be used on your pages or embedded content — for example, access to camera, geolocation, or fullscreen mode.
Example directive: Select Permissions-Policy in your security settings and add directives according to your needs.Refer to Mozilla’s documentation for the full directive list.
These advanced security headers are available only for Content Hub Starter, Professional, and Enterprise accounts. When configured properly, they significantly reduce your exposure to attacks, ensure compliance with security standards, and give you fine-grained control over how browsers handle your content.
|
Security Header |
Description |
Available On |
Key Options |
|---|---|---|---|
|
X-Frame-Options |
Prevents your pages from being embedded in external sites (protects from clickjacking). |
Content Hub Starter, Professional, Enterprise |
deny, sameorigin |
|
X-XSS-Protection |
Adds protection against cross-site scripting in older browsers. |
Content Hub Starter, Professional, Enterprise |
0, 1, 1; mode=block |
|
X-Content-Type-Options |
Prevents MIME type sniffing and enforces declared content types. |
Content Hub Starter, Professional, Enterprise |
nosniff |
|
Content-Security-Policy (CSP) |
Defines which resources (scripts, styles, images, etc.) are allowed to load. |
Content Hub Starter, Professional, Enterprise |
Custom directives, nonce option |
|
Content-Security-Policy-Report-Only |
Monitors CSP policy without enforcing it — useful for testing. |
Content Hub Starter, Professional, Enterprise |
Custom directives, nonce option |
|
Referrer-Policy |
Controls how much referrer information is shared with requests. |
Content Hub Starter, Professional, Enterprise |
no-referrer, same-origin, etc. |
|
Permissions-Policy |
Controls access to browser APIs and features (camera, location, etc.). |
Content Hub Starter, Professional, Enterprise |
Custom directives |
Note: Basic accounts do not include advanced security header configuration.
All plans, however, benefit from HubSpot’s automatic SSL provisioning and built-in security infrastructure.
Security is not a one-time setup — it’s an ongoing process. HubSpot gives you the tools to enforce modern web security standards without complex configuration. By properly setting SSL, enforcing HTTPS, enabling headers, and configuring a strong Content Security Policy, you can protect your visitors, data, and reputation while maintaining site performance and SEO integrity.