[EXPERIMENTAL] AppSec snapshot generation with unreleased tracer#147
Draft
Strech wants to merge 18 commits into
Draft
[EXPERIMENTAL] AppSec snapshot generation with unreleased tracer#147Strech wants to merge 18 commits into
Strech wants to merge 18 commits into
Conversation
Initialize AppSec context around each Lambda invocation, push request and response events through the AppSec gateway, and record security events on the aws.lambda span. The extension handles tag propagation to inferred spans. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adding an Exclude key overrides rubocop's default excludes, which includes vendor/**. Re-add it explicitly so CI lint passes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Precompiled FFI binaries have glibc mismatch with Lambda AL2 runtime, causing crashes when AppSec loads the libddwaf chain. Force source compilation and remove precompiled variants. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add appsec-request handler with DD_APPSEC_ENABLED=true and an input event containing Arachni user-agent to trigger WAF detection. Snapshots will be recorded on first AWS deploy. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wrap gateway pushes in catch(Datadog::AppSec::Ext::INTERRUPT) in both on_start and on_finish. When WAF decides to block, build a Lambda-shaped response override (statusCode/headers/body) via AppSec::Response. The listener exposes response_override for wrap to short-circuit the handler on request-phase blocks or replace the response on response-phase blocks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Normalize raw AWS event payloads into a standard key set before passing to DataContainer and Request. This removes v1/v2 detection from Request and aligns with dd-trace-rb's simplified WAFAddresses that consume standard keys. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
V2 events were missing the `query` key, causing `server.request.query` WAF address to be empty for API Gateway V2 payloads. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename add_appsec_tags to tag_and_keep, move from create_context to on_start for visibility - Pass cold_start flag from listener through to AppSec.on_start instead of tracking @oneshot_tags_sent module state - Align guard clause with Rack: return unless trace && span - Improve test quality: inline event values, use receive_messages, remove instance_variable_set for @request, relax unrelated assertions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The layer was built on ruby:X.Y (Debian Bookworm) which has libffi.so.8, but Lambda AL2 runtime only has libffi.so.6. Source-compiled FFI linked against .so.8 and crashed at runtime. Switch to public.ecr.aws/lambda/ruby:X.Y as builder so native extensions compile against the same system libraries available at runtime. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ruby 3.2 uses AL2 with yum, Ruby 3.3+ uses AL2023 with dnf. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Combines PR #144 (AppSec setup) with PR #146 (build layer from dd-trace-rb branch) to test snapshot generation with unreleased tracer code.
What's here
git_refDockerfile support from build layer using dd-trace branch #146 (cherry-picked)update-snapshotsworkflow (workflow_dispatch) that:git_refinput to build dd-trace-rb from sourceUPDATE_SNAPSHOTS=trueHow to use
git_refto the dd-trace-rb branch with AppSec aws_lambda instrumentation🤖 Generated with Claude Code