• Getting Started
  • Lessons
  • Developer Guides
    • Model and Databases
    • Templates and Views
    • Controllers
    • Forms
    • Configuration
    • Extending Silverstripe CMS
    • Testing
    • Debugging
    • Performance
    • Security
    • Email
    • Integration and Web Services
    • Search
    • i18n
    • Files
    • Customising the Admin Interface
    • Execution pipeline
    • Command Line Interface
    • Cookies and Sessions
    • Graphql
      • Getting started
      • Working with DataObject models
      • Working with generic types
      • Security & best practices
        • Authentication
        • Cross-Origin Resource Sharing (CORS)
        • CSRF protection
        • Strict HTTP method checking
        • Recursive or complex queries
      • Plugins
      • Extending the schema
      • Tips & Tricks
      • Architecture Diagrams
    • Deprecating code
  • Optional features
  • Upgrading
  • Changelogs
  • Contributing
  • Project Governance
  1. Developer Guides
  2. Graphql
  3. Security & best practices
Version 5Supported

This version of Silverstripe CMS is still supported though will not receive any additional features.

Go to documentation for the most recent stable version

Security and best practices#

In this section we'll cover several options you have for keeping your GraphQL API secure and compliant with best practices. Some of these tools require configuration, while others come pre-installed.

Authentication

Ensure your GraphQL api is only accessible to provisioned users

Cross-Origin Resource Sharing (CORS)

Ensure that requests to your API come from a whitelist of origins

CSRF protection

Protect destructive actions from cross-site request forgery

Strict HTTP method checking

Ensure requests are GET or POST

Recursive or complex queries

Protecting against potentially malicious queries

Edit on GitHub