Compare commits

...

31 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
Romain Marcadier
c8b8550b38
Update embedded AppSec Rules to 1.13.3 (#37)
Automatically created by [GitHub
Actions](https://github.com/DataDog/appsec-internal-go/actions/runs/13116094580).

Co-authored-by: github-actions[bot] on behalf of genesor <genesor@users.noreply.github.com>
2025-02-04 10:31:50 +01:00
Benjamin De Bernardi
afa49a73ed
Update third party actions (#38)
`upload-artifact` and `download-artifact` were outdated and causing [job
failures](https://github.com/DataDog/appsec-internal-go/actions/runs/13115825664)

-  `checkout` `upload-artifact` and `download-artifact` to v4 
- `setup-go` to v5
- all pinned to specific releases
2025-02-04 10:25:39 +01:00
Eliott Bouhana
2da4f26da8
chore: upgrade go versions and CI runners (#35) 2024-11-04 09:57:32 +01:00
Eliott Bouhana
d58768f1f6
chore: upgrade static rules 1.13.1 -> 1.13.2 (#36)
Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
2024-10-29 13:09:56 +01:00
Romain Marcadier
31eced2491
feat: ruleset v1.13.1 (#34)
Additionally, update `Dockerfile` to use the relatively new secrets
feature to pass the `GITHUB_TOKEN`, in order to adhere to best
practices.
2024-10-18 12:14:51 +02:00
Eliott Bouhana
d564893718
chore: upgrade ruleset 1.13.0 -> 1.13.1 (#33)
Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
2024-09-30 12:04:31 +00:00
Romain Marcadier
405608c9ec
Update embedded AppSec Rules to 1.13.0 (#32)
Automatically created by [GitHub
Actions](https://github.com/DataDog/appsec-internal-go/actions/runs/10138997675).

Co-authored-by: github-actions[bot] on behalf of RomainMuller <RomainMuller@users.noreply.github.com>
2024-07-29 11:45:43 +02:00
Eliott Bouhana
c629936193
chore: deprecate go 1.20 & upgrade obfuscation regexps (#31)
- [x] Upgrade the go.mod and run `go mod tidy`
- [x] Remove go 1.20 from the CI
- [x] Replace Obfuscation Key & Value Regexprs withe better ones

Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
2024-07-10 17:37:25 +02:00
Eliott Bouhana
d26bbec527
ci: rollout macos-11 in favor of macos-14 (#30)
GitHub is deprecating macos-11 runners so we need to swap them out

Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
2024-06-20 16:14:19 +02:00
François Mazeau
1439246c18
refactor: remove external rules processors (#29)
We used to add rules processors manually because they were not part of
the default ruleset.
Now that they are, this step is not needed and we get rid of this extra
step.

Draft for now, this needs to be tested against dd-trace-go
2024-06-20 16:13:50 +02:00
Romain Marcadier
1cf8118ca7
Update embedded AppSec Rules to 1.12.0 (#27)
Automatically created by [GitHub
Actions](https://github.com/DataDog/appsec-internal-go/actions/runs/9542753491).

---------

Co-authored-by: github-actions[bot] on behalf of RomainMuller <RomainMuller@users.noreply.github.com>
Co-authored-by: François Mazeau <francois.mazeau@datadoghq.com>
2024-06-19 09:03:34 +02:00
François Mazeau
68bbdedaff
feat: add RASP enablement to config (#26) 2024-05-28 11:27:17 +00:00
François Mazeau
601f3d1c4d
chore: add CODEOWNER file (#25) 2024-03-21 10:58:24 +01:00
Romain Marcadier
a0d07db776
Update embedded AppSec Rules to 1.11.0 (#24)
Co-authored-by: github-actions[bot] on behalf of RomainMuller <RomainMuller@users.noreply.github.com>
2024-03-04 10:39:05 +01:00
Julio Guerra
8c3da8ca26
appsec/config: 1 ms default WAF timeout (#23) 2024-03-01 10:00:35 +01:00
Romain Marcadier
674e6485ef
fix: possible goroutine leak in limiter.TokenTicker (in tests only) (#22) 2024-02-21 13:57:05 +01:00
26 changed files with 4067 additions and 826 deletions