Skip to content

[feature] Layer 1 input normalisation (NFKC + JSON normalization + decoding)#28

Open
RachanaB5 wants to merge 1 commit into
c2siorg:mainfrom
RachanaB5:feat/layer1-input-normalisation
Open

[feature] Layer 1 input normalisation (NFKC + JSON normalization + decoding)#28
RachanaB5 wants to merge 1 commit into
c2siorg:mainfrom
RachanaB5:feat/layer1-input-normalisation

Conversation

@RachanaB5
Copy link
Copy Markdown
Contributor

Summary

Implements Layer 1 input normalisation for the Cognitive Firewall pipeline to ensure consistent and safe preprocessing of all incoming data before further analysis.

Features

  • Unicode normalization using NFKC
  • Removal of zero-width and invisible characters
  • Safe percent-decoding with preservation of literal +
  • Recursive JSON normalization for:
    • strings
    • arrays ([]interface{})
    • maps (map[string]interface{})
  • Graceful handling of nil values

Integration

  • Integrated into listener flow after HMAC and nonce validation
  • Normalised payload replaces original payload before further pipeline stages

Tests

  • Unit tests for normalization logic
  • JSON normalization tests covering nested structures
  • Listener test for invalid JSON payload handling

Validation

  • Successfully built and ran the sidecar locally
  • Verified service starts and listens on UDS socket (/tmp/acf.sock)
  • Confirmed normalization pipeline executes without runtime errors

Notes

This establishes the foundational preprocessing layer required for downstream:

  • injection detection
  • risk scoring
  • policy evaluation

Closes #8

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.

[Design Proposal] Adversarial Input Normalisation Layer (Layer 1) — Canonicalisation & De-obfuscation Engine

1 participant