diff --git a/changelog/27350.txt b/changelog/27350.txt new file mode 100644 index 000000000000..ddf95bc0052b --- /dev/null +++ b/changelog/27350.txt @@ -0,0 +1,4 @@ +```release-note:change +activity log: Deprecated the field "default_report_months". Instead, the billing start time will be used to determine the start time +when querying the activity log endpoints. +``` \ No newline at end of file diff --git a/vault/activity_log.go b/vault/activity_log.go index 1c98d3122dd2..9aab39684be0 100644 --- a/vault/activity_log.go +++ b/vault/activity_log.go @@ -1993,6 +1993,7 @@ func (a *ActivityLog) modifyResponseMonths(months []*ResponseMonth, start time.T type activityConfig struct { // DefaultReportMonths are the default number of months that are returned on // a report. The zero value uses the system default of 12. + // Deprecated: This field was removed in favor of using different default startTime and endTime values DefaultReportMonths int `json:"default_report_months"` // RetentionMonths defines the number of months we want to retain data. The diff --git a/vault/activity_log_test.go b/vault/activity_log_test.go index 733b6dc10eb0..620ce6f63493 100644 --- a/vault/activity_log_test.go +++ b/vault/activity_log_test.go @@ -1016,7 +1016,6 @@ func TestActivityLog_API_ConfigCRUD_Census(t *testing.T) { } expected := map[string]interface{}{ - "default_report_months": 12, "retention_months": 56, "enabled": "enable", "queries_available": false, diff --git a/vault/logical_system_activity.go b/vault/logical_system_activity.go index f7607a191cd0..8eeeb24ad34d 100644 --- a/vault/logical_system_activity.go +++ b/vault/logical_system_activity.go @@ -108,6 +108,7 @@ func (b *SystemBackend) rootActivityPaths() []*framework.Path { Type: framework.TypeInt, Default: 12, Description: "Number of months to report if no start date specified.", + Deprecated: true, }, "retention_months": { Type: framework.TypeInt, @@ -328,7 +329,6 @@ func (b *SystemBackend) handleActivityConfigRead(ctx context.Context, req *logic return &logical.Response{ Data: map[string]interface{}{ - "default_report_months": config.DefaultReportMonths, "retention_months": config.RetentionMonths, "enabled": config.Enabled, "queries_available": qa, @@ -358,8 +358,8 @@ func (b *SystemBackend) handleActivityConfigUpdate(ctx context.Context, req *log { // Parse the default report months - if defaultReportMonthsRaw, ok := d.GetOk("default_report_months"); ok { - config.DefaultReportMonths = defaultReportMonthsRaw.(int) + if _, ok := d.GetOk("default_report_months"); ok { + warnings = append(warnings, fmt.Sprintf("default_report_months is deprecated: defaulting to billing start time")) } if config.DefaultReportMonths <= 0 { diff --git a/website/content/api-docs/system/internal-counters.mdx b/website/content/api-docs/system/internal-counters.mdx index d19e4a54171c..69be0d763d3a 100644 --- a/website/content/api-docs/system/internal-counters.mdx +++ b/website/content/api-docs/system/internal-counters.mdx @@ -1095,7 +1095,8 @@ The `/sys/internal/counters/config` endpoint is used to configure logging of act ### Parameters -- `default_report_months` `(integer: 12)` - The number of months to report if no `start_time` is specified in a query. +- `default_report_months` `(integer: 12)` - **DEPRECATED** The number + of months to report if no `start_time` is specified in a query. - `enabled` `(string: enable, disable, default)` - Enable or disable counting of client activity. When set to `default`, the client counts are enabled on Enterprise builds and disabled on community builds. Disabling the feature during the middle of a month will discard any data recorded for that month, but does not delete previous months. @@ -1108,7 +1109,6 @@ Any missing parameters are left at their existing value. ```json { "enabled": "enable", - "default_report_months": 3, "retention_months": 54 } ``` @@ -1153,7 +1153,6 @@ $ curl \ "lease_duration": 0, "renewable": false, "data": { - "default_report_months": 12, "enabled": "default-enabled", "queries_available": true, "retention_months": 48, diff --git a/website/content/docs/upgrading/upgrade-to-1.18.x.mdx b/website/content/docs/upgrading/upgrade-to-1.18.x.mdx new file mode 100644 index 000000000000..d111c6c9c944 --- /dev/null +++ b/website/content/docs/upgrading/upgrade-to-1.18.x.mdx @@ -0,0 +1,38 @@ +--- +layout: docs +page_title: Upgrade to Vault 1.18.x - Guides +description: |- + Deprecations, important or breaking changes, and remediation recommendations + for anyone upgrading to 1.18.x from Vault 1.17.x. +--- + +# Overview + +The Vault 1.18.x upgrade guide contains information on deprecations, important +or breaking changes, and remediation recommendations for anyone upgrading from +Vault 1.17. **Please read carefully**. + +## Important changes + +### Activity Log Changes + +The field `default_report_months` can no longer be configured or read. Any previously set values +will be ignored by the system. + + +Attempts to modify `default_report_months` through the +[/sys/internal/counters/config](/vault/api-docs/system/internal-counters#update-the-client-count-configuration) +endpoint, will result in the following warning from Vault: + + + +```shell-session + +WARNING! The following warnings were returned from Vault: + + * default_report_months is deprecated: defaulting to billing start time + + +``` + + diff --git a/website/data/docs-nav-data.json b/website/data/docs-nav-data.json index 340e86a49868..9282b5e9767c 100644 --- a/website/data/docs-nav-data.json +++ b/website/data/docs-nav-data.json @@ -2325,6 +2325,10 @@ "title": "Upgrade to Raft WAL", "path": "upgrading/raft-wal" }, + { + "title": "Upgrade to 1.18.x", + "path": "upgrading/upgrade-to-1.18.x" + }, { "title": "Upgrade to 1.17.x", "path": "upgrading/upgrade-to-1.17.x"