-
Notifications
You must be signed in to change notification settings - Fork 23
[SECURESIGN-3109] Add ctlog monitoring #1456
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
base: main
Are you sure you want to change the base?
Conversation
Reviewer's GuideAdds configurable CTlog monitoring by extending operator constants, CRD schemas, default config, and CTlog controller, and implementing a new monitor sub-package with statefulset, service, and ServiceMonitor actions. Entity relationship diagram for updated CTlog CRD monitoring configurationerDiagram
CTlog {
string name
MonitoringWithTLogConfig monitoring
}
MonitoringWithTLogConfig {
MonitoringConfig config
TLogConfig tlog
}
TLogConfig {
boolean enabled
string interval
}
CTlog ||--|{ MonitoringWithTLogConfig : has
MonitoringWithTLogConfig ||--|{ TLogConfig : has
Class diagram for new CTlog monitor actionsclassDiagram
class statefulSetAction {
+Name() string
+CanHandle(context.Context, CTlog) bool
+Handle(context.Context, CTlog) *action.Result
-ensureTLS(tlsConfig, name)
-ensureMonitorStatefulSet(instance, sa, labels, ctlogServerHost, tufServerHost)
-ensureInitContainer(ctlogServerHost, tufHost)
}
class createServiceAction {
+Name() string
+CanHandle(context.Context, CTlog) bool
+Handle(context.Context, CTlog) *action.Result
}
class monitoringAction {
+Name() string
+CanHandle(context.Context, CTlog) bool
+Handle(context.Context, CTlog) *action.Result
}
class helper {
+enabled(instance CTlog) bool
}
statefulSetAction --|> action.BaseAction
createServiceAction --|> action.BaseAction
monitoringAction --|> action.BaseAction
helper ..> CTlog
Class diagram for updated CTlogSpec and monitoring configclassDiagram
class CTlogSpec {
+Monitoring MonitoringWithTLogConfig
}
class MonitoringWithTLogConfig {
+TLog TLogConfig
}
class TLogConfig {
+Enabled bool
+Interval string
}
CTlogSpec --> MonitoringWithTLogConfig
MonitoringWithTLogConfig --> TLogConfig
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
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.
Hey there - I've reviewed your changes - here's some feedback:
- In ctlog_controller.go you register both actions.NewCreateMonitorAction() and monitor.NewCreateMonitorAction(); remove or consolidate the redundant call to avoid running the wrong monitor action twice.
- In statefulSetAction.ensureInitContainer you’re using the RekorMonitor image constant—swap that out for the CTLogMonitor image so the init container runs the correct binary.
- The spec type MonitoringWithTLogConfig is quite verbose; consider renaming it (for example to TLogMonitoringConfig) to better align with existing config types and improve readability.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In ctlog_controller.go you register both actions.NewCreateMonitorAction() and monitor.NewCreateMonitorAction(); remove or consolidate the redundant call to avoid running the wrong monitor action twice.
- In statefulSetAction.ensureInitContainer you’re using the RekorMonitor image constant—swap that out for the CTLogMonitor image so the init container runs the correct binary.
- The spec type MonitoringWithTLogConfig is quite verbose; consider renaming it (for example to TLogMonitoringConfig) to better align with existing config types and improve readability.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||
Summary by Sourcery
Enable optional monitoring of CT log transparency service by adding configurable TLog monitor resources (statefulset, service, and service monitor), updating CRDs, images, and controller logic.
New Features:
Enhancements: