Skip to content

WFE: Check NewOrder rate limits#7201

Merged
beautifulentropy merged 13 commits into
mainfrom
ratelimits-new-order
Jan 27, 2024
Merged

WFE: Check NewOrder rate limits#7201
beautifulentropy merged 13 commits into
mainfrom
ratelimits-new-order

Conversation

@beautifulentropy

@beautifulentropy beautifulentropy commented Dec 8, 2023

Copy link
Copy Markdown
Member

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

Part of #5545

Comment thread wfe2/wfe.go Outdated
@github-actions

Copy link
Copy Markdown
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 beautifulentropy marked this pull request as draft December 20, 2023 16:44
@beautifulentropy

Copy link
Copy Markdown
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

@aarongable aarongable left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread wfe2/wfe.go Outdated
Comment thread wfe2/wfe.go Outdated
Comment thread wfe2/wfe.go Outdated
Comment thread wfe2/wfe.go Outdated
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.

@aarongable aarongable left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread wfe2/wfe.go
var newOrderSuccessful bool
var errIsRateLimit bool
defer func() {
if !newOrderSuccessful && !errIsRateLimit {

Copy link
Copy Markdown
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

@pgporada pgporada left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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",
			},
		}

Comment thread cmd/boulder-wfe2/main.go
// 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
Copy Markdown
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
@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