Skip to content

Commit 6dbb2e2

Browse files
committed
Rename old submission flags and rate limiters
1 parent c69d0f1 commit 6dbb2e2

File tree

14 files changed

+59
-59
lines changed

14 files changed

+59
-59
lines changed

cmd/tesseract/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ means no upper bound on the accepted range. RFC3339 UTC format, e.g:
5454
signing algorithms. This flag is a temporary solution to allow chains submitted
5555
by Chrome's Merge Delay Monitor Root. It will eventually be removed and chains
5656
using such algorithms will be rejected.
57-
- `limit_old_submissions`: This optional flag can be set define a limit on how
57+
- `rate_limit_old_not_before`: This optional flag can be set define a limit on how
5858
many "old" certificates and precertificates will be accepted per second.
5959
The flag value should be of the form `<age>:<limit>`, where `<limit>` is a
6060
per-second rate limit, and `<age>` defines how old a given submission's

cmd/tesseract/aws/main.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var (
7070
rejectExtensions = flag.String("reject_extension", "", "A list of X.509 extension OIDs, in dotted string form (e.g. '2.3.4.5') which, if present, should cause submissions to be rejected.")
7171
acceptSHA1 = flag.Bool("accept_sha1_signing_algorithms", true, "If true, accept chains that use SHA-1 based signing algorithms. This flag will eventually be removed, and such algorithms will be rejected.")
7272
enablePublicationAwaiter = flag.Bool("enable_publication_awaiter", true, "If true then the certificate is integrated into log before returning the response.")
73-
limitOldCerts = flag.String("limit_old_submissions", "", "Optionally rate limits submissions with old notBefore dates. Expects a value of with the format: \"<go duration>:<rate limit>\", e.g. \"30d:50\" would impose a limit of 50 certs/s on submissions whose notBefore date is >= 30days old.")
73+
notBeforeRL = flag.String("rate_limit_old_not_before", "", "Optionally rate limits submissions with old notBefore dates. Expects a value of with the format: \"<go duration>:<rate limit>\", e.g. \"30d:50\" would impose a limit of 50 certs/s on submissions whose notBefore date is >= 30days old.")
7474

7575
// Performance flags
7676
httpDeadline = flag.Duration("http_deadline", time.Second*10, "Deadline for HTTP requests.")
@@ -140,8 +140,8 @@ eventually go away. See /internal/lax509/README.md for more information.`)
140140
}
141141

142142
hOpts := tesseract.LogHandlerOpts{
143-
OldSubmissionLimit: rateLimitFromFlags(),
144-
DedupRL: dedupRL,
143+
NotBeforeRL: notBeforeRLFromFlags(),
144+
DedupRL: dedupRL,
145145
}
146146
logHandler, err := tesseract.NewLogHandler(ctx, *origin, signer, chainValidationConfig, newAWSStorage, *httpDeadline, *maskInternalErrors, *pathPrefix, hOpts)
147147
if err != nil {
@@ -362,21 +362,21 @@ func antispamMySQLConfig() *mysql.Config {
362362
}
363363
}
364364

365-
func rateLimitFromFlags() *tesseract.OldSubmissionLimit {
366-
if *limitOldCerts == "" {
365+
func notBeforeRLFromFlags() *tesseract.NotBeforeRL {
366+
if *notBeforeRL == "" {
367367
return nil
368368
}
369-
bits := strings.Split(*limitOldCerts, ":")
369+
bits := strings.Split(*notBeforeRL, ":")
370370
if len(bits) != 2 {
371-
klog.Exitf("Invalid format for --limit_old_submissions flag")
371+
klog.Exitf("Invalid format for --rate_limit_old_not_before flag")
372372
}
373373
a, err := time.ParseDuration(bits[0])
374374
if err != nil {
375-
klog.Exitf("Invalid age passed to --limit_old_submissions flag %q: %v", bits[0], err)
375+
klog.Exitf("Invalid age passed to --rate_limit_old_not_before flag %q: %v", bits[0], err)
376376
}
377377
l, err := strconv.ParseFloat(bits[1], 64)
378378
if err != nil {
379-
klog.Exitf("Invalid rate limit passed to --limit_old_submissions %q: %v", bits[1], err)
379+
klog.Exitf("Invalid rate limit passed to --rate_limit_old_not_before %q: %v", bits[1], err)
380380
}
381-
return &tesseract.OldSubmissionLimit{AgeThreshold: a, RateLimit: l}
381+
return &tesseract.NotBeforeRL{AgeThreshold: a, RateLimit: l}
382382
}

cmd/tesseract/gcp/main.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ var (
7171
acceptSHA1 = flag.Bool("accept_sha1_signing_algorithms", true, "If true, accept chains that use SHA-1 based signing algorithms. This flag will eventually be removed, and such algorithms will be rejected.")
7272
enablePublicationAwaiter = flag.Bool("enable_publication_awaiter", true, "If true then the certificate is integrated into log before returning the response.")
7373
witnessPolicyFile = flag.String("witness_policy_file", "", "(Optional) Path to the file containing the witness policy in the format described at https://git.glasklar.is/sigsum/core/sigsum-go/-/blob/main/doc/policy.md")
74-
limitOldCerts = flag.String("limit_old_submissions", "", "Optionally rate limits submissions with old notBefore dates. Expects a value of with the format: \"<go duration>:<rate limit>\", e.g. \"30d:50\" would impose a limit of 50 certs/s on submissions whose notBefore date is >= 30days old.")
74+
notBeforeRL = flag.String("rate_limit_old_not_before", "", "Optionally rate limits submissions with old notBefore dates. Expects a value of with the format: \"<go duration>:<rate limit>\", e.g. \"30d:50\" would impose a limit of 50 certs/s on submissions whose notBefore date is >= 30days old.")
7575

7676
// Performance flags
7777
httpDeadline = flag.Duration("http_deadline", time.Second*10, "Deadline for HTTP requests.")
@@ -127,8 +127,8 @@ eventually go away. See /internal/lax509/README.md for more information.`)
127127
}
128128

129129
hOpts := tesseract.LogHandlerOpts{
130-
OldSubmissionLimit: rateLimitFromFlags(),
131-
DedupRL: dedupRL,
130+
NotBeforeRL: notBeforeRLFromFlags(),
131+
DedupRL: dedupRL,
132132
}
133133
logHandler, err := tesseract.NewLogHandler(ctx, *origin, signer, chainValidationConfig, newGCPStorage, *httpDeadline, *maskInternalErrors, *pathPrefix, hOpts)
134134
if err != nil {
@@ -314,21 +314,21 @@ func (t *timestampFlag) Set(w string) error {
314314
return nil
315315
}
316316

317-
func rateLimitFromFlags() *tesseract.OldSubmissionLimit {
318-
if *limitOldCerts == "" {
317+
func notBeforeRLFromFlags() *tesseract.NotBeforeRL {
318+
if *notBeforeRL == "" {
319319
return nil
320320
}
321-
bits := strings.Split(*limitOldCerts, ":")
321+
bits := strings.Split(*notBeforeRL, ":")
322322
if len(bits) != 2 {
323-
klog.Exitf("Invalid format for --limit_old_submissions flag")
323+
klog.Exitf("Invalid format for --rate_limit_old_not_before flag")
324324
}
325325
a, err := time.ParseDuration(bits[0])
326326
if err != nil {
327-
klog.Exitf("Invalid age passed to --limit_old_submissions flag %q: %v", bits[0], err)
327+
klog.Exitf("Invalid age passed to --rate_limit_old_not_before flag %q: %v", bits[0], err)
328328
}
329329
l, err := strconv.ParseFloat(bits[1], 64)
330330
if err != nil {
331-
klog.Exitf("Invalid rate limit passed to --limit_old_submissions %q: %v", bits[1], err)
331+
klog.Exitf("Invalid rate limit passed to --rate_limit_old_not_before %q: %v", bits[1], err)
332332
}
333-
return &tesseract.OldSubmissionLimit{AgeThreshold: a, RateLimit: l}
333+
return &tesseract.NotBeforeRL{AgeThreshold: a, RateLimit: l}
334334
}

cmd/tesseract/posix/main.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ var (
7474
acceptSHA1 = flag.Bool("accept_sha1_signing_algorithms", true, "If true, accept chains that use SHA-1 based signing algorithms. This flag will eventually be removed, and such algorithms will be rejected.")
7575
enablePublicationAwaiter = flag.Bool("enable_publication_awaiter", true, "If true then the certificate is integrated into log before returning the response.")
7676
witnessPolicyFile = flag.String("witness_policy_file", "", "(Optional) Path to the file containing the witness policy in the format describe at https://git.glasklar.is/sigsum/core/sigsum-go/-/blob/main/doc/policy.md")
77-
limitOldCerts = flag.String("limit_old_submissions", "", "Optionally rate limits submissions with old notBefore dates. Expects a value of with the format: \"<go duration>:<rate limit>\", e.g. \"30d:50\" would impose a limit of 50 certs/s on submissions whose notBefore date is >= 30days old.")
77+
notBeforeRL = flag.String("rate_limit_old_not_before", "", "Optionally rate limits submissions with old notBefore dates. Expects a value of with the format: \"<go duration>:<rate limit>\", e.g. \"30d:50\" would impose a limit of 50 certs/s on submissions whose notBefore date is >= 30days old.")
7878

7979
// Performance flags
8080
httpDeadline = flag.Duration("http_deadline", time.Second*10, "Deadline for HTTP requests.")
@@ -120,8 +120,8 @@ eventually go away. See /internal/lax509/README.md for more information.`)
120120
}
121121

122122
hOpts := tesseract.LogHandlerOpts{
123-
OldSubmissionLimit: rateLimitFromFlags(),
124-
DedupRL: dedupRL,
123+
NotBeforeRL: notBeforeRLFromFlags(),
124+
DedupRL: dedupRL,
125125
}
126126
logHandler, err := tesseract.NewLogHandler(ctx, *origin, signer, chainValidationConfig, newStorage, *httpDeadline, *maskInternalErrors, *pathPrefix, hOpts)
127127
if err != nil {
@@ -338,21 +338,21 @@ func (ms *multiStringFlag) Set(w string) error {
338338
return nil
339339
}
340340

341-
func rateLimitFromFlags() *tesseract.OldSubmissionLimit {
342-
if *limitOldCerts == "" {
341+
func notBeforeRLFromFlags() *tesseract.NotBeforeRL {
342+
if *notBeforeRL == "" {
343343
return nil
344344
}
345-
bits := strings.Split(*limitOldCerts, ":")
345+
bits := strings.Split(*notBeforeRL, ":")
346346
if len(bits) != 2 {
347-
klog.Exitf("Invalid format for --limit_old_submissions flag")
347+
klog.Exitf("Invalid format for --rate_limit_old_not_before flag")
348348
}
349349
a, err := time.ParseDuration(bits[0])
350350
if err != nil {
351-
klog.Exitf("Invalid age passed to --limit_old_submissions flag %q: %v", bits[0], err)
351+
klog.Exitf("Invalid age passed to --rate_limit_old_not_before flag %q: %v", bits[0], err)
352352
}
353353
l, err := strconv.ParseFloat(bits[1], 64)
354354
if err != nil {
355-
klog.Exitf("Invalid rate limit passed to --limit_old_submissions %q: %v", bits[1], err)
355+
klog.Exitf("Invalid rate limit passed to --rate_limit_old_not_before %q: %v", bits[1], err)
356356
}
357-
return &tesseract.OldSubmissionLimit{AgeThreshold: a, RateLimit: l}
357+
return &tesseract.NotBeforeRL{AgeThreshold: a, RateLimit: l}
358358
}

ctlog.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ func newChainValidator(cfg ChainValidationConfig) (ct.ChainValidator, error) {
124124
}
125125

126126
// OldSubmissionOpts
127-
type OldSubmissionLimit struct {
127+
type NotBeforeRL struct {
128128
AgeThreshold time.Duration
129129
RateLimit float64
130130
}
131131

132132
type LogHandlerOpts struct {
133-
OldSubmissionLimit *OldSubmissionLimit
134-
DedupRL float64
133+
NotBeforeRL *NotBeforeRL
134+
DedupRL float64
135135
}
136136

137137
// NewLogHandler creates a Tessera based CT log pluged into HTTP handlers.
@@ -160,8 +160,8 @@ func NewLogHandler(ctx context.Context, origin string, signer crypto.Signer, cfg
160160
TimeSource: sysTimeSource,
161161
PathPrefix: pathPrefix,
162162
}
163-
if opts.OldSubmissionLimit != nil {
164-
ctOpts.RateLimits.OldSubmission(opts.OldSubmissionLimit.AgeThreshold, opts.OldSubmissionLimit.RateLimit)
163+
if opts.NotBeforeRL != nil {
164+
ctOpts.RateLimits.NotBefore(opts.NotBeforeRL.AgeThreshold, opts.NotBeforeRL.RateLimit)
165165
}
166166
if opts.DedupRL >= 0 {
167167
ctOpts.RateLimits.Dedup(opts.DedupRL)

deployment/live/gcp/static-ct-staging/logs/arche2025h1/terragrunt.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ locals {
1414
trace_fraction = 0.1
1515
create_internal_load_balancer = true
1616
public_bucket = true
17-
limit_old_submissions = "28h:150"
17+
rate_limit_old_not_before = "28h:150"
1818
}
1919

2020
include "root" {

deployment/live/gcp/static-ct-staging/logs/arche2025h2/terragrunt.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ locals {
1515
create_internal_load_balancer = true
1616
public_bucket = true
1717
machine_type = "n2-standard-8"
18-
limit_old_submissions = "28h:150"
18+
rate_limit_old_not_before = "28h:150"
1919
}
2020

2121
include "root" {

deployment/live/gcp/static-ct-staging/logs/arche2026h1/terragrunt.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ locals {
1414
trace_fraction = 0.1
1515
create_internal_load_balancer = true
1616
public_bucket = true
17-
limit_old_submissions = "28h:150"
17+
rate_limit_old_not_before = "28h:150"
1818
}
1919

2020
include "root" {

deployment/modules/gcp/gce/tesseract/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module "gce_container_tesseract" {
4040
"--batch_max_age=${var.batch_max_age}",
4141
"--enable_publication_awaiter=${var.enable_publication_awaiter}",
4242
"--accept_sha1_signing_algorithms=true",
43-
"--limit_old_submissions=${var.limit_old_submissions}",
43+
"--rate_limit_old_not_before=${var.rate_limit_old_not_before}",
4444
"--rate_limit_dedup=${var.rate_limit_dedup}"
4545
]
4646
tty : true # maybe remove this

deployment/modules/gcp/gce/tesseract/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ variable "enable_publication_awaiter" {
100100
default = true
101101
}
102102

103-
variable "limit_old_submissions" {
104-
description = "Set to configure rate limiting for old submissions. See --limit_old_submissions flag for format."
103+
variable "rate_limit_old_not_before" {
104+
description = "Set to configure rate limiting for old submissions. See --rate_limit_old_not_before flag for format."
105105
type = string
106106
default = ""
107107
}

0 commit comments

Comments
 (0)