Skip to content

Commit e3597ae

Browse files
committed
cleanup unnecessary data
1 parent 9cd22ed commit e3597ae

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

cmd/ctmon-ingest/main.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,25 +411,24 @@ func ingestBatch(db *sql.DB, batch []*CertificateDetails) error {
411411

412412
query := `
413413
INSERT INTO ct_log_entries (
414-
log_id, log_index, retrieval_timestamp, leaf_input, extra_data,
414+
log_id, log_index, retrieval_timestamp, leaf_input,
415415
entry_timestamp, entry_type, certificate_sha256, tbs_certificate_sha256,
416416
not_before, not_after, subject_common_name, subject_organization,
417417
subject_alternative_names, issuer_common_name, issuer_organization,
418-
serial_number, is_ca, precert_issuer_key_hash, raw_leaf_certificate_der
418+
serial_number, is_ca, precert_issuer_key_hash
419419
) VALUES
420420
`
421421

422422
var values []string
423423
var args []interface{}
424424

425425
for _, details := range batch {
426-
values = append(values, "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")
426+
values = append(values, "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")
427427
args = append(args,
428428
details.LogID,
429429
details.LogIndex,
430430
details.RetrievalTimestamp,
431431
details.LeafInputBase64,
432-
details.ExtraDataBase64,
433432
details.EntryTimestamp,
434433
details.EntryType,
435434
details.CertificateSHA256,
@@ -444,7 +443,6 @@ func ingestBatch(db *sql.DB, batch []*CertificateDetails) error {
444443
details.SerialNumber,
445444
boolToUint8(details.IsCA),
446445
nullableString(details.PrecertIssuerKeyHash),
447-
details.RawLeafCertificateDERBase64,
448446
)
449447
}
450448

schema.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ CREATE TABLE ct_log_entries
66
retrieval_timestamp DateTime DEFAULT now() COMMENT 'Timestamp when the entry was fetched and ingested into ClickHouse',
77

88
-- Raw CT Log Data (as returned by the get-entries endpoint)
9-
leaf_input String COMMENT 'Base64 encoded MerkleTreeLeaf structure from the log entry',
10-
extra_data String COMMENT 'Base64 encoded extra data from the log entry (e.g., certificate chain)',
9+
leaf_input String COMMENT 'Base64 encoded MerkleTreeLeaf structure from the log entry' CODEC(ZSTD(1)),
10+
extra_data String DEFAULT '' COMMENT 'Base64 encoded extra data from the log entry (e.g., certificate chain)',
1111

1212
-- Parsed from MerkleTreeLeaf -> TimestampedEntry
1313
entry_timestamp DateTime COMMENT 'Timestamp from the TimestampedEntry (milliseconds since epoch, converted to DateTime)',
@@ -64,7 +64,7 @@ CREATE TABLE ct_log_entries
6464
precert_poison_extension_present UInt8 DEFAULT 0 COMMENT 'Boolean (0 or 1) indicating if the X.509v3 Precertificate Poison extension is present',
6565

6666
-- Stored Raw Certificate (optional, for full reprocessing capability)
67-
raw_leaf_certificate_der String COMMENT 'Base64 encoded DER of the leaf certificate itself (extracted from leaf_input)',
67+
raw_leaf_certificate_der String DEFAULT '' COMMENT 'Base64 encoded DER of the leaf certificate itself (extracted from leaf_input)',
6868

6969
-- PROJECTION for SAN lookups (optional, for performance)
7070
-- PROJECTION san_projection (

ui/app/api/certificate/[sha256]/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export async function GET(
6161
WHERE certificate_sha256 = {sha256:String}
6262
AND entry_type = 'x509_entry'
6363
ORDER BY not_after DESC
64+
SETTINGS max_execution_time = 30, max_threads = 1, max_memory_usage = 134217728
6465
`;
6566

6667
const resultSet = await client.query({

ui/app/search/[domain]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async function getSearchResults(
7575
AND entry_type = 'x509_entry'
7676
ORDER BY not_after DESC
7777
LIMIT {limit:UInt32}
78-
SETTINGS max_execution_time = 30, max_memory_usage = 134217728
78+
SETTINGS max_execution_time = 30, max_threads = 1, max_memory_usage = 134217728
7979
`;
8080

8181
const resultSet = await client.query({

0 commit comments

Comments
 (0)