Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
4ed08ff7
Unverified
Commit
4ed08ff7
authored
2 years ago
by
Patrick Cloke
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Tighten the default rate limit of creating new devices. (#15135)
parent
6def779a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/15135.misc
+1
-0
1 addition, 0 deletions
changelog.d/15135.misc
docs/usage/configuration/config_documentation.md
+3
-3
3 additions, 3 deletions
docs/usage/configuration/config_documentation.md
synapse/config/ratelimiting.py
+11
-2
11 additions, 2 deletions
synapse/config/ratelimiting.py
with
15 additions
and
5 deletions
changelog.d/15135.misc
0 → 100644
+
1
−
0
View file @
4ed08ff7
Tighten the login ratelimit defaults.
This diff is collapsed.
Click to expand it.
docs/usage/configuration/config_documentation.md
+
3
−
3
View file @
4ed08ff7
...
...
@@ -1518,11 +1518,11 @@ rc_registration_token_validity:
This option specifies several limits for login
:
*
`
address` ratelimits login requests based on the client's IP
address. Defaults to `per_second
:
0.
17
`, `burst_count
:
3
`.
address. Defaults to `per_second
:
0.
003
`, `burst_count
:
5
`.
*
`
account` ratelimits login requests based on the account the
client is attempting to log into. Defaults to `per_second
:
0.
17
`,
`burst_count
:
3
`.
client is attempting to log into. Defaults to `per_second
:
0.
03
`,
`burst_count
:
5
`.
*
`
failed_attempts` ratelimits login requests based on the account the
client is attempting to log into, based on the amount of failed login
...
...
This diff is collapsed.
Click to expand it.
synapse/config/ratelimiting.py
+
11
−
2
View file @
4ed08ff7
...
...
@@ -87,9 +87,18 @@ class RatelimitConfig(Config):
defaults
=
{
"
per_second
"
:
0.1
,
"
burst_count
"
:
5
},
)
# It is reasonable to login with a bunch of devices at once (i.e. when
# setting up an account), but it is *not* valid to continually be
# logging into new devices.
rc_login_config
=
config
.
get
(
"
rc_login
"
,
{})
self
.
rc_login_address
=
RatelimitSettings
(
rc_login_config
.
get
(
"
address
"
,
{}))
self
.
rc_login_account
=
RatelimitSettings
(
rc_login_config
.
get
(
"
account
"
,
{}))
self
.
rc_login_address
=
RatelimitSettings
(
rc_login_config
.
get
(
"
address
"
,
{}),
defaults
=
{
"
per_second
"
:
0.003
,
"
burst_count
"
:
5
},
)
self
.
rc_login_account
=
RatelimitSettings
(
rc_login_config
.
get
(
"
account
"
,
{}),
defaults
=
{
"
per_second
"
:
0.003
,
"
burst_count
"
:
5
},
)
self
.
rc_login_failed_attempts
=
RatelimitSettings
(
rc_login_config
.
get
(
"
failed_attempts
"
,
{})
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment