Skip to content

Commit 721926d

Browse files
committed
feat: Commit graphQL changes
1 parent 27e2afd commit 721926d

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

content/waf/policies/graphql-protection.md

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,13 @@ Under the "_blocking-settings_", you can selectively enable or disable these vio
131131

132132
Any changes to these violation settings will override the default settings, and the violation details will be recorded in the security log.
133133

134-
See also the [Violations](#violations) section for more details.
134+
Since the GraphQL violations are enabled by default, you can change the GraphQL violations settings i.e. alarm: `true` and block: `false` under the "blocking settings".
135135

136-
While configuring GraphQL, since the GraphQL violations are enabled by default, you can change the GraphQL violations settings i.e. alarm: `true` and block: `false` under the "blocking settings". In this manner, the GraphQL profile detects violations but does not block the request. They may contribute to the Violation Rating, which, if raised above 3, will automatically block the request.
136+
With this configuration the GraphQL profile detects violations but does not block the request. They may still contribute to the Violation Rating, which, if raised above 3, will automatically block the request.
137137

138-
However, setting the alarm and block to `true` will enforce block settings and App Protect will block any violating requests.
138+
To block violating requests, set the alarm and block to `true`.
139139

140-
See below example for more details:
141-
142-
```shell
140+
```json
143141
{
144142
"name": "graphql_policy",
145143
"template": {
@@ -175,25 +173,25 @@ See below example for more details:
175173
}
176174
```
177175

178-
### GraphQL Profile
176+
### GraphQL profile
179177

180-
{{< call-out "note" >}} For GraphQL profile default values and GraphQL violations reference, see NGINX App Protect WAF [Declarative Policy guide.]({{< ref "/nap-waf/v5/declarative-policy/policy.md" >}}) {{< /call-out >}}
178+
The GraphQL profile defines the GraphQL properties that are enforced by the security policy.
181179

182-
The GraphQL Profile defines the GraphQL properties that are enforced by the security policy.
180+
The profile can be added by the security engineers to make sure that GraphQL applications are bound to the same security settings defined in the profile.
183181

184-
The profile can be added by the security engineers to make sure that GraphQL apps are bound to the same security settings defined in the profile. Different GraphQL apps can have different profiles based on the security needs.
182+
Different GraphQL applications can have different profiles based on their security needs.
185183

186-
The GraphQL Profile includes:
184+
GraphQL profiles include:
187185

188-
- **Security enforcement**: whether to detect signatures and/or metacharacters and optionally an exception (a.k.a override) list of signatures that need to be disabled in the context of this profile.
189-
- **Defense attributes**: special restrictions applied to the GraphQL traffic. The below example shows the customized GraphQL properties.
190-
- **responseEnforcement**: whether to block Disallowed patterns and provide the list of patterns against the `disallowedPatterns` property.
186+
- **Security enforcement**: Whether to detect signatures and/or metacharacters and an optional override list of signatures that need to be disabled in the context of this profile.
187+
- **Defense attributes**: Special restrictions applied to the GraphQL traffic.
188+
- **responseEnforcement**: Whether to block Disallowed patterns and the list of patterns for the `disallowedPatterns` property.
191189

192-
GraphQL profile example:
190+
In the following GraphQL profile example, the "_defenseAttributes_" have been given custom values.
193191

194-
In the GraphQL profile example below, we changed the "defenseAttributes" to custom values. You can customize these values under the "defenseAttributes" property. Add a list of disallowed patterns to the "disallowedPatterns" field (for example, here we've added pattern1 and pattern2).
192+
You can also add a list of disallowed patterns to the "_disallowedPatterns_" field, also visible in the example:
195193

196-
```shell
194+
```json
197195
"graphql-profiles" : [
198196
{
199197
"attackSignaturesCheck" : true,
@@ -217,17 +215,17 @@ In the GraphQL profile example below, we changed the "defenseAttributes" to cust
217215
]
218216
```
219217

220-
### Define URL settings
218+
### URL settings
221219

222-
he second step to configure GraphQL is to define the URL settings. Set the values for "isAllowed": **true**, "name": **/graphql** in the URLs section, which means URLs with **/graphql** name are permitted. This path will be used for all GraphQL API requests.
220+
The second step to configure GraphQL is to define the URL settings. Set the values for "isAllowed": **true**, "name": **/graphql** in the URLs section, which means URLs with **/graphql** name are permitted. This path will be used for all GraphQL API requests.
223221

224222
Under the "urlContentProfiles" settings define the GraphQL profile name, headerValue: `*` (wildcard), headerName: `*` (wildcard), headerOrder: `default` (allowing any GraphQL URL request with any headerValue, headerName and type should be `graphql`.
225223

226224
There are no restrictions on the number of GraphQL profiles that can be added by the user.
227225

228226
GraphQL URL example:
229227

230-
```shell
228+
```json
231229
"urls": [
232230
{
233231
"$action": "delete",
@@ -257,15 +255,15 @@ GraphQL URL example:
257255
]
258256
```
259257

260-
### Associating GraphQL Profiles with URL
258+
### Associate GraphQL profiles with URLs
261259

262260
The last step is to associate the GraphQL profiles with the URLs. As with JSON and XML profiles, in order for a GraphQL Profile to become effective, it has to be associated with a URL that represents the service. Add the GraphQL profile name which you defined previously under the GraphQL profiles in the name field. For example, here we have defined two GraphQL profiles with the "name": "Default" and "My Custom Profile" under the urlContentProfiles. Later we also associated these profiles in "graphql-profiles".
263261

264262
GraphQL configuration example:
265263

266264
In this example we define a custom GraphQL profile and use it on one URL, while assigning the default profile to another one.
267265

268-
```shell
266+
```json
269267
{
270268
"name": "graphql_policy",
271269
"template": {
@@ -362,7 +360,7 @@ In this example we define a custom GraphQL profile and use it on one URL, while
362360
}
363361
```
364362

365-
### GraphQL Response Pages
363+
### Response pages
366364

367365
A GraphQL error response page is returned when a request is blocked. This GraphQL response page, like other blocking response pages, can be customized, but the GraphQL JSON syntax must be preserved for them to be displayed correctly. The default page returns the GraphQL status code Blocking Response Page (BRP) and a short JSON error message which includes the support ID.
368366

0 commit comments

Comments
 (0)