Skip to content
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

appsec: upgrade go-libddwaf/v3 #2670

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

Conversation

Hellzy
Copy link
Contributor

@Hellzy Hellzy commented Apr 25, 2024

What does this PR do?

JIRA: APPSEC-53057

Upgrades the go-libddwaf dependency to v3.
In v3, actions are now returned as a map[string]any mapping action types to their parameters.
Parameters, while technicaly described as a map[string]any, are actually map[string]string (i.e all param values are provided as strings).

Changes

  • New action package that defines action parameter types and provides utilities to translate waf result action values
    to actual go values
  • Remove former action caching system which would embed actions in waf handles.
  • Remove waf handle wrapping which is not necessary anymore
  • Don't parse actions out of the ruleset, which is not necessary anymore since we don't cache them
  • After a WAF run, we now:
    • parse actions returned through WAF results (new)
    • generate the actions (new)
    • propagate actions through dyngo and execute them

Motivation

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@DataDog DataDog deleted a comment from github-actions bot May 6, 2024
@pr-commenter
Copy link

pr-commenter bot commented May 6, 2024

Benchmarks

Benchmark execution time: 2024-05-07 09:00:58

Comparing candidate commit 117a779 in PR branch francois.mazeau/go-libddwaf-update with baseline commit 3a426ca in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 43 metrics, 1 unstable metrics.

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.

None yet

1 participant