Compare commits

..

15 commits

Author SHA1 Message Date
Ramy Elkest
f9cc781106
chore: remove update-rules workflow (repo deprecated) (#72)
## Summary

This repo is deprecated (last real commit: Aug 2025). Instead of
migrating the `update-rules.yml` workflow from
`DD_K9_LIBRARY_GO_APP_PRIVATE_KEY` to dd-octo-sts, simply remove the
workflow entirely.

This eliminates the dependency on the shared secret, which is the goal
of the migration effort.

## Changes
- Deleted `.github/workflows/update-rules.yml` (scheduled rule updater)

## Notes
- The `appsec-internal-go.github.read-rules.sts.yaml` policy in
appsec-event-rules (merged in DataDog/appsec-event-rules#281) is now
unused but harmless to leave
- After merge, the `DD_K9_LIBRARY_GO_APP_PRIVATE_KEY` secret can be
removed from this repo's settings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---
Jira: APPSEC-62083

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:03:57 +02:00
dd-k9-library-go[bot]
5240423413
chore: update default ruleset to v1.15.1 (#57)
Updated default ruleset to v1.15.1.

---------

Co-authored-by: dd-k9-library-go[bot] <214463715+dd-k9-library-go[bot]@users.noreply.github.com>
Co-authored-by: Romain Marcadier <romain.marcadier@datadoghq.com>
2025-08-18 09:26:06 +00:00
dd-k9-library-go[bot]
3f57bd23d1
Update embedded AppSec Rules to 1.15.1 (#55)
Automatically created by [GitHub
Actions](https://github.com/DataDog/appsec-internal-go/actions/runs/16872215336).

Co-authored-by: dd-k9-library-go[bot] <214463715+dd-k9-library-go[bot]@users.noreply.github.com>
2025-08-14 13:53:20 +00:00
Flavien Darche
941568f726
Refine documentation for the proxy sample rate (#53)
# Changes
Related to the PR https://github.com/DataDog/dd-trace-go/pull/3698, the
documentation of the proxy sample rate has been updated.
2025-06-27 14:20:10 +00:00
Flavien Darche
0132247586
feat: proxy sampler (#52)
# Changes

This PRs adds a new sampler for proxies environment.
([RFC](https://docs.google.com/document/d/1C9BmWYNM02_-T1EnHpAzziyytJJ1pBE6iCsQoQwVtyU/edit?pli=1&tab=t.0))
It also tweak the limiter to take interval.
2025-06-26 16:17:39 +02:00
Romain Marcadier
1842076ace
chore: use GitHub App instead of PAT (#50) 2025-06-06 14:04:11 +00:00
Romain Marcadier
77e25f6a6a
fix: make appsec.DefaultRuleset reutrn the ruleset as-is (#46)
The `DefaultRuleset` function 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 `[]byte`
slice instead of a string, to remove the need for a string copy to
happen all the time.

Co-authored-by: Eliott Bouhana <47679741+eliottness@users.noreply.github.com>
2025-05-19 15:34:24 +02:00
Eliott Bouhana
8b944a534d
feat(config): new default value obfuscation regex (#45) 2025-05-19 12:39:02 +02:00
Eliott Bouhana
fa998d63b4
chore(ci): rollout ubuntu 20 in favor of ubuntu 24 (#48)
Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
2025-05-19 09:50:40 +00:00
Romain Marcadier
24b05181e9
fix: allow system tests to override API Security sampling interval (#44)
Some system tests must override the sampling interval to 0 in order to
be able to test schema extraction works as intended. This requires
reading the default interval from an environment variable.
2025-04-03 10:15:48 +00:00
Romain Marcadier
6e714c245f
feat: update embedded rules to v1.14.2 (#43) 2025-04-02 14:39:08 +02:00
Romain Marcadier
d1b4c20383
chore: fix broken tests; remove || true in CI (#41) 2025-04-02 14:38:09 +02:00
Romain Marcadier
4b58d57608
feat: upgrade built-in rules to v1.14.1 (#42) 2025-04-02 12:27:28 +02:00
Romain Marcadier
e5b7e3f2b1
fix: un-do breaking changes from v1.10.0 (#40) 2025-04-02 09:52:29 +00:00
Romain Marcadier
5688dad2ce
apisec: new sampler implementation (#39)
Implementation for a new API Security sampler that aimes at providing
better information as the sampling decision is made per endpoint (method
plus route) and response status code; instead of being made across all.

This implementation is based on an open addressing hash table using
copy-update-replace semantics, so that it is able to operate completely
lock-less. This is described by [RFC-1021](https://docs.google.com/document/d/1U0PeFZ83hGFUSBKDFLzpl1xNVQL1881ry95WzSB9a-Q/edit?tab=t.0#heading=h.banlidxrzyc9).

Here is the result of running the benchmark on my machine with
`1,000,000,000` operations distributed over `concurrency * 10` goroutines
for each configuration:

```
goos: darwin
goarch: arm64
pkg: github.com/DataDog/appsec-internal-go/apisec
cpu: Apple M1 Max
                                         │      1       │                 1000                  │
                                         │    sec/op    │    sec/op      vs base                │
Sampler/keySpaceSize=2048/interval=1s-10   76.27n ±  2%    88.40n ±  1%  +15.91% (p=0.000 n=10)
Sampler/keySpaceSize=8192/interval=1s-10   77.77n ± 26%   119.85n ± 25%  +54.11% (p=0.000 n=10)
geomean                                    77.01n          102.9n        +33.65%

                                         │       1       │                 1000                 │
                                         │     keep%     │    keep%      vs base                │
Sampler/keySpaceSize=2048/interval=1s-10    15.77m ±  1%   18.23m ±  3%  +15.60% (p=0.000 n=10)
Sampler/keySpaceSize=8192/interval=1s-10   1314.5m ± 26%   204.4m ± 38%  -84.45% (p=0.000 n=10)
geomean                                     144.0m         61.04m        -57.60%

                                         │      1       │                  1000                   │
                                         │     B/op     │    B/op     vs base                     │
Sampler/keySpaceSize=2048/interval=1s-10   0.000 ± 0%     0.000 ± 0%         ~ (p=1.000 n=10) ¹
Sampler/keySpaceSize=8192/interval=1s-10   1.000 ± 0%     0.000 ± 0%  -100.00% (p=0.000 n=10)
geomean                                               ²               ?                       ² ³
¹ all samples are equal
² summaries must be >0 to compute geomean
³ ratios must be >0 to compute geomean

                                         │      1       │                1000                 │
                                         │  allocs/op   │ allocs/op   vs base                 │
Sampler/keySpaceSize=2048/interval=1s-10   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
Sampler/keySpaceSize=8192/interval=1s-10   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                               ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean
```


---------

Co-authored-by: Eliott Bouhana <47679741+eliottness@users.noreply.github.com>
2025-04-02 11:01:40 +02:00
22 changed files with 2958 additions and 213 deletions