Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cluster/configs/shared/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,12 @@ cloudArmor:
pathPrefix: /api/scan
throttleAcrossAllEndpointsAllIps:
withinIntervalSeconds: 60
maxRequestsBeforeHttp429: 0
maxRequestsBeforeHttp429: 0 # Keeps scan completely closed to the public
tokenRegistry:
pathPrefix: /registry
throttleAcrossAllEndpointsAllIps:
withinIntervalSeconds: 60
maxRequestsBeforeHttp429: 200
Comment thread
pasindutennage-da marked this conversation as resolved.
multiValidator:
postgresPvcSize: '100Gi'
resources:
Expand All @@ -241,7 +246,7 @@ multiValidator:
sv:
scan:
externalRateLimits:
!include(./rate-limits/v0-acs.yaml;./rate-limits/unlimited.yaml;./rate-limits/public-banned.yaml)
!include(./rate-limits/v0-acs.yaml;./rate-limits/unlimited.yaml;./rate-limits/public-banned.yaml;./rate-limits/token-registry.yaml)
globalLimits:
maxTokens: 2147483647
tokensPerFill: 2147483647
Expand Down
43 changes: 43 additions & 0 deletions cluster/configs/shared/rate-limits/token-registry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
rateLimits:
/registry/allocations/v1:
name: registry-allocations
type: limited
clientIp: true
maxTokens: 10
tokensPerFill: 5
fillInterval: 60s
/registry/metadata/v1/info:
name: registry-metadata-info
type: limited
clientIp: true
maxTokens: 10
tokensPerFill: 5
fillInterval: 60s
/registry/metadata/v1/instruments:
name: registry-metadata-instruments
type: limited
clientIp: true
maxTokens: 10
tokensPerFill: 5
fillInterval: 60s
/registry/allocation-instruction/v1/allocation-factory:
name: registry-allocation-factory
type: limited
clientIp: true
maxTokens: 10
tokensPerFill: 5
fillInterval: 60s
/registry/transfer-instruction/v1:
name: registry-transfer-instruction
type: limited
clientIp: true
maxTokens: 10
tokensPerFill: 5
fillInterval: 60s
/registry/transfer-instruction/v1/transfer-factory:
name: registry-transfer-factory
type: limited
clientIp: true
maxTokens: 10
tokensPerFill: 5
fillInterval: 60s
1 change: 1 addition & 0 deletions cluster/configs/shared/rate-limits/v0-acs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ rateLimits:
maxTokens: 10
tokensPerFill: 5
fillInterval: 60s

47 changes: 47 additions & 0 deletions cluster/deployment/scratchneta/config.resolved.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ cloudArmor:
throttleAcrossAllEndpointsAllIps:
maxRequestsBeforeHttp429: 0
withinIntervalSeconds: 60
tokenRegistry:
pathPrefix: '/registry'
throttleAcrossAllEndpointsAllIps:
maxRequestsBeforeHttp429: 200
withinIntervalSeconds: 60
cluster:
hyperdiskSupport:
enabled: true
Expand Down Expand Up @@ -354,6 +359,48 @@ sv:
/api/scan/version:
name: 'version'
type: 'unlimited'
/registry/allocation-instruction/v1/allocation-factory:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-allocation-factory'
tokensPerFill: 5
type: 'limited'
/registry/allocations/v1:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-allocations'
tokensPerFill: 5
type: 'limited'
/registry/metadata/v1/info:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-metadata-info'
tokensPerFill: 5
type: 'limited'
/registry/metadata/v1/instruments:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-metadata-instruments'
tokensPerFill: 5
type: 'limited'
/registry/transfer-instruction/v1:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-transfer-instruction'
tokensPerFill: 5
type: 'limited'
/registry/transfer-instruction/v1/transfer-factory:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-transfer-factory'
tokensPerFill: 5
type: 'limited'
svs:
sv:
cometbft:
Expand Down
47 changes: 47 additions & 0 deletions cluster/deployment/scratchnetb/config.resolved.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ cloudArmor:
throttleAcrossAllEndpointsAllIps:
maxRequestsBeforeHttp429: 0
withinIntervalSeconds: 60
tokenRegistry:

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.

you're enabling a global cloud armor limit but cloud armor is disabled. I was expecting we try to solve this in istio for now, is that not an option?

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.

try setting the limit low enough that you can easily trigger it during testing and see that you trigger it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @moritzkiefer-da @nicu-da

Sure, will check in scratchnet with low limits.

I have a question about the scope:: As of now, we allow an endpoint to have either a per-IP token bucket (clientIp: true) or a global shared bucket. These two types are mutually exclusive. #5651 asks for both global limits and per-IP limits, AFAICU. Since Cloud Armor isn't available, we can't achieve both without refactoring the Pulumi rate limit logic to map two separate descriptors to a single route/path.

For this PR, should I stick to clientIp: true for all token endpoints (and hence no global limits), or just have global limits? or should I first refactor rate limiting logic to support both options for given end point? (sounds like different PR)

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.

can you check with Stephen when we expect cloud armor to be enabled? If the answer is soon we can maybe wait for that, if not then we do need to refactor our istio limits.

pathPrefix: '/registry'
throttleAcrossAllEndpointsAllIps:
maxRequestsBeforeHttp429: 200
withinIntervalSeconds: 60
cluster:
hyperdiskSupport:
enabled: true
Expand Down Expand Up @@ -354,6 +359,48 @@ sv:
/api/scan/version:
name: 'version'
type: 'unlimited'
/registry/allocation-instruction/v1/allocation-factory:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-allocation-factory'
tokensPerFill: 5
type: 'limited'
/registry/allocations/v1:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-allocations'
tokensPerFill: 5
type: 'limited'
/registry/metadata/v1/info:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-metadata-info'
tokensPerFill: 5
type: 'limited'
/registry/metadata/v1/instruments:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-metadata-instruments'
tokensPerFill: 5
type: 'limited'
/registry/transfer-instruction/v1:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-transfer-instruction'
tokensPerFill: 5
type: 'limited'
/registry/transfer-instruction/v1/transfer-factory:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-transfer-factory'
tokensPerFill: 5
type: 'limited'
svs:
sv:
cometbft:
Expand Down
47 changes: 47 additions & 0 deletions cluster/deployment/scratchnetc/config.resolved.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ cloudArmor:
throttleAcrossAllEndpointsAllIps:
maxRequestsBeforeHttp429: 0
withinIntervalSeconds: 60
tokenRegistry:
pathPrefix: '/registry'
throttleAcrossAllEndpointsAllIps:
maxRequestsBeforeHttp429: 200
withinIntervalSeconds: 60
cluster:
hyperdiskSupport:
enabled: true
Expand Down Expand Up @@ -354,6 +359,48 @@ sv:
/api/scan/version:
name: 'version'
type: 'unlimited'
/registry/allocation-instruction/v1/allocation-factory:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-allocation-factory'
tokensPerFill: 5
type: 'limited'
/registry/allocations/v1:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-allocations'
tokensPerFill: 5
type: 'limited'
/registry/metadata/v1/info:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-metadata-info'
tokensPerFill: 5
type: 'limited'
/registry/metadata/v1/instruments:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-metadata-instruments'
tokensPerFill: 5
type: 'limited'
/registry/transfer-instruction/v1:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-transfer-instruction'
tokensPerFill: 5
type: 'limited'
/registry/transfer-instruction/v1/transfer-factory:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-transfer-factory'
tokensPerFill: 5
type: 'limited'
svs:
sv:
cometbft:
Expand Down
47 changes: 47 additions & 0 deletions cluster/deployment/scratchnetd/config.resolved.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ cloudArmor:
throttleAcrossAllEndpointsAllIps:
maxRequestsBeforeHttp429: 0
withinIntervalSeconds: 60
tokenRegistry:
pathPrefix: '/registry'
throttleAcrossAllEndpointsAllIps:
maxRequestsBeforeHttp429: 200
withinIntervalSeconds: 60
cluster:
hyperdiskSupport:
enabled: true
Expand Down Expand Up @@ -354,6 +359,48 @@ sv:
/api/scan/version:
name: 'version'
type: 'unlimited'
/registry/allocation-instruction/v1/allocation-factory:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-allocation-factory'
tokensPerFill: 5
type: 'limited'
/registry/allocations/v1:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-allocations'
tokensPerFill: 5
type: 'limited'
/registry/metadata/v1/info:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-metadata-info'
tokensPerFill: 5
type: 'limited'
/registry/metadata/v1/instruments:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-metadata-instruments'
tokensPerFill: 5
type: 'limited'
/registry/transfer-instruction/v1:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-transfer-instruction'
tokensPerFill: 5
type: 'limited'
/registry/transfer-instruction/v1/transfer-factory:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-transfer-factory'
tokensPerFill: 5
type: 'limited'
svs:
sv:
cometbft:
Expand Down
47 changes: 47 additions & 0 deletions cluster/deployment/scratchnete/config.resolved.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ cloudArmor:
throttleAcrossAllEndpointsAllIps:
maxRequestsBeforeHttp429: 0
withinIntervalSeconds: 60
tokenRegistry:
pathPrefix: '/registry'
throttleAcrossAllEndpointsAllIps:
maxRequestsBeforeHttp429: 200
withinIntervalSeconds: 60
cluster:
hyperdiskSupport:
enabled: true
Expand Down Expand Up @@ -354,6 +359,48 @@ sv:
/api/scan/version:
name: 'version'
type: 'unlimited'
/registry/allocation-instruction/v1/allocation-factory:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-allocation-factory'
tokensPerFill: 5
type: 'limited'
/registry/allocations/v1:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-allocations'
tokensPerFill: 5
type: 'limited'
/registry/metadata/v1/info:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-metadata-info'
tokensPerFill: 5
type: 'limited'
/registry/metadata/v1/instruments:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-metadata-instruments'
tokensPerFill: 5
type: 'limited'
/registry/transfer-instruction/v1:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-transfer-instruction'
tokensPerFill: 5
type: 'limited'
/registry/transfer-instruction/v1/transfer-factory:
clientIp: true
fillInterval: '60s'
maxTokens: 10
name: 'registry-transfer-factory'
tokensPerFill: 5
type: 'limited'
svs:
sv:
cometbft:
Expand Down
Loading
Loading