Skip to content
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

Deprecate notary_prefix and notary_url options #1601

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions ee/agent/flags/flag_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,6 @@ func (fc *FlagController) Autoupdate() bool {
return NewBoolFlagValue(WithDefaultBool(fc.cmdLineOpts.Autoupdate)).get(fc.getControlServerValue(keys.Autoupdate))
}

func (fc *FlagController) SetNotaryServerURL(url string) error {
return fc.setControlServerValue(keys.NotaryServerURL, []byte(url))
}
func (fc *FlagController) NotaryServerURL() string {
return NewStringFlagValue(
WithDefaultString(fc.cmdLineOpts.NotaryServerURL),
).get(fc.getControlServerValue(keys.NotaryServerURL))
}

func (fc *FlagController) SetTufServerURL(url string) error {
return fc.setControlServerValue(keys.TufServerURL, []byte(url))
}
Expand Down Expand Up @@ -471,15 +462,6 @@ func (fc *FlagController) UpdateChannel() string {
).get(fc.getControlServerValue(keys.UpdateChannel))
}

func (fc *FlagController) SetNotaryPrefix(prefix string) error {
return fc.setControlServerValue(keys.NotaryPrefix, []byte(prefix))
}
func (fc *FlagController) NotaryPrefix() string {
return NewStringFlagValue(
WithDefaultString(fc.cmdLineOpts.NotaryPrefix),
).get(fc.getControlServerValue(keys.NotaryPrefix))
}

func (fc *FlagController) SetAutoupdateInitialDelay(delay time.Duration) error {
return fc.setControlServerValue(keys.AutoupdateInitialDelay, durationToBytes(delay))
}
Expand Down
8 changes: 0 additions & 8 deletions ee/agent/flags/flag_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,10 @@ func TestControllerStringFlags(t *testing.T) {
assert.Equal(t, expectedValue, value)
value = fc.ControlServerURL()
assert.Equal(t, expectedValue, value)
value = fc.NotaryServerURL()
assert.Equal(t, expectedValue, value)
value = fc.TufServerURL()
assert.Equal(t, expectedValue, value)
value = fc.MirrorServerURL()
assert.Equal(t, expectedValue, value)
value = fc.NotaryPrefix()
assert.Equal(t, expectedValue, value)
value = fc.UpdateDirectory()
assert.Equal(t, expectedValue, value)
}
Expand All @@ -165,14 +161,10 @@ func TestControllerStringFlags(t *testing.T) {
require.NoError(t, err)
err = fc.SetControlServerURL(tt.valueToSet)
require.NoError(t, err)
err = fc.SetNotaryServerURL(tt.valueToSet)
require.NoError(t, err)
err = fc.SetTufServerURL(tt.valueToSet)
require.NoError(t, err)
err = fc.SetMirrorServerURL(tt.valueToSet)
require.NoError(t, err)
err = fc.SetNotaryPrefix(tt.valueToSet)
require.NoError(t, err)
err = fc.SetUpdateDirectory(tt.valueToSet)
require.NoError(t, err)

Expand Down
2 changes: 0 additions & 2 deletions ee/agent/flags/keys/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ const (
WatchdogMemoryLimitMB FlagKey = "watchdog_memory_limit_mb"
WatchdogUtilizationLimitPercent FlagKey = "watchdog_utilization_limit_percent"
Autoupdate FlagKey = "autoupdate"
NotaryServerURL FlagKey = "notary_url"
TufServerURL FlagKey = "tuf_url"
MirrorServerURL FlagKey = "mirror_url"
AutoupdateInterval FlagKey = "autoupdate_interval"
UpdateChannel FlagKey = "update_channel"
NotaryPrefix FlagKey = "notary_prefix"
AutoupdateInitialDelay FlagKey = "autoupdater_initial_delay"
UpdateDirectory FlagKey = "update_directory"
ExportTraces FlagKey = "export_traces"
Expand Down
8 changes: 0 additions & 8 deletions ee/agent/types/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ type Flags interface {
SetAutoupdate(enabled bool) error
Autoupdate() bool

// NotaryServerURL is the URL for the Notary server.
SetNotaryServerURL(url string) error
NotaryServerURL() string

// TufServerURL is the URL for the tuf server.
SetTufServerURL(url string) error
TufServerURL() string
Expand All @@ -173,10 +169,6 @@ type Flags interface {
SetUpdateChannel(channel string) error
UpdateChannel() string

// NotaryPrefix is the path prefix used to store launcher and osqueryd binaries on the Notary server
SetNotaryPrefix(prefix string) error
NotaryPrefix() string

// AutoupdateInitialDelay set an initial startup delay on the autoupdater process.
SetAutoupdateInitialDelay(delay time.Duration) error
AutoupdateInitialDelay() time.Duration
Expand Down
56 changes: 0 additions & 56 deletions ee/agent/types/mocks/flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 0 additions & 56 deletions ee/agent/types/mocks/knapsack.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ee/debug/checkups/checkpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ func TestInterrupt_Multiple(t *testing.T) {
mockKnapsack.On("InModernStandby").Return(false).Maybe()
mockKnapsack.On("RootDirectory").Return("").Maybe()
mockKnapsack.On("Autoupdate").Return(true).Maybe()
mockKnapsack.On("NotaryServerURL").Return("localhost").Maybe()
mockKnapsack.On("LatestOsquerydPath").Return("").Maybe()
mockKnapsack.On("ServerProvidedDataStore").Return(nil).Maybe()
checkupLogger := NewCheckupLogger(log.NewNopLogger(), mockKnapsack)
Expand Down
12 changes: 3 additions & 9 deletions pkg/launcher/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ type Options struct {

// Autoupdate enables the autoupdate functionality.
Autoupdate bool
// NotaryServerURL is the URL for the Notary server.
NotaryServerURL string
// TufServerURL is the URL for the tuf server.
TufServerURL string
// MirrorServerURL is the URL for the Notary mirror.
Expand All @@ -88,8 +86,6 @@ type Options struct {
AutoupdateInterval time.Duration
// UpdateChannel is the channel to pull options from (stable, beta, nightly).
UpdateChannel autoupdate.UpdateChannel
// NotaryPrefix is the path prefix used to store launcher and osqueryd binaries on the Notary server
NotaryPrefix string
// AutoupdateInitialDelay set an initial startup delay on the autoupdater process.
AutoupdateInitialDelay time.Duration
// UpdateDirectory is the location of the update libraries for osqueryd and launcher
Expand Down Expand Up @@ -247,12 +243,10 @@ func ParseOptions(subcommandName string, args []string) (*Options, error) {

// Autoupdate options
flAutoupdate = flagset.Bool("autoupdate", DefaultAutoupdate, "Whether or not the osquery autoupdater is enabled (default: false)")
flNotaryServerURL = flagset.String("notary_url", autoupdate.DefaultNotary, "The Notary update server (default: https://notary.kolide.co)")
flTufServerURL = flagset.String("tuf_url", DefaultTufServer, "TUF update server (default: https://tuf.kolide.com)")
flMirrorURL = flagset.String("mirror_url", autoupdate.DefaultMirror, "The mirror server for autoupdates (default: https://dl.kolide.co)")
flAutoupdateInterval = flagset.Duration("autoupdate_interval", 1*time.Hour, "The interval to check for updates (default: once every hour)")
flUpdateChannel = flagset.String("update_channel", "stable", "The channel to pull updates from (options: stable, beta, nightly)")
flNotaryPrefix = flagset.String("notary_prefix", autoupdate.DefaultNotaryPrefix, "The prefix for Notary path that contains the collections (default: kolide/)")
flAutoupdateInitialDelay = flagset.Duration("autoupdater_initial_delay", 1*time.Hour, "Initial autoupdater subprocess delay")
flUpdateDirectory = flagset.String("update_directory", "", "Local directory to hold updates for osqueryd and launcher")

Expand All @@ -270,7 +264,9 @@ func ParseOptions(subcommandName string, args []string) (*Options, error) {
_ = flagset.String("debug_log_file", "", "DEPRECATED")
_ = flagset.Bool("control", false, "DEPRECATED")
_ = flagset.String("control_hostname", "", "DEPRECATED")
_ = flagset.Bool("disable_control_tls", false, "Disable TLS encryption for the control features")
_ = flagset.Bool("disable_control_tls", false, "DEPRECATED")
_ = flagset.String("notary_url", autoupdate.DefaultNotary, "DEPRECATED")
_ = flagset.String("notary_prefix", autoupdate.DefaultNotaryPrefix, "DEPRECATED")
)

flagset.Var(&flOsqueryFlags, "osquery_flag", "Flags to pass to osquery (possibly overriding Launcher defaults)")
Expand Down Expand Up @@ -406,8 +402,6 @@ func ParseOptions(subcommandName string, args []string) (*Options, error) {
LogMaxBytesPerBatch: *flLogMaxBytesPerBatch,
LoggingInterval: *flLoggingInterval,
MirrorServerURL: *flMirrorURL,
NotaryPrefix: *flNotaryPrefix,
NotaryServerURL: *flNotaryServerURL,
TufServerURL: *flTufServerURL,
OsqueryFlags: flOsqueryFlags,
OsqueryTlsConfigEndpoint: *flOsqTlsConfig,
Expand Down
2 changes: 0 additions & 2 deletions pkg/launcher/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ func getArgsAndResponse() (map[string]string, *Options) {
KolideServerURL: randomHostname,
LoggingInterval: time.Duration(randomInt) * time.Second,
MirrorServerURL: "https://dl.kolide.co",
NotaryPrefix: "kolide",
NotaryServerURL: "https://notary.kolide.co",
TufServerURL: "https://tuf.kolide.com",
OsquerydPath: windowsAddExe("/dev/null"),
OsqueryHealthcheckStartupDelay: 10 * time.Minute,
Expand Down
2 changes: 0 additions & 2 deletions pkg/osquery/table/kolide_launcher_autoupdate_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const launcherAutoupdateConfigTableName = "kolide_launcher_autoupdate_config"
func LauncherAutoupdateConfigTable(flags types.Flags) *table.Plugin {
columns := []table.ColumnDefinition{
table.TextColumn("autoupdate"),
table.TextColumn("notary_server_url"),
table.TextColumn("mirror_server_url"),
table.TextColumn("tuf_server_url"),
table.TextColumn("autoupdate_interval"),
Expand All @@ -35,7 +34,6 @@ func generateLauncherAutoupdateConfigTable(flags types.Flags) table.GenerateFunc
return []map[string]string{
{
"autoupdate": boolToString(flags.Autoupdate()),
"notary_server_url": flags.NotaryServerURL(),
"mirror_server_url": flags.MirrorServerURL(),
"tuf_server_url": flags.TufServerURL(),
"autoupdate_interval": flags.AutoupdateInterval().String(),
Expand Down
Loading