Skip to content

Commit 5aaeba0

Browse files
committed
fix(security): replace real AWS account ID with placeholder
The production AWS account ID was committed in four tracked files (a sender.go doc comment, email template test fixtures, frontend settings-accounts test fixtures, and a known_issues UX review doc), violating the .gitallowed policy that only deliberate placeholders may appear in the repo. Replace every occurrence with the allowlisted placeholder 123456789012. No literal-absence regression test is added because such a test would re-embed the very ID it guards against; the git-secrets pre-commit/CI gate remains the enforcement point. The gate hole (bare 12-digit IDs in string labels and comments escape the registered key=value pattern) and the history-scrubbing decision are documented on the tracking issue. Verified: go build ./..., go test ./internal/email/... (335 passed), npx jest settings-accounts.test.ts (80 passed), git grep confirms zero remaining occurrences. Closes #1167
1 parent d484c9d commit 5aaeba0

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎frontend/src/__tests__/settings-accounts.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,28 +1237,28 @@ describe('Account overrides modal', () => {
12371237

12381238
test('Overrides button opens an account-scoped modal whose title binds to the account', async () => {
12391239
(api.listAccounts as jest.Mock).mockResolvedValue([
1240-
{ id: 'acc-1', name: 'AWS Prod', provider: 'aws', external_id: '540659244915', enabled: true },
1240+
{ id: 'acc-1', name: 'AWS Prod', provider: 'aws', external_id: '123456789012', enabled: true },
12411241
]);
12421242
(api.listAccountServiceOverrides as jest.Mock).mockResolvedValue([
12431243
{ id: 'o1', account_id: 'acc-1', provider: 'aws', service: 'ec2', payment: 'all-upfront' },
12441244
]);
12451245

12461246
await loadAccountsForProvider('aws');
12471247
const btn = document.querySelector(
1248-
`button[aria-label="Service overrides for AWS Prod (540659244915)"]`,
1248+
`button[aria-label="Service overrides for AWS Prod (123456789012)"]`,
12491249
) as HTMLButtonElement;
12501250
btn.click();
12511251
await new Promise(r => setTimeout(r, 0));
12521252

12531253
const modal = document.getElementById('account-overrides-modal') as HTMLElement;
12541254
expect(modal.classList.contains('hidden')).toBe(false);
12551255
const title = document.getElementById('account-overrides-modal-title') as HTMLElement;
1256-
expect(title.textContent).toBe('Service overrides for AWS Prod (540659244915)');
1256+
expect(title.textContent).toBe('Service overrides for AWS Prod (123456789012)');
12571257
});
12581258

12591259
test('switching accounts swaps the modal title; only one account context is active at a time', async () => {
12601260
(api.listAccounts as jest.Mock).mockResolvedValue([
1261-
{ id: 'acc-a', name: 'AWS Prod', provider: 'aws', external_id: '540659244915', enabled: true },
1261+
{ id: 'acc-a', name: 'AWS Prod', provider: 'aws', external_id: '123456789012', enabled: true },
12621262
{ id: 'acc-b', name: 'CUDly host', provider: 'aws', external_id: '909626172446', enabled: true },
12631263
]);
12641264
(api.listAccountServiceOverrides as jest.Mock).mockResolvedValue([]);
@@ -1268,7 +1268,7 @@ describe('Account overrides modal', () => {
12681268

12691269
// Click Overrides on Account A.
12701270
(document.querySelector(
1271-
`button[aria-label="Service overrides for AWS Prod (540659244915)"]`,
1271+
`button[aria-label="Service overrides for AWS Prod (123456789012)"]`,
12721272
) as HTMLButtonElement).click();
12731273
await new Promise(r => setTimeout(r, 0));
12741274
expect(titleEl.textContent).toContain('AWS Prod');

‎internal/email/sender.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ type RecommendationSummary struct {
504504
// "$0" so a no-upfront payment option visibly shows that fact.
505505
UpfrontCost float64
506506
// AccountLabel is a friendly per-rec account identifier (e.g.
507-
// "AWS 540659244915 (acme-prod)"). Empty omits the line.
507+
// "AWS 123456789012 (acme-prod)"). Empty omits the line.
508508
AccountLabel string
509509
}
510510

‎internal/email/template_renderers_test.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func TestRenderPurchaseApprovalRequestEmail_NewContextFields_Issue287(t *testing
269269
Recommendations: []RecommendationSummary{{
270270
Service: "ec2", ResourceType: "m5.large", Region: "us-east-1",
271271
Count: 8, Term: 3, Payment: "all-upfront", UpfrontCost: 1234.56,
272-
MonthlySavings: 58.0, AccountLabel: "AWS 540659244915",
272+
MonthlySavings: 58.0, AccountLabel: "AWS 123456789012",
273273
}},
274274
}
275275

@@ -280,7 +280,7 @@ func TestRenderPurchaseApprovalRequestEmail_NewContextFields_Issue287(t *testing
280280
assert.Contains(t, body, "Term: 3yr")
281281
assert.Contains(t, body, "Payment: all-upfront")
282282
assert.Contains(t, body, "Upfront: $1234.56")
283-
assert.Contains(t, body, "Account: AWS 540659244915")
283+
assert.Contains(t, body, "Account: AWS 123456789012")
284284

285285
// Requested-by header.
286286
assert.Contains(t, body, "Cristi M")
@@ -318,7 +318,7 @@ func TestRenderPurchaseApprovalRequestEmailHTML_Issue287(t *testing.T) {
318318
Recommendations: []RecommendationSummary{{
319319
Service: "ec2", ResourceType: "m5.large", Region: "us-east-1",
320320
Count: 8, Term: 3, Payment: "all-upfront", UpfrontCost: 1234.56,
321-
MonthlySavings: 58.0, AccountLabel: "AWS 540659244915",
321+
MonthlySavings: 58.0, AccountLabel: "AWS 123456789012",
322322
}},
323323
}
324324

‎known_issues/23_ux_review_2026_04_22.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@
507507

508508
#### MEDIUM: Per-provider Accounts sections render as inline text rows — need a table
509509

510-
**Evidence:** `AWS personal (540659244915) Edit Test Credentials Overrides Delete` is a single text-flow line. Hard to scan.
510+
**Evidence:** `AWS personal (123456789012) Edit Test Credentials Overrides Delete` is a single text-flow line. Hard to scan.
511511

512512
**Recommended fix:** Convert to a table: `Name | ID | Status | Actions`.
513513

0 commit comments

Comments
 (0)