Lighting Talks - Day 1 - GraphQL Galaxy 2020

Rate this content
Bookmark

FAQ

Tyke is a gateway that includes built-in features for securing GraphQL endpoints, such as authorization mechanisms, query depth limiting, and field-based permissions. It allows users to proxy to existing GraphQL services and add security features directly through its dashboard.

Tyke provides several security features for GraphQL APIs including built-in authorization, schema security through field-based permissions, and protection against denial of service attacks by adding query depth limiting.

Query depth limiting is a security measure used to prevent denial of service attacks by restricting the complexity of queries that can be executed against a GraphQL API. It limits the depth of queries to prevent excessively deep and resource-intensive queries.

Authorization in GraphQL via Tyke is enforced by proxying an existing GraphQL API through Tyke and configuring authorization settings in the Tyke dashboard. This setup requires an authentication token to access the proxied API, ensuring that only authorized users can execute queries.

Field-based permissions in GraphQL security involve specifying access controls at the field level within a GraphQL schema. This ensures that only designated users or roles have the access rights to specific fields, enhancing data privacy and compliance.

Yes, Tyke can manage multiple GraphQL services and has mechanisms to resolve naming conflicts that may arise when integrating multiple APIs. This includes manual workarounds and upcoming features intended to streamline conflict resolution.

Query depth refers to how deep a GraphQL query can go. Tyke controls this by allowing administrators to set maximum query depths, which can vary by user group, thereby preventing excessively deep queries that could impact performance or security.

Ryan Severns
Ryan Severns
Matt Tanner
Matt Tanner
Brecht De Rooms
Brecht De Rooms
29 min
02 Jul, 2021

Comments

Sign in or register to post your comment.
Video Summary and Transcription
The video discusses how to secure GraphQL endpoints in five minutes using Tyke. The talk highlights key problems like authorization, schema security, and denial of service attacks. Tyke offers built-in features such as query depth limiting, field-based permissions, and various authentication modes including OAuth 2.0 and mutual TLS. The video explains how to use Tyke's dashboard to proxy existing GraphQL APIs and enforce security measures like authentication tokens. Additionally, it covers the advantages of using native GraphQL as a database query language and the benefits of StackHawk for application security testing. StackHawk's tool simplifies finding and fixing security bugs in GraphQL endpoints, ensuring every pull request is tested for vulnerabilities before production. The talk also mentions common vulnerabilities in GraphQL applications like SQL injection and information disclosure.

1. Securing GraphQL Endpoints with Tyke

Short description:

Hello everyone and welcome to this lightning talk about how to secure your GraphQL endpoints in five minutes. We're gonna be doing that using Tyke. So let's look at a few problems that we're gonna solve within securing GraphQL. First one is adding authorization. Securing the schema, making sure that only specific users have access to specific fields. And then protecting against denial of service attacks. We have batteries included security, which means everything within our gateway is included. We'll add field-based permissions to secure the schema and query depth limiting for denial of service attacks. Let's get right to it. I'm in the Tyke dashboard. I'm gonna show you what I wanna secure. There's this TrevorBlades countries API, GraphQL API, that right now is completely open. I'm gonna proxy to that through Tyke and then secure it using Tyke.

How to Secure GraphQL Endpoints in 5 Minutes

Hello everyone and welcome to this lightning talk about how to secure your GraphQL endpoints in five minutes. And we're gonna be doing that using Tyke. So my name is Matt Tanner. I am a product evangelist here at Tyke. I'm gonna be walking you through this.

So getting right down to it, since we have a limited amount of time, let's look at a few problems that we're gonna solve within securing GraphQL. First one is adding authorization. So authorization, authentication, adding in those mechanisms quickly. Securing the schema, so making sure that only specific users have access to specific fields. And then also looking at protecting us against denial of service attacks.

How do we do that? Well, we have batteries included security, which is a phrase that we like to use at Tyke to say everything that's within our gateway is included. There's no plugins or anything like that that you need to add. And for that, we're gonna add that right in. Then we're going to, as part of that, put in some field-based permissions to secure the schema. And then we're gonna add some query depth limiting to it as well for those denial of service attacks.

So let's see how it works. Let's just get right to it. I'm gonna jump out of this. And here I am in the Tyke dashboard. What I'm gonna do is, first I'm gonna show you what I wanna secure. There's this TrevorBlades countries API, GraphQL API, that right now is completely open and I can hit it. There's no security, no type of security at all. What I'm gonna do is proxy to that through Tyke and then secure it using Tyke. So I'm gonna grab this. This is as if it was your API. You come over into Tyke and we come over to APIs, add new API. I'm gonna call it countries. It is a GraphQL API. We're going to proxy to an existing GraphQL service. And you'll see that I have the TrevorBlades countries URL in there.

2. Authorization and Authentication Modes

Short description:

At this point, we already have some authorization built in. We're enforcing an authentication token, specified in our setup. We support various authentication modes like authentication tokens, mutual TLS, OAuth 2.0, and JOTS.

Now, at this point, believe it or not, we already have some authorization built in. We've now proxied to it. If I come over to the playground, which is built into Tyke, and I run, if I just hide this here, hide meeting controls. If I come over here and grab this query, and I come over back to here and run this query, you'll see that it says authorization field is missing. That's great. That means we're already enforcing an authentication token. Where is that specified? Well, in our setup right down here, we support quite a few different things, but today we're gonna use authentication tokens just for brevity. We also support mutual TLS, OAuth 2.0, JOTS, all of those good type of authentication modes.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

From GraphQL Zero to GraphQL Hero with RedwoodJS
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
Tom Pressenwurter introduces Redwood.js, a full stack app framework for building GraphQL APIs easily and maintainably. He demonstrates a Redwood.js application with a React-based front end and a Node.js API. Redwood.js offers a simplified folder structure and schema for organizing the application. It provides easy data manipulation and CRUD operations through GraphQL functions. Redwood.js allows for easy implementation of new queries and directives, including authentication and limiting access to data. It is a stable and production-ready framework that integrates well with other front-end technologies.
Local State and Server Cache: Finding a Balance
Vue.js London Live 2021Vue.js London Live 2021
24 min
Local State and Server Cache: Finding a Balance
Top Content
This Talk discusses handling local state in software development, particularly when dealing with asynchronous behavior and API requests. It explores the challenges of managing global state and the need for actions when handling server data. The Talk also highlights the issue of fetching data not in Vuex and the challenges of keeping data up-to-date in Vuex. It mentions alternative tools like Apollo Client and React Query for handling local state. The Talk concludes with a discussion on GitLab going public and the celebration that followed.
Batteries Included Reimagined - The Revival of GraphQL Yoga
GraphQL Galaxy 2021GraphQL Galaxy 2021
33 min
Batteries Included Reimagined - The Revival of GraphQL Yoga
Envelope is a powerful GraphQL plugin system that simplifies server development and allows for powerful plugin integration. It provides conformity for large corporations with multiple GraphQL servers and can be used with various frameworks. Envelope acts as the Babel of GraphQL, allowing the use of non-spec features. The Guild offers GraphQL Hive, a service similar to Apollo Studio, and encourages collaboration with other frameworks and languages.
Rock Solid React and GraphQL Apps for People in a Hurry
GraphQL Galaxy 2022GraphQL Galaxy 2022
29 min
Rock Solid React and GraphQL Apps for People in a Hurry
The Talk discusses the challenges and advancements in using GraphQL and React together. It introduces RedwoodJS, a framework that simplifies frontend-backend integration and provides features like code generation, scaffolding, and authentication. The Talk demonstrates how to set up a Redwood project, generate layouts and models, and perform CRUD operations. Redwood automates many GraphQL parts and provides an easy way for developers to get started with GraphQL. It also highlights the benefits of Redwood and suggests checking out RedwoodJS.com for more information.
Adopting GraphQL in an Enterprise
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
Adopting GraphQL in an Enterprise
Today's Talk is about adopting GraphQL in an enterprise. It discusses the challenges of using REST APIs and the benefits of GraphQL. The Talk explores different approaches to adopting GraphQL, including coexistence with REST APIs. It emphasizes the power of GraphQL and provides tips for successful adoption. Overall, the Talk highlights the advantages of GraphQL in terms of efficiency, collaboration, and control over APIs.
Step aside resolvers: a new approach to GraphQL execution
GraphQL Galaxy 2022GraphQL Galaxy 2022
16 min
Step aside resolvers: a new approach to GraphQL execution
GraphQL has made a huge impact in the way we build client applications, websites, and mobile apps. Despite the dominance of resolvers, the GraphQL specification does not mandate their use. Introducing Graphast, a new project that compiles GraphQL operations into execution and output plans, providing advanced optimizations. In GraphFast, instead of resolvers, we have plan resolvers that deal with future data. Graphfast plan resolvers are short and efficient, supporting all features of modern GraphQL.

Workshops on related topic

Build with SvelteKit and GraphQL
GraphQL Galaxy 2021GraphQL Galaxy 2021
140 min
Build with SvelteKit and GraphQL
Top Content
Featured WorkshopFree
Scott Spence
Scott Spence
Have you ever thought about building something that doesn't require a lot of boilerplate with a tiny bundle size? In this workshop, Scott Spence will go from hello world to covering routing and using endpoints in SvelteKit. You'll set up a backend GraphQL API then use GraphQL queries with SvelteKit to display the GraphQL API data. You'll build a fast secure project that uses SvelteKit's features, then deploy it as a fully static site. This course is for the Svelte curious who haven't had extensive experience with SvelteKit and want a deeper understanding of how to use it in practical applications.

Table of contents:
- Kick-off and Svelte introduction
- Initialise frontend project
- Tour of the SvelteKit skeleton project
- Configure backend project
- Query Data with GraphQL
- Fetching data to the frontend with GraphQL
- Styling
- Svelte directives
- Routing in SvelteKit
- Endpoints in SvelteKit
- Deploying to Netlify
- Navigation
- Mutations in GraphCMS
- Sending GraphQL Mutations via SvelteKit
- Q&A
Build Modern Applications Using GraphQL and Javascript
Node Congress 2024Node Congress 2024
152 min
Build Modern Applications Using GraphQL and Javascript
Featured Workshop
Emanuel Scirlet
Miguel Henriques
2 authors
Come and learn how you can supercharge your modern and secure applications using GraphQL and Javascript. In this workshop we will build a GraphQL API and we will demonstrate the benefits of the query language for APIs and what use cases that are fit for it. Basic Javascript knowledge required.
How to Solve Real-World Problems with Remix
Remix Conf Europe 2022Remix Conf Europe 2022
195 min
How to Solve Real-World Problems with Remix
Featured Workshop
Michael Carter
Michael Carter
- Errors? How to render and log your server and client errorsa - When to return errors vs throwb - Setup logging service like Sentry, LogRocket, and Bugsnag- Forms? How to validate and handle multi-page formsa - Use zod to validate form data in your actionb - Step through multi-page forms without losing data- Stuck? How to patch bugs or missing features in Remix so you can move ona - Use patch-package to quickly fix your Remix installb - Show tool for managing multiple patches and cherry-pick open PRs- Users? How to handle multi-tenant apps with Prismaa - Determine tenant by host or by userb - Multiple database or single database/multiple schemasc - Ensures tenant data always separate from others
End-To-End Type Safety with React, GraphQL & Prisma
React Advanced 2022React Advanced 2022
95 min
End-To-End Type Safety with React, GraphQL & Prisma
Featured WorkshopFree
Sabin Adams
Sabin Adams
In this workshop, you will get a first-hand look at what end-to-end type safety is and why it is important. To accomplish this, you’ll be building a GraphQL API using modern, relevant tools which will be consumed by a React client.
Prerequisites: - Node.js installed on your machine (12.2.X / 14.X)- It is recommended (but not required) to use VS Code for the practical tasks- An IDE installed (VSCode recommended)- (Good to have)*A basic understanding of Node.js, React, and TypeScript
GraphQL for React Developers
GraphQL Galaxy 2022GraphQL Galaxy 2022
112 min
GraphQL for React Developers
Featured Workshop
Roy Derks
Roy Derks
There are many advantages to using GraphQL as a datasource for frontend development, compared to REST APIs. We developers in example need to write a lot of imperative code to retrieve data to display in our applications and handle state. With GraphQL you cannot only decrease the amount of code needed around data fetching and state-management you'll also get increased flexibility, better performance and most of all an improved developer experience. In this workshop you'll learn how GraphQL can improve your work as a frontend developer and how to handle GraphQL in your frontend React application.
Build a Headless WordPress App with Next.js and WPGraphQL
React Summit 2022React Summit 2022
173 min
Build a Headless WordPress App with Next.js and WPGraphQL
Top Content
WorkshopFree
Kellen Mace
Kellen Mace
In this workshop, you’ll learn how to build a Next.js app that uses Apollo Client to fetch data from a headless WordPress backend and use it to render the pages of your app. You’ll learn when you should consider a headless WordPress architecture, how to turn a WordPress backend into a GraphQL server, how to compose queries using the GraphiQL IDE, how to colocate GraphQL fragments with your components, and more.