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

event: mark FormatMajorVersion as safe from redaction #2992

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

AlexTalks
Copy link
Contributor

@AlexTalks AlexTalks commented Oct 11, 2023

Previously nearly all events logged by the EventListener used types that had been marked as safe by implementing SafeFormatter, defining them as non-sensitive and not requiring redaction in logs, however FormatMajorVersion had been excluded. This change makes FormatMajorVersion a redact.SafeValue as well.

Requires the following in the cockroachdb/cockroach redactcheck.go:

"github.com/cockroachdb/pebble": {
	"FormatMajorVersion": {},
},

@AlexTalks AlexTalks requested a review from itsbilal October 11, 2023 02:10
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Previously nearly all events logged by the `EventListener` used
types that had been marked as safe by implementing `SafeFormatter`,
defining them as non-sensitive and not requiring redaction in logs,
however `FormatMajorVersion` had been excluded. This change makes
`FormatMajorVersion` a `redact.SafeValue` as well.
AlexTalks added a commit to AlexTalks/cockroach that referenced this pull request Oct 11, 2023
This change updates a few previously redacted constants and simple types
often printed to logs to be marked as safe, not needing redaction.
These do not represent sensitive data, such as such as the "s"
pluralizer, the type of Admission Control work queue, or a node's
liveness record, but they had not been marked safe or had
`SafeFormatter` implemented previously.

The types/constants marked as safe are listed as follows with examples:
- `livenesspb.Liveness`: e.g. `liveness(nid:124 epo:12 exp:12345.6789,0)`
- `livenesspb.MembershipStatus`: e.g. `active`, `decommissioning`
- `admission.WorkKind`: e.g. `kv`, `sql-kv-response`, etc
- `util.Pluralize()`: e.g. `s` on end of strings
- `upgrade.Name()`: e.g. `Upgrade to 0.0-2: "add users and roles"`

This includes a fix for the format string used in printing
`enginepb.EngineType` at startup, printing `pebble` instead of `‹2›`.

Lastly, this also adds `pebble.FormatMajorVersion` to the list of
allowed `redact.SafeValue`s in anticipation of
cockroachdb/pebble#2992, in the same vein as
this PR.

Epic: none

Release note: None
Copy link
Collaborator

@jbowens jbowens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @itsbilal)

@jbowens jbowens merged commit ede31f1 into cockroachdb:master Oct 11, 2023
@jbowens jbowens mentioned this pull request Oct 12, 2023
jbowens added a commit to jbowens/cockroach that referenced this pull request Oct 12, 2023
```
ede31f1a event: mark `FormatMajorVersion` as safe from redaction
36b3f57b db: return structured errors from checkConsistency
e3cbe650 db: use DiskFileName for manifest files and memtables
d57a0be4 db: tolerate errors during async ingest sstable validation
f79ae812 db: avoid use of physical filesystem in TestIngestValidation
5ddf67cc db: deflake TestIngestLoadRand
```

Resolves cockroachdb/pebble#2992.
Epic: none
Release note: none
@RaduBerinde
Copy link
Member

Should we backport to crl-release-23.2?

craig bot pushed a commit to cockroachdb/cockroach that referenced this pull request Oct 12, 2023
112231: go.mod: bump Pebble to ede31f1a8e4b r=RaduBerinde a=jbowens

Includes `@AlexTalks's` changes from cockroachdb/pebble#2992 to add `FormatMajorVersion` to the list of allowlisted `SafeValue` types.

```
ede31f1a event: mark `FormatMajorVersion` as safe from redaction
36b3f57b db: return structured errors from checkConsistency
e3cbe650 db: use DiskFileName for manifest files and memtables
d57a0be4 db: tolerate errors during async ingest sstable validation
f79ae812 db: avoid use of physical filesystem in TestIngestValidation
5ddf67cc db: deflake TestIngestLoadRand
```

Resolves cockroachdb/pebble#2992.
Epic: none
Release note: none

Co-authored-by: Jackson Owens <[email protected]>
andrewbaptist pushed a commit to AlexTalks/cockroach that referenced this pull request Nov 14, 2023
This change updates a few previously redacted constants and simple types
often printed to logs to be marked as safe, not needing redaction.
These do not represent sensitive data, such as such as the "s"
pluralizer, the type of Admission Control work queue, or a node's
liveness record, but they had not been marked safe or had
`SafeFormatter` implemented previously.

The types/constants marked as safe are listed as follows with examples:
- `livenesspb.Liveness`: e.g. `liveness(nid:124 epo:12 exp:12345.6789,0)`
- `livenesspb.MembershipStatus`: e.g. `active`, `decommissioning`
- `admission.WorkKind`: e.g. `kv`, `sql-kv-response`, etc
- `util.Pluralize()`: e.g. `s` on end of strings
- `upgrade.Name()`: e.g. `Upgrade to 0.0-2: "add users and roles"`

This includes a fix for the format string used in printing
`enginepb.EngineType` at startup, printing `pebble` instead of `‹2›`.

Lastly, this also adds `pebble.FormatMajorVersion` to the list of
allowed `redact.SafeValue`s in anticipation of
cockroachdb/pebble#2992, in the same vein as
this PR.

Epic: none

Release note: None
craig bot pushed a commit to cockroachdb/cockroach that referenced this pull request Nov 17, 2023
112080: *: mark various non-sensitive strings as safe  r=miraradeva a=AlexTalks

This change updates a few previously redacted constants and simple types often printed to logs to be marked as safe, not needing redaction. These do not represent sensitive data, such as such as the "s" pluralizer, the type of Admission Control work queue, or a node's liveness record, but they had not been marked safe or had `SafeFormatter` implemented previously.

The types/constants marked as safe are listed as follows with examples:
- `livenesspb.Liveness`: e.g. `liveness(nid:124 epo:12 exp:12345.6789,0)`
- `livenesspb.MembershipStatus`: e.g. `active`, `decommissioning`
- `admission.WorkKind`: e.g. `kv`, `sql-kv-response`, etc
- `util.Pluralize()`: e.g. `s` on end of strings
- `upgrade.Name()`: e.g. `Upgrade to 0.0-2: "add users and roles"`

This includes a fix for the format string used in printing
`enginepb.EngineType` at startup, printing `pebble` instead of `‹2›`.

Lastly, this also adds `pebble.FormatMajorVersion` to the list of allowed `redact.SafeValue`s in anticipation of cockroachdb/pebble#2992, in the same vein as this PR.

Epic: none

Release note: None

Co-authored-by: Alex Sarkesian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants