diff --git a/pkg/security/secl/model/syscalls.go b/pkg/security/secl/model/syscalls.go index ca1bd51451a64..59007c7629286 100644 --- a/pkg/security/secl/model/syscalls.go +++ b/pkg/security/secl/model/syscalls.go @@ -6,9 +6,6 @@ //go:build linux // +build linux -//go:generate go run github.com/DataDog/datadog-agent/pkg/security/secl/model/syscall_table_generator -table-url https://raw.githubusercontent.com/torvalds/linux/v5.19/arch/x86/entry/syscalls/syscall_64.tbl -output syscalls_linux_amd64.go -output-string syscalls_string_linux_amd64.go -abis common,64 -//go:generate go run github.com/DataDog/datadog-agent/pkg/security/secl/model/syscall_table_generator -table-url https://raw.githubusercontent.com/torvalds/linux/v5.19/include/uapi/asm-generic/unistd.h -output syscalls_linux_arm64.go -output-string syscalls_string_linux_arm64.go - package model import ( diff --git a/pkg/security/secl/model/syscalls_string_linux_amd64.go b/pkg/security/secl/model/syscalls_string_linux_amd64.go index 5b32b64f8a568..39b70b17150cf 100644 --- a/pkg/security/secl/model/syscalls_string_linux_amd64.go +++ b/pkg/security/secl/model/syscalls_string_linux_amd64.go @@ -1,4 +1,4 @@ -// Code generated by "stringer -type Syscall -output syscalls_string_linux_amd64.go syscalls_linux_amd64.go"; DO NOT EDIT. +// Code generated by "stringer -type Syscall -output pkg/security/secl/model/syscalls_string_linux_amd64.go pkg/security/secl/model/syscalls_linux_amd64.go"; DO NOT EDIT. package model diff --git a/pkg/security/secl/model/syscalls_string_linux_arm64.go b/pkg/security/secl/model/syscalls_string_linux_arm64.go index 54fa94f312bd9..1d2f5c941ecda 100644 --- a/pkg/security/secl/model/syscalls_string_linux_arm64.go +++ b/pkg/security/secl/model/syscalls_string_linux_arm64.go @@ -1,4 +1,4 @@ -// Code generated by "stringer -type Syscall -output syscalls_string_linux_arm64.go syscalls_linux_arm64.go"; DO NOT EDIT. +// Code generated by "stringer -type Syscall -output pkg/security/secl/model/syscalls_string_linux_arm64.go pkg/security/secl/model/syscalls_linux_arm64.go"; DO NOT EDIT. package model diff --git a/tasks/security_agent.py b/tasks/security_agent.py index d290c8abd766b..cdc50fac75b49 100644 --- a/tasks/security_agent.py +++ b/tasks/security_agent.py @@ -567,6 +567,31 @@ def cws_go_generate(ctx): ctx.run("go generate ./pkg/security/...") +@task +def generate_syscall_table(ctx): + def single_run(ctx, table_url, output_file, output_string_file, abis=None): + if abis: + abis = f"-abis {abis}" + ctx.run( + f"go run github.com/DataDog/datadog-agent/pkg/security/secl/model/syscall_table_generator -table-url {table_url} -output {output_file} -output-string {output_string_file} {abis}" + ) + + linux_version = "v6.1" + single_run( + ctx, + f"https://raw.githubusercontent.com/torvalds/linux/{linux_version}/arch/x86/entry/syscalls/syscall_64.tbl", + "pkg/security/secl/model/syscalls_linux_amd64.go", + "pkg/security/secl/model/syscalls_string_linux_amd64.go", + abis="common,64", + ) + single_run( + ctx, + f"https://raw.githubusercontent.com/torvalds/linux/{linux_version}/include/uapi/asm-generic/unistd.h", + "pkg/security/secl/model/syscalls_linux_arm64.go", + "pkg/security/secl/model/syscalls_string_linux_arm64.go", + ) + + @task def generate_btfhub_constants(ctx, archive_path, force_refresh=False): output_path = "./pkg/security/probe/constantfetch/btfhub/constants.json"