| 64 | func (customDeadlineExceededError) Temporary() bool { return true } |
| 65 | |
| 66 | func NewRootCmd() *cobra.Command { |
| 67 | rootCmd := &cobra.Command{ |
| 68 | Use: "ec", |
| 69 | Short: "Conforma CLI", |
| 70 | |
| 71 | Long: hd.Doc(` |
| 72 | Conforma CLI |
| 73 | |
| 74 | Secure your software supply chain by validating that your artifacts meet security and |
| 75 | compliance requirements. Conforma helps you verify the authenticity and integrity of |
| 76 | container images, build processes, and deployment pipelines. |
| 77 | |
| 78 | Whether you're ensuring images are properly signed, validating build attestations comply |
| 79 | with your organization's policies, or checking that Tekton tasks follow security best |
| 80 | practices, Conforma provides the tools you need to establish trust in your software |
| 81 | delivery process. |
| 82 | |
| 83 | Key capabilities: |
| 84 | • Verify signatures and attestations on container images |
| 85 | • Validate SLSA provenance to ensure secure build processes |
| 86 | • Enforce compliance policies across your development workflow |
| 87 | • Generate detailed reports for audit and compliance purposes |
| 88 | • Support for custom validation rules to meet your specific requirements |
| 89 | |
| 90 | Use Conforma to implement "trust but verify" practices in your CI/CD pipeline, |
| 91 | ensuring that only secure, compliant artifacts make it to production. |
| 92 | |
| 93 | Have feedback or want to contribute? Visit https://conforma.dev/contribute/ to join our |
| 94 | community, report issues, or help improve Conforma. |
| 95 | `), |
| 96 | |
| 97 | SilenceUsage: true, |
| 98 | |
| 99 | PersistentPreRun: func(cmd *cobra.Command, _ []string) { |
| 100 | logging.InitLogging(verbose, quiet, debug, enabledTraces.Enabled(tracing.Log, tracing.Opa), logfile) |
| 101 | |
| 102 | // Apply retry configuration from CLI flags |
| 103 | retryConfig := http.RetryConfig{ |
| 104 | MaxWait: retryMaxWait, |
| 105 | MaxRetry: retryMaxRetry, |
| 106 | Duration: retryDuration, |
| 107 | Factor: retryFactor, |
| 108 | Jitter: retryJitter, |
| 109 | } |
| 110 | http.SetRetryConfig(retryConfig) |
| 111 | |
| 112 | // set a custom message for context.DeadlineExceeded error |
| 113 | context.DeadlineExceeded = customDeadlineExceededError{} |
| 114 | |
| 115 | // Create a new context now that flags have been parsed so a |
| 116 | // custom timeout can be used and traces can be added |
| 117 | ctx := cmd.Context() |
| 118 | var cancel context.CancelFunc |
| 119 | if globalTimeout > 0 { |
| 120 | ctx, cancel = context.WithTimeout(ctx, globalTimeout) |
| 121 | log.Debugf("globalTimeout is %s", time.Duration(globalTimeout)) |
| 122 | } else { |
| 123 | log.Debugf("globalTimeout is %d, no timeout used", globalTimeout) |