-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement certificate transparency monitoring workflow #536
Implement certificate transparency monitoring workflow #536
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #536 +/- ##
==========================================
- Coverage 64.02% 58.09% -5.94%
==========================================
Files 4 18 +14
Lines 303 1477 +1174
==========================================
+ Hits 194 858 +664
- Misses 78 535 +457
- Partials 31 84 +53 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
8d35132
to
ced634c
Compare
cmd/ct_monitor/main.go
Outdated
|
||
monitoredValues := identity.MonitoredValues{ | ||
CertificateIdentities: config.MonitoredValues.CertificateIdentities, | ||
Subjects: config.MonitoredValues.Subjects, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need subjects, correct? Since subjects are just for special cases of SSH certificates or emails in keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing subjects and fingerprints from this construction
cmd/ct_monitor/main.go
Outdated
return | ||
} | ||
|
||
err = ct.RunConsistencyCheck(fulcioClient, config.LogInfoFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we flip the order of these, to first check consistency before the identity check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also adding in the current STH as a return value to RunConsistencyCheck to reduce number of calls to GetSTH
ced634c
to
56f9bc5
Compare
cmd/ct_monitor/main.go
Outdated
|
||
// Default values for monitoring job parameters | ||
const ( | ||
publicRekorServerURL = "https://rekor.sigstore.dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to change this to ctfe.sigstore.dev/2022
, and change the var name.
Can we also leave a TODO about figuring out a way to handle log shards? Can link it to #57
cmd/ct_monitor/main.go
Outdated
// Default values for monitoring job parameters | ||
const ( | ||
publicRekorServerURL = "https://rekor.sigstore.dev" | ||
logInfoFileName = "logInfo.txt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's create different default file names so they don't collide if run locally. maybe ctLogInfo.txt
and ctIdentities.txt
or something similar?
cmd/ct_monitor/main.go
Outdated
interval := flag.Duration("interval", 5*time.Minute, "Length of interval between each periodical consistency check") | ||
flag.Parse() | ||
|
||
if *configFilePath == "" && *configYamlInput == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we copy over the same changes here, that configs aren't required?
cmd/ct_monitor/main.go
Outdated
fmt.Fprintf(os.Stderr, "start index %d must be strictly less than end index %d", *config.StartIndex, *config.EndIndex) | ||
} | ||
|
||
_, err = ct.IdentitySearch(fulcioClient, *config.StartIndex, *config.EndIndex, monitoredValues) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only run if there's monitorable values?
cmd/ct_monitor/main.go
Outdated
inputEndIndex := config.EndIndex | ||
|
||
var currentSTH *ctgo.SignedTreeHead | ||
currentSTH, err = ct.RunConsistencyCheck(fulcioClient, config.LogInfoFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we copy over the changes that RunConsistencyCheck
returns the previous, and it's read in below? Otherwise we'll hit the same bug that we read in the latest as the previous.
0723243
to
8936fdb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
35bfd81
to
c512f58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more rebase!
Signed-off-by: linus-sun <[email protected]>
Signed-off-by: linus-sun <[email protected]>
Signed-off-by: linus-sun <[email protected]>
Signed-off-by: linus-sun <[email protected]>
Signed-off-by: linus-sun <[email protected]>
c512f58
to
1d50007
Compare
Summary
Per changes outlined in this doc, this PR implements the certificate transparency monitoring workflow functionality by doing the following:
ct_monitor.go
file to perform the identity monitor and consistency check functionality on a certificate transparency logThis PR depends on #527, #534, #535
Release Note
NONE
Documentation
N/A - future PRs will update documentation once the certificate transparency monitor is runnable from a reusable monitoring workflow