Skip to content

refactor: セキュリティコメント体系統一・入力サニタイズ強化 (#574)#579

Merged
Kewton merged 2 commits intodevelopfrom
feature/574-security-comments
Mar 28, 2026
Merged

refactor: セキュリティコメント体系統一・入力サニタイズ強化 (#574)#579
Kewton merged 2 commits intodevelopfrom
feature/574-security-comments

Conversation

@Kewton
Copy link
Copy Markdown
Owner

@Kewton Kewton commented Mar 28, 2026

Summary

  • セキュリティコメント識別子を [SEC-NNN] 形式に統一(9件)
  • sanitizeTerminalOutput() にnull byte除去・過大入力切り詰め(10KB上限)を追加
  • security-logger.ts 新規作成(logSecurityEvent() 統一API)
  • ユニットテスト追加(sanitize, security-logger, ip-restriction修正)

Test plan

  • TypeScript型チェック Pass
  • ESLint Pass
  • Unit Test 5540テスト全Pass(286ファイル)
  • Build Pass

Closes #574

🤖 Generated with Claude Code

Kewton and others added 2 commits March 29, 2026 03:40
…itization

- Migrate 9 security identifiers to unified [SEC-NNN] format (SEC-010 to SEC-018)
- Add security-logger.ts with SecurityAction type and logSecurityEvent helper
- Add input validation to sanitizeTerminalOutput (null byte removal, 1MB truncation)
- Replace direct logger.warn calls with logSecurityEvent in path-validator.ts and ip-restriction.ts
- Create docs/security-identifiers.md as Single Source of Truth for identifier mappings
- Update tests for new sanitization behavior and log action string changes

Resolves #574

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n tests

Update CM_TRUST_PROXY negative assertions to use the new logSecurityEvent
format ('security:trust-proxy-unexpected') instead of the stale old format.
Fix inconsistent closing brace indentation in 4 test cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Kewton Kewton merged commit db75486 into develop Mar 28, 2026
5 checks passed
@Kewton Kewton deleted the feature/574-security-comments branch March 28, 2026 19:02
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.

1 participant