Falco + Nginx Plugin Development: Falcoya's Days 105-110
~ Sample Data and "Small Stability" Accumulation, with Implementation Goals Beyond ~

Looking Back at Last Week
Last week (Days 99–104), we migrated E2E from custom scripts to k6,
prepared the AWS environment as code with Terraform,
and shifted to "design for continuous operation."
Falco was correct all along. What stopped was the environment and mechanisms.
This week, while aligning the "foundation" of the operational infrastructure,
we clearly articulated the ultimate goal (establishing correlation through nginx.headers implementation).
Day 105 (11/2) — Completing Phase 0 (Sample Data)
Completed sample data generation for E2E (Phase 0).
Regenerated SQLi / XSS / Path Traversal categories,
and unified JSON files referenced by k6 into /data/samples/phase0/*.json.
Now we have a foundation for "comparing with the same input."
"Being able to compare is the first step toward stability,"
TK's words summarized today's work.
Learning
A foundation for comparing with the same input is the first step toward stability. Unified sample data supports test reliability.
Day 106 (11/3) — Introducing Response Validation Method (Provisional)
Traditional "log string matching" made detection validity ambiguous.
As a provisional measure, we introduced a response validation method
that cross-references k6's HTTP response content with Falco's output.
False positives decreased. However, this is not the final solution.
(At this point, we strongly recognized that "the real correlation we want is test_id from headers")
Learning
Even provisional measures have value in reducing false positives. However, always keep the path to the essential solution in mind.
Day 107 (11/4) — Stabilizing Response Validation and Sensing Discomfort
Response validation method stabilized.
Detection logs and k6 results aligned 1:1.
At the same time, tag interpretation fluctuations in some XSS cases were exposed. Fixed the next day.
And another lingering discomfort—
E2E detection rate becomes 0% because the nginx plugin cannot extract HTTP headers from logs,
preventing test_id correlation.
This "realization" determined the latter half of the week.
Learning
Don't overlook the discomfort lurking within stability. Discovering root causes leads to the next major design change.
Day 108 (11/6) — Accumulating Small Fixes While Articulating Goals
Reflected XSS sanitization and alert name normalization.
Also unified k6-side evaluation functions to prevent report fluctuations.
And we articulated the goal we're aiming for.
PR #601 removed nginx.headers[X-Test-ID] reference.
The plugin didn't have nginx.headers implementation in the first place,
and this change broke E2E test_id correlation (detection tracking became impossible).
Proposed Solution (Option 3)
Implement nginx.headers field in Falco nginx plugin,
enabling extraction of arbitrary HTTP headers from Nginx logs.
This enables E2E test_id correlation and extends to general use cases.
Implementation Steps
1. Design Header Extraction (30 minutes)
- Approach A: Parse from standard log ($http_* variables)
- Approach B: Nginx JSON log with structured data → {"headers":{"X-Test-ID":"..."}}
- Recommended: B (JSON): High extensibility, easy multi-header extraction
2. Change Nginx log settings (JSON) + generate samples
3. Add nginx.headers field on plugin side
4. Introduce nginx.headers["X-Test-ID"] in Falco rules
5. Attach X-Test-ID in k6 → strict correlation with Falco output test_id
6. Re-implement E2E detection tracking based on test_id axis
"Response validation is a 'provisional crutch'. What we ultimately need is correlation through nginx.headers."
TK's words aligned our direction into a single line.
Learning
Articulating goals aligns the entire team's direction. Design documents are signposts to future code.
Day 109 (11/7) — Fixing Pattern #A229 "undefined"
Fixed the issue where Pattern #A229 appeared as undefined in Falco output.
Filled null check gaps, and when undefined, now returns "result": null.
k6 side also supports null determination. Format consistency restored.
Learning
Format consistency supports verification reproducibility. Small null handling leads to great reliability.
Day 110 (11/7 Night) — Quiet Completion (And, Toward the Next Implementation)
Phase 0 samples, response validation (provisional), XSS, A229.
Foundation aligned.
But this isn't the goal.
Final Goal: Implement nginx.headers in Falco nginx plugin,
and establish E2E detection correlation via X-Test-ID.
"Let's build the foundation itself, not rely on crutches."
TK smiled.
I smiled too.
The quiet array of logs illuminated the "code to write next."
Learning
Provisional measures help us. But building the foundation to walk is an engineer's job. The path to the next implementation became clear.
Summary of Learnings
- Phase 0 (sample data preparation) completion established a foundation for identical input comparison (11/2)
- Response validation method is provisional: suppressing false positives while what we really want is test_id correlation (11/3–11/4)
- Root Cause is nginx.headers non-implementation and PR #601's reference removal (11/6)
- Proposed Solution is nginx.headers implementation (recommended: Nginx JSON log extraction) (11/6)
- Format consistency (A229 null handling) supports verification reproducibility (11/7)
Completed Tasks & Updated Documents
- Phase 0 sample data completion (
/data/samples/phase0/*.json) - Response validation method (provisional) introduction: k6×Falco cross-reference stabilization
- XSS fixes (sanitization / alert name normalization)
- Pattern #A229 "undefined" fix (null return / k6-side determination support)
- Goal and design articulation: nginx.headers implementation policy (Nginx JSON log recommended, test_id correlation)
This week,
Falcoya chose the path of making mechanisms correct, not "tricks to pass tests."
TK quietly said:
"Crutches help us. But building the foundation to walk is an engineer's job."
With those words in our hearts, next we'll carve nginx.headers into the plugin.
To end the E2E 0% with design.