Skip to content

Cyber/CY017- Resuable Logging Function#187

Open
Sayek17 wants to merge 32 commits into
dev-cyberfrom
cyber/secure-design-isa
Open

Cyber/CY017- Resuable Logging Function#187
Sayek17 wants to merge 32 commits into
dev-cyberfrom
cyber/secure-design-isa

Conversation

@Sayek17
Copy link
Copy Markdown
Collaborator

@Sayek17 Sayek17 commented May 8, 2026

Added CY017 Reusable Logging Function/Module Design. Now working my way through TypeScript/Express implementation for the reusable logging module to track suspicious activity in the system. Previously added CY010 Spam Alert Prevention, CY010 Document Rules and Revised API Design.

dannyz54321 and others added 30 commits April 6, 2026 14:37
- Removed outdated validation datasets and reports.
- Deleted unnecessary validation scripts and requirements.
- Introduced a new unified cleaning pipeline with enhanced configuration.
- Added comprehensive logging for cleaning and validation processes.
- Implemented type conversion, missing value handling, and duplicate removal in the cleaning pipeline.
- Enhanced validation checks with detailed issue reporting.
- Created new input and output CSV files for testing the pipeline.
- Added comparison reports to summarize data cleaning results.
This reverts commit 782d3cb.
…Source tables and added documentation file to folder
…Schema-Updates

Updated Create Schema SQL to reflect latest changes to User and DAta …
…ow for duplicates, payload 5KB cap and restriction escalation model
@Sayek17 Sayek17 changed the title Cyber/secure design isa Cyber/CY017- Resuable Logging Function May 8, 2026
Sayek17 added 2 commits May 11, 2026 12:25
Typed event model, 8 helpers over logSecurityEvent(), pluggable LogTransport (default NDJSON), Express context helper, sanitisation with secret redaction. Observational only — no blocking decisions. Future work: middleware integration, persistent-violation monitor, DB/SIEM transports, tests.
@Sayek17
Copy link
Copy Markdown
Collaborator Author

Sayek17 commented May 22, 2026

CY017: Reusable security logging function - implementation

This PR delivers the reusable security logging function specified in the CY017 design document as working TypeScript for the Node.js + Express stack. The component records security decisions made by other backend controls (authentication, JWT validation, RBAC, validation, rate limiting, throttling, duplicate detection, monitoring). It is intentionally observational ; it does not decide whether to block, delay, accept, flag or escalate a request. Those decisions belong to the controls that own them.

The intent is to land the implementation in dev so the rest of the cybersecurity team can call it from middleware/controllers.

What is in this PR

File Purpose
securityLogTypes.ts Single source of truth for event types, severity, outcome, rule references, reason sub-classifiers, the SecurityLogRecord shape and helper input shapes.
securityLogger.ts logSecurityEvent() core plus eight typed helpers, reason-specific defaults tables, sanitisation.
logTransport.ts LogTransport interface and the default ConsoleJsonTransport.
expressLogContext.ts fromRequest() extracts a safe Express context (ip_address, endpoint, method, user_id, role, request_id).
index.ts Convenience re-export so callers can import { logAuthFailure, fromRequest } from '.../logging'.
demo.ts Runnable demo covering all eight events, every reason sub-classifier and the sanitisation case.
README.md Per-file responsibilities, helper signatures, NDJSON output format, transport replacement, safety notes.
package.json, tsconfig.json TypeScript toolchain -typecheck, build, demo.

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.

8 participants