Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CWS][SEC-7871] add activity dumps proto and generated files #242

Merged
merged 6 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ contimage/ @DataDog/agent-shared-components @DataDog/container-i
sbom/ @DataDog/agent-shared-components @DataDog/container-integrations
CycloneDX/ @DataDog/agent-shared-components @DataDog/container-integrations
cyclonedx_v1_4/ @DataDog/agent-shared-components @DataDog/container-integrations
cws/ @DataDog/agent-shared-components @DataDog/agent-security
proto/cws/ @DataDog/agent-shared-components @DataDog/agent-security
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ The process payload is defined in [`proto/process/agent.proto`](./proto/process/
The following implementations are available:
* Go (gogofast): [github.com/DataDog/agent-payload/process](https://pkg.go.dev/github.com/DataDog/agent-payload/process) (note that this go package contains additional functionality beyond the generated PB implementation).

## CWS

The CWS security dumps payload is defined in [`proto/cws/dumpsv1/activity_dump.proto`](./proto/cws/dumpsv1/activity_dump.proto).
The following implementations are available:
* Go (vtproto): [github.com/DataDog/agent-payload/v5/cws/dumpsv1](https://pkg.go.dev/github.com/DataDog/agent-payload/v5/cws/dumpsv1)
* Java: [`java/com/dd/cws/adv1/pb/SecDumpProto.java`](./java/com/dd/cws/adv1/pb/SecDumpProto.java)

# Updating Proto Definitions

After updating the IDL you must:
Expand Down
16 changes: 16 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,22 @@ BASH
PATH=#{protoc_gen_go_dir}/bin #{protoc_binary_2} --proto_path=$GOPATH/src:. --go_out=$GOPATH/src proto/deps/github.com/CycloneDX/specification/schema/bom-1.4.proto
PATH=#{protoc_gen_go_dir}/bin #{protoc_binary_2} --proto_path=$GOPATH/src:. --go_out=$GOPATH/src proto/sbom/sbom.proto

# Install protoc-gen-go-vtproto
GOPATH=#{protoc_gen_go_dir} go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@latest

echo "Generating CWS Activity Dumps v1"
PATH=#{protoc_gen_go_dir}/bin #{protoc_binary_2} --proto_path=$GOPATH/src:. \
--java_out=java \
--go_out=$GOPATH/src \
--go-vtproto_out=$GOPATH/src \
--go-vtproto_opt=features=pool+marshal+unmarshal+size \
--go-vtproto_opt=pool=github.com/DataDog/agent-payload/v5/cws/dumpsv1.SecDump \
--go-vtproto_opt=pool=github.com/DataDog/agent-payload/v5/cws/dumpsv1.ProcessActivityNode \
--go-vtproto_opt=pool=github.com/DataDog/agent-payload/v5/cws/dumpsv1.FileActivityNode \
--go-vtproto_opt=pool=github.com/DataDog/agent-payload/v5/cws/dumpsv1.FileInfo \
--go-vtproto_opt=pool=github.com/DataDog/agent-payload/v5/cws/dumpsv1.ProcessInfo \
proto/cws/dumpsv1/activity_dump.proto
Copy link
Contributor

@sgnn7 sgnn7 Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README needs an update to include this PB def I think. May also be good to add the new files to your team's CODEOWNERS entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good in the latest revision, thanks !


cp -r v5/* .
rm -rf v5
BASH
Expand Down
Loading