Commit 8747618
authored
Record the series key by id in audit metadata, not by name (#108)
CodeQL flagged the Series API's audit write as clear-text storage of
sensitive data (rb/clear-text-storage-sensitive-data, high): it traces the
read of `name` off a series API token into audit_logs.metadata, which is a
plain jsonb column.
The name was never a secret -- it is the display label built from the
creator's email local part, and the secret itself is only ever held as a
SHA256 digest. But the metadata does not need the label: storing the key's id
instead removes the flagged dataflow entirely and is more useful to an
auditor, since an id survives a rename or a rotation, resolves to the key's
name, creator and revocation state, and revoking a key keeps its row.1 parent 583c411 commit 8747618
2 files changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
178 | 182 | | |
179 | 183 | | |
180 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
0 commit comments