This repository was archived by the owner on Apr 3, 2026. It is now read-only.
fix: make appsec.DefaultRuleset reutrn the ruleset as-is#46
Merged
RomainMuller merged 2 commits intomainfrom May 19, 2025
Merged
fix: make appsec.DefaultRuleset reutrn the ruleset as-is#46RomainMuller merged 2 commits intomainfrom
RomainMuller merged 2 commits intomainfrom
Conversation
RomainMuller
commented
May 19, 2025
|
|
||
| // StaticRecommendedRules holds the recommended AppSec security rules (v1.14.2) | ||
| // Source: https://github.com/DataDog/appsec-event-rules/blob/1.14.2/build/recommended.json | ||
| StaticRecommendedRules = unsafe.String(&staticRecommendedRules[0], len(staticRecommendedRules)) |
Contributor
Author
There was a problem hiding this comment.
This is to retain the exported symbol (otherwise it's a breaking change) while avoiding to cause a full copy of the backing data to be done (because it's unnecessary).
That symbol would be dropped in a future version.
eliottness
approved these changes
May 19, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The
DefaultRulesetfunction used to re-marshal a JSON document that was just parsed; as an artifact from times where the processors were merged into the ruleset separately. This has not been needed since a long time, as the default ruleset now includes the relevant processors already.This removes inefficiencies as we no longer have to parse, then format the data. The embedded object is also carried directly as a
[]byteslice instead of a string, to remove the need for a string copy to happen all the time.