123 KiB
ct_lineage_report.py
Source file: ct_lineage_report.py
Historical analyzer. This file studies expired plus current certificates to find renewals, overlap, drift, and issuance bursts over time.
Main flow in one line: historical CT rows -> historical certificates -> grouped by Subject CN -> overlap and drift checks -> red flags
How to read this page:
- left side: the actual source code block
- right side: a plain-English explanation for a beginner
- read from top to bottom because later blocks depend on earlier ones
Module setup
|
What this block is doing Historical query logic, data structures, and red-flag rules for certificate lifecycle analysis. Flow arrows Earlier blocks or operator input feed this block. → Module setup → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
HistoricalCertificate
|
What this block is doing One certificate in the full time-based dataset, including expired ones. Flow arrows Earlier blocks or operator input feed this block. → HistoricalCertificate → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
CnCollisionRow
|
What this block is doing A table row for Subject-DN drift or issuer drift under the same Subject CN. Flow arrows Earlier blocks or operator input feed this block. → CnCollisionRow → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
SanChangeRow
|
What this block is doing A table row that describes SAN-profile change for one Subject CN. Flow arrows Earlier blocks or operator input feed this block. → SanChangeRow → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
StartDayRow
|
What this block is doing This class is a structured container for one piece of data that later code passes around instead of juggling many loose variables. Flow arrows Earlier blocks or operator input feed this block. → StartDayRow → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
StepWeekRow
|
What this block is doing This class is a structured container for one piece of data that later code passes around instead of juggling many loose variables. Flow arrows Earlier blocks or operator input feed this block. → StepWeekRow → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
OverlapRow
|
What this block is doing A table row describing long predecessor/successor overlap. Flow arrows Earlier blocks or operator input feed this block. → OverlapRow → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
RedFlagRow
|
What this block is doing A compact summary row for names worth attention. Flow arrows Earlier blocks or operator input feed this block. → RedFlagRow → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
HistoricalAssessment
|
What this block is doing The full historical analysis bundle used by the monograph. Flow arrows Earlier blocks or operator input feed this block. → HistoricalAssessment → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
parse_args
|
What this block is doing This block defines the command-line knobs for the file: input paths, cache settings, output paths, and other runtime switches. Flow arrows Earlier blocks or operator input feed this block. → parse_args → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
short_issuer
|
What this block is doing This function is one of the building blocks inside `ct_lineage_report.py`. It exists so the file can do one narrow job at a time instead of one giant unreadable routine. Flow arrows Earlier blocks or operator input feed this block. → short_issuer → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
pct
|
What this block is doing This is a small helper that keeps the larger analytical code cleaner and easier to reuse. Flow arrows Earlier blocks or operator input feed this block. → pct → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
md_table
|
What this block is doing This function is one of the building blocks inside `ct_lineage_report.py`. It exists so the file can do one narrow job at a time instead of one giant unreadable routine. Flow arrows Earlier blocks or operator input feed this block. → md_table → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
extract_common_name
|
What this block is doing This block pulls one specific piece of information out of a larger object. Flow arrows Earlier blocks or operator input feed this block. → extract_common_name → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
query_historical_domain
|
What this block is doing Fetches the wider historical corpus for one search term. Flow arrows A configured search domain. → query_historical_domain → `load_records` uses it to build the wider historical corpus. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
load_records
|
What this block is doing This block loads data from disk, cache, or an earlier stage so later code can work with it. Flow arrows Earlier blocks or operator input feed this block. → load_records → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
build_certificates
|
What this block is doing Converts raw DB rows into historical working objects. Flow arrows Historical `DatabaseRecord` rows. → build_certificates → `group_by_subject_cn` and all drift checks consume these normalized historical certificates. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
group_by_subject_cn
|
What this block is doing This block clusters related items together so later code can analyze them as families instead of as isolated rows. Flow arrows Historical certificates. → group_by_subject_cn → `dn_change_rows`, `issuer_change_rows`, `san_change_rows`, and `overlap_rows` all work off this grouping. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
summarize_name_list
|
What this block is doing This block compresses many detailed rows into a smaller, easier-to-read summary. Flow arrows Earlier blocks or operator input feed this block. → summarize_name_list → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
family_counter
|
What this block is doing This function is one of the building blocks inside `ct_lineage_report.py`. It exists so the file can do one narrow job at a time instead of one giant unreadable routine. Flow arrows Earlier blocks or operator input feed this block. → family_counter → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
dn_change_rows
|
What this block is doing Finds names whose formal Subject DN changed over time. Flow arrows CN-grouped historical certificates. → dn_change_rows → `build_assessment` uses these rows for Subject-DN drift sections. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
issuer_change_rows
|
What this block is doing Finds names whose issuing CA family changed over time. Flow arrows CN-grouped historical certificates. → issuer_change_rows → `build_assessment` uses these rows for CA-family drift sections. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
classify_san_delta
|
What this block is doing This block applies rules and chooses a category label. Flow arrows Earlier blocks or operator input feed this block. → classify_san_delta → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
representative_delta
|
What this block is doing This function is one of the building blocks inside `ct_lineage_report.py`. It exists so the file can do one narrow job at a time instead of one giant unreadable routine. Flow arrows Earlier blocks or operator input feed this block. → representative_delta → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
san_change_rows
|
What this block is doing Finds names whose SAN bundle changed over time. Flow arrows CN-grouped historical certificates. → san_change_rows → `build_assessment` uses these rows for SAN-drift sections. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
overlap_days
|
What this block is doing This function is one of the building blocks inside `ct_lineage_report.py`. It exists so the file can do one narrow job at a time instead of one giant unreadable routine. Flow arrows Earlier blocks or operator input feed this block. → overlap_days → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
overlap_class
|
What this block is doing This function is one of the building blocks inside `ct_lineage_report.py`. It exists so the file can do one narrow job at a time instead of one giant unreadable routine. Flow arrows Earlier blocks or operator input feed this block. → overlap_class → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
build_asset_key
|
What this block is doing This block constructs a richer higher-level result from simpler inputs. Flow arrows Earlier blocks or operator input feed this block. → build_asset_key → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
overlap_metrics
|
What this block is doing This function is one of the building blocks inside `ct_lineage_report.py`. It exists so the file can do one narrow job at a time instead of one giant unreadable routine. Flow arrows Earlier blocks or operator input feed this block. → overlap_metrics → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
overlap_row_from_asset
|
What this block is doing This function is one of the building blocks inside `ct_lineage_report.py`. It exists so the file can do one narrow job at a time instead of one giant unreadable routine. Flow arrows Earlier blocks or operator input feed this block. → overlap_row_from_asset → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
overlap_rows
|
What this block is doing Finds predecessor/successor pairs that overlap too long. Flow arrows CN-grouped historical certificates. → overlap_rows → `build_assessment` turns these into current and past overlap red flags. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
build_red_flag_rows
|
What this block is doing This block constructs a richer higher-level result from simpler inputs. Flow arrows Earlier blocks or operator input feed this block. → build_red_flag_rows → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
top_start_days
|
What this block is doing This function is one of the building blocks inside `ct_lineage_report.py`. It exists so the file can do one narrow job at a time instead of one giant unreadable routine. Flow arrows Earlier blocks or operator input feed this block. → top_start_days → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
spike_weeks
|
What this block is doing This function is one of the building blocks inside `ct_lineage_report.py`. It exists so the file can do one narrow job at a time instead of one giant unreadable routine. Flow arrows Earlier blocks or operator input feed this block. → spike_weeks → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
partition_collision_rows
|
What this block is doing This function is one of the building blocks inside `ct_lineage_report.py`. It exists so the file can do one narrow job at a time instead of one giant unreadable routine. Flow arrows Earlier blocks or operator input feed this block. → partition_collision_rows → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
partition_san_rows
|
What this block is doing This function is one of the building blocks inside `ct_lineage_report.py`. It exists so the file can do one narrow job at a time instead of one giant unreadable routine. Flow arrows Earlier blocks or operator input feed this block. → partition_san_rows → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
build_assessment
|
What this block is doing Runs the full historical workflow and returns the finished analytical bundle. Flow arrows Historical records from all configured domains. → build_assessment → The monograph and standalone historical reports consume this one big bundle. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
render_markdown
|
What this block is doing Writes the standalone historical report in Markdown. Flow arrows Earlier blocks or operator input feed this block. → render_markdown → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
render_latex
|
What this block is doing Writes the standalone historical report in LaTeX. Flow arrows Earlier blocks or operator input feed this block. → render_latex → Later blocks in the same file or in the next analytical stage consume its output. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |
main
|
What this block is doing The standalone command-line entrypoint for the historical analyzer. Flow arrows CLI arguments from the operator. → main → Runs the standalone historical analysis end to end. How to think about it Treat this block as one small station in a pipeline. Ask: what comes in here, what gets changed here, and what comes out for the next block? |