Silverstripe
Silverstripe CMSDocs
  • Getting Started
  • Developer Guides
  • Optional features
    • Advanced Workflow
    • Elemental blocks
    • Content Localisation with Fluent
    • 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
    • GridField Bulk Editing Tools
    • GridField Extensions
    • TinyMCE HTML editor
    • Linkfield
    • Login forms
    • Multi-factor authentication (MFA)
    • Queued Jobs
    • RealMe
    • Static Publish Queue
    • TagField
    • Taxonomies
    • Text Extraction
    • TOTP Authenticator
    • UserForms
  • Upgrading
  • Changelogs
  • Contributing
  • Project Governance
  1. Optional features/
  2. GraphQL/
  3. Security & best practices
Version 6Supported

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