Skip to content

Commit

Permalink
add requirements json with native deps and denylist (#4753)
Browse files Browse the repository at this point in the history
  • Loading branch information
rochdev authored Oct 22, 2024
1 parent 15ab272 commit a16a051
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ onboarding_tests_installer:
onboarding_tests_k8s_injection:
variables:
WEBLOG_VARIANT: sample-app

requirements_json_test:
rules:
- when: on_success
variables:
REQUIREMENTS_BLOCK_JSON_PATH: ".gitlab/requirements_block.json"
REQUIREMENTS_ALLOW_JSON_PATH: ".gitlab/requirements_allow.json"
2 changes: 2 additions & 0 deletions .gitlab/prepare-oci-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ fi
echo -n $JS_PACKAGE_VERSION > packaging/sources/version

cd packaging

cp ../requirements.json sources/requirements.json
19 changes: 19 additions & 0 deletions .gitlab/requirements_allow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{"name": "min glibc x64", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.17"}},
{"name": "ok glibc x64", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.23"}},
{"name": "high glibc x64", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:3.0"}},
{"name": "musl x64", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "musl:1.2.2"}},
{"name": "min glibc arm64", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "arm64", "libc": "glibc:2.17"}},
{"name": "ok glibc arm64", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "arm64", "libc": "glibc:2.27"}},
{"name": "glibc x86","filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x86", "libc": "glibc:2.19"}},
{"name": "musl arm","filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "arm", "libc": "musl:1.2.2"}},
{"name": "musl arm64", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "arm64", "libc": "musl:1.2.2"}},
{"name": "musl x64", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "musl:1.2.2"}},
{"name": "musl x86", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x86", "libc": "musl:1.2.2"}},
{"name": "windows x64", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "windows", "arch": "x64"}},
{"name": "windows x86", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "windows", "arch": "x86"}},
{"name": "macos x64", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "darwin", "arch": "x64"}},
{"name": "macos arm64", "filepath": "/some/path", "args": [], "envars": [], "host": {"os": "darwin", "arch": "arm64"}},
{"name": "node app", "filepath": "/pathto/node", "args": ["/pathto/node", "./app.js"], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.40"}},
{"name": "ts-node app", "filepath": "/pathto/ts-node", "args": ["/pathto/ts-node", "./app.js"], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.40"}}
]
11 changes: 11 additions & 0 deletions .gitlab/requirements_block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{"name": "unsupported 2.x glibc x64","filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.16"}},
{"name": "unsupported 1.x glibc x64","filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:1.22"}},
{"name": "unsupported 2.x.x glibc x64","filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.16.9"}},
{"name": "unsupported 2.x glibc arm64","filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "arm64", "libc": "glibc:2.16"}},
{"name": "unsupported 2.x.x glibc x64","filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "arm64", "libc": "glibc:2.16.9"}},
{"name": "unsupported 2.x.x glibc x86","filepath": "/some/path", "args": [], "envars": [], "host": {"os": "linux", "arch": "x86", "libc": "glibc:2.17"}},
{"name": "npm","filepath": "/pathto/node", "args": ["/pathto/node", "/pathto/npm-cli.js"], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.40"}},
{"name": "yarn","filepath": "/pathto/node", "args": ["/pathto/node", "/pathto/yarn.js"], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.40"}},
{"name": "pnpm","filepath": "/pathto/node", "args": ["/pathto/node", "/pathto/pnpm.cjs"], "envars": [], "host": {"os": "linux", "arch": "x64", "libc": "glibc:2.40"}}
]
85 changes: 85 additions & 0 deletions requirements.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"$schema": "https://raw.githubusercontent.com/DataDog/auto_inject/refs/heads/main/preload_go/cmd/library_requirements_tester/testdata/requirements_schema.json",
"version": 1,
"native_deps": {
"glibc": [{
"arch": "arm",
"supported": true,
"description": "From ubuntu xenial (16.04)",
"min": "2.23"
},{
"arch": "arm64",
"supported": true,
"description": "From centOS 7",
"min": "2.17"
},{
"arch": "x64",
"supported": true,
"description": "From centOS 7",
"min": "2.17"
},{
"arch": "x86",
"supported": true,
"description": "From debian jessie (8)",
"min": "2.19"
}],
"musl": [{
"arch": "arm",
"supported": true,
"description": "From alpine 3.13"
},{
"arch": "arm64",
"supported": true,
"description": "From alpine 3.13"
},{
"arch": "x64",
"supported": true,
"description": "From alpine 3.13"
},{
"arch": "x86",
"supported": true,
"description": "From alpine 3.13"
}]
},
"deny": [
{
"id": "npm",
"description": "Ignore the npm CLI",
"os": null,
"cmds": [
"**/node",
"**/nodejs",
"**/ts-node",
"**/ts-node-*"
],
"args": [{ "args": ["*/npm-cli.js"], "position": 1}],
"envars": null
},
{
"id": "yarn",
"description": "Ignore the yarn CLI",
"os": null,
"cmds": [
"**/node",
"**/nodejs",
"**/ts-node",
"**/ts-node-*"
],
"args": [{ "args": ["*/yarn.js"], "position": 1}],
"envars": null
},
{
"id": "pnpm",
"description": "Ignore the pnpm CLI",
"os": null,
"cmds": [
"**/node",
"**/nodejs",
"**/ts-node",
"**/ts-node-*"
],
"args": [{ "args": ["*/pnpm.cjs"], "position": 1}],
"envars": null
}
]
}

0 comments on commit a16a051

Please sign in to comment.