Skip to content

Commit 5387c55

Browse files
Finish how to draft, fix config
Signed-off-by: Diana <75819066+cloudjumpercat@users.noreply.github.com>
1 parent 025d2e0 commit 5387c55

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

app/_how-tos/protect-against-brute-force-attacks.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,12 @@ entities:
8585
config:
8686
hide_credentials: true
8787
brute_force_protection:
88-
strategy: redis
89-
redis:
88+
strategy: redis
89+
redis:
9090
host: ${redis_host}
9191
port: 6379
9292
database: 0
93-
connect_timeout: 2000
9493
timeout: 2000
95-
password: ${redis_password}
9694
ssl: false
9795
ssl_verify: false
9896
variables:
@@ -106,7 +104,7 @@ variables:
106104

107105
When a Consumer authenticates with basic auth, the authorization header must be base64-encoded. For example, since we are using `jsmith` as the username and `my-password` as the password, then the field’s value is the base64 encoding of `jsmith:my-password`, or `anNtaXRoOm15LXBhc3N3b3Jk`.
108106

109-
First, run the following to verify that unauthorized requests return an error:
107+
Run the following three times to verify that unauthorized requests return a `429` error after the third attempt:
110108

111109
<!--vale off-->
112110
{% validation unauthorized-check %}

app/_kong_plugins/basic-auth/examples/brute-force-protection.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ config:
1414
brute_force_protection:
1515
strategy: redis
1616
redis:
17-
host: 127.0.0.1
17+
host: ${redis_host}
1818
port: 6379
1919
database: 0
20-
connect_timeout: 2000
2120
timeout: 2000
22-
password: your-redis-password
2321
ssl: false
2422
ssl_verify: false
23+
variables:
24+
redis_host:
25+
value: $REDIS_HOST
26+
redis_password:
27+
value: $REDIS_PASSWORD
2528

2629
tools:
2730
- deck

0 commit comments

Comments
 (0)