Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WFE: Check NewOrder rate limits #7201

Merged
merged 13 commits into from
Jan 27, 2024
Merged

WFE: Check NewOrder rate limits #7201

merged 13 commits into from
Jan 27, 2024

Conversation

beautifulentropy
Copy link
Member

@beautifulentropy beautifulentropy commented Dec 8, 2023

Add non-blocking checks of New Order limits to the WFE using the new key-value based rate limits package.

Part of #5545

wfe2/wfe.go Outdated Show resolved Hide resolved
Copy link
Contributor

@beautifulentropy, this PR appears to contain configuration changes. Please ensure that a corresponding deployment ticket has been filed with the new configuration values.

@beautifulentropy
Copy link
Member Author

Added some TODOs and moved this back to draft until I get those done.

@beautifulentropy beautifulentropy marked this pull request as ready for review January 11, 2024 23:20
Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting this review because jsha is out today.

wfe2/wfe.go Outdated Show resolved Hide resolved
wfe2/wfe.go Outdated Show resolved Hide resolved
wfe2/wfe.go Outdated Show resolved Hide resolved
wfe2/wfe.go Outdated Show resolved Hide resolved
beautifulentropy added a commit that referenced this pull request Jan 17, 2024
Update RA and CA configuration to be more consistent with the identical
MaxNames field added to the WFE by #7201.
Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one optional improvement

var newOrderSuccessful bool
var errIsRateLimit bool
defer func() {
if !newOrderSuccessful && !errIsRateLimit {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here as on the other PR

beautifulentropy added a commit that referenced this pull request Jan 23, 2024
Make NewRegistration more consistent with the implementation in NewOrder
(#7201):
- Construct transactions just once,
- use batched spending instead of multiple spend calls, and
- do not attempt a refund for requests that fail due to RateLimit
errors.

Part of #5545
Copy link
Member

@pgporada pgporada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good other than the few nits which could be addressed later or never.

},
LookupDNSAuthority: "consul.service.consul",
}
rc.PasswordConfig = cmd.PasswordConfig{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: You could include the PasswordConfig in the bredis.Config above.

			LookupDNSAuthority: "consul.service.consul",
			PasswordConfig: cmd.PasswordConfig{
				PasswordFile: "test/secrets/ratelimits_redis_password",
			},
		}

// defaults to 100. These limits are per section 7.1 of our combined
// CP/CPS, under "DV-SSL Subscriber Certificate". The value must match
// the CA and RA configurations.
MaxNames int `validate:"min=0,max=100"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I understand that the validation tag catches this, but MaxNames could be declared as a uint instead. A minor type changes would be needed in the NewWebFrontEndImpl constructor and WebFrontEndImpl struct.

@beautifulentropy beautifulentropy merged commit 97a19b1 into main Jan 27, 2024
19 checks passed
@beautifulentropy beautifulentropy deleted the ratelimits-new-order branch January 27, 2024 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants