Skip to content

wip: support asm #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

duncanista
Copy link
Contributor

No description provided.

@duncanista duncanista force-pushed the jordan.gonzalez/appsec/support-application-and-api-protection branch from a93c4e8 to 2ec14e9 Compare June 3, 2025 18:35
@duncanista duncanista force-pushed the jordan.gonzalez/appsec/support-application-and-api-protection branch from 346a130 to ba7a1da Compare June 6, 2025 17:36
@RomainMuller RomainMuller force-pushed the jordan.gonzalez/appsec/support-application-and-api-protection branch from 0e3ae0b to ba7a1da Compare July 7, 2025 16:11
@RomainMuller RomainMuller force-pushed the jordan.gonzalez/appsec/support-application-and-api-protection branch from 97a4a9e to e0902ba Compare July 7, 2025 16:42
@RomainMuller RomainMuller force-pushed the jordan.gonzalez/appsec/support-application-and-api-protection branch from a177439 to cd8e2cf Compare July 9, 2025 10:39
async fn extract(self) -> HttpData;
}

pub(super) async fn extract_request_address_data(body: &Bytes) -> Option<(HttpData, RequestType)> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember you mentioned maybe we want to eventually consolidate this with the triggers – overall, great

Deserializing into type might be slow since payloads can technically be up to 6MB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, next file is doing a similar check from triggers code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that specific logic, as you mentioned privately, was ported from Go, maybe for the ones that already exist here in the triggers, could we use that same logic and for the events that we don't cover for inferred spans, I.E. Kong, we maintain the Go port?

Comment on lines +60 to +65
for (key, value) in appsec_context.tags() {
self.invocation_span
.meta
.entry(key.clone())
.or_insert(value.clone());
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use extend here?


// Note: We intentionally don't set `actor.ip` because we don't have a definitive signal here.

//TODO(romain.marcadier): Figure out whether we can set "_dd.runtime_family" here; and to what value.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there is a set of valid values, we can talk about how and when to set it, we get the specific runtime at a later point of init, but we guarantee it will arrive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main concern is if there's a better way to tie contexts, I won't know until I inspect the code thoroughly, but so far this looks good

Comment on lines +191 to +194
if let Some(appsec_processor) = appsec_processor {
if let Some(request_id) = intercepted_parts
.headers
.get("Lambda-Runtime-Aws-Request-Id")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember either in next or response we can get this by checking at the Path, we can leverage Axum for it, will check again which one was it

@RomainMuller RomainMuller force-pushed the jordan.gonzalez/appsec/support-application-and-api-protection branch from 1a2a3d6 to d17cc48 Compare July 16, 2025 17:24
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.

2 participants