From 7739d0cf10165f6d865f4e12d473c83e8414ea9b Mon Sep 17 00:00:00 2001 From: Thomas Labarussias Date: Wed, 18 Sep 2024 14:28:49 +0200 Subject: [PATCH] add back github.repo to pass the CI Signed-off-by: Thomas Labarussias --- plugins/github/CHANGELOG.md | 81 ++++++++++++++++------------ plugins/github/pkg/github/extract.go | 7 ++- 2 files changed, 53 insertions(+), 35 deletions(-) diff --git a/plugins/github/CHANGELOG.md b/plugins/github/CHANGELOG.md index f6683d34..3f3ea401 100644 --- a/plugins/github/CHANGELOG.md +++ b/plugins/github/CHANGELOG.md @@ -2,97 +2,112 @@ ## v0.7.5 -- [`980fa2e`](https://github.com/falcosecurity/plugins/commit/980fa2e4) update(plugins/github): upgrade sdk and deps +* [`980fa2e`](https://github.com/falcosecurity/plugins/commit/980fa2e4) update(plugins/github): upgrade sdk and deps + ## v0.7.4 + ## v0.7.3 -- [`9298bcb`](https://github.com/falcosecurity/plugins/commit/9298bcb5) update(github): bump version to 0.7.3 +* [`9298bcb`](https://github.com/falcosecurity/plugins/commit/9298bcb5) update(github): bump version to 0.7.3 + +* [`6f7ef79`](https://github.com/falcosecurity/plugins/commit/6f7ef799) build(deps): bump golang.org/x/net in /plugins/github -- [`6f7ef79`](https://github.com/falcosecurity/plugins/commit/6f7ef799) build(deps): bump golang.org/x/net in /plugins/github ## v0.7.2 -- [`f37dd74`](https://github.com/falcosecurity/plugins/commit/f37dd748) chore(github): bump version to 0.7.2 +* [`f37dd74`](https://github.com/falcosecurity/plugins/commit/f37dd748) chore(github): bump version to 0.7.2 + ## v0.7.1 -- [`b0a2735`](https://github.com/falcosecurity/plugins/commit/b0a27351) fix(plugins/github): add length check in if statement +* [`b0a2735`](https://github.com/falcosecurity/plugins/commit/b0a27351) fix(plugins/github): add length check in if statement + +* [`5e2953f`](https://github.com/falcosecurity/plugins/commit/5e2953f8) build(deps): bump google.golang.org/protobuf in /plugins/github -- [`5e2953f`](https://github.com/falcosecurity/plugins/commit/5e2953f8) build(deps): bump google.golang.org/protobuf in /plugins/github ## v0.7.0 -- [`3a7f1b1`](https://github.com/falcosecurity/plugins/commit/3a7f1b19) fix(plugins/github): add a check that before and after commit IDs aren't null... +* [`3a7f1b1`](https://github.com/falcosecurity/plugins/commit/3a7f1b19) fix(plugins/github): add a check that before and after commit IDs aren't null... + +* [`81ccd91`](https://github.com/falcosecurity/plugins/commit/81ccd91d) build(deps): bump golang.org/x/net in /plugins/github -- [`81ccd91`](https://github.com/falcosecurity/plugins/commit/81ccd91d) build(deps): bump golang.org/x/net in /plugins/github ## v0.6.1 + ## v0.6.0 -- [`044d7d3`](https://github.com/falcosecurity/plugins/commit/044d7d3e) fix(plugins/github): fix small typo +* [`044d7d3`](https://github.com/falcosecurity/plugins/commit/044d7d3e) fix(plugins/github): fix small typo + +* [`4c22035`](https://github.com/falcosecurity/plugins/commit/4c220355) feat(plugins/github): add github tag to all rules in ruleset file -- [`4c22035`](https://github.com/falcosecurity/plugins/commit/4c220355) feat(plugins/github): add github tag to all rules in ruleset file +* [`409260a`](https://github.com/falcosecurity/plugins/commit/409260ab) fix(plugins/github): fix type field extraction -- [`409260a`](https://github.com/falcosecurity/plugins/commit/409260ab) fix(plugins/github): fix type field extraction ## v0.5.3 -- [`dc1e87e`](https://github.com/falcosecurity/plugins/commit/dc1e87e9) fix(plugins/github): fix ruleset dependencies +* [`dc1e87e`](https://github.com/falcosecurity/plugins/commit/dc1e87e9) fix(plugins/github): fix ruleset dependencies + ## v0.5.2 + ## v0.5.1 -- [`f1bd3b4`](https://github.com/falcosecurity/plugins/commit/f1bd3b4e) build(deps): bump golang.org/x/net in /plugins/github +* [`f1bd3b4`](https://github.com/falcosecurity/plugins/commit/f1bd3b4e) build(deps): bump golang.org/x/net in /plugins/github + ## v0.5.0 -- [`972cca0`](https://github.com/falcosecurity/plugins/commit/972cca0b) update(plugin/github): bump plugin version to v0.5.0 +* [`972cca0`](https://github.com/falcosecurity/plugins/commit/972cca0b) update(plugin/github): bump plugin version to v0.5.0 + +* [`0b6e12b`](https://github.com/falcosecurity/plugins/commit/0b6e12b5) update(rules/github): bump required_plugins_versions for github rules -- [`0b6e12b`](https://github.com/falcosecurity/plugins/commit/0b6e12b5) update(rules/github): bump required_plugins_versions for github rules ## v0.4.0 -- [`9654722`](https://github.com/falcosecurity/plugins/commit/96547228) update(plugins/github): bump plugin version to v0.4.0 +* [`9654722`](https://github.com/falcosecurity/plugins/commit/96547228) update(plugins/github): bump plugin version to v0.4.0 -- [`9f3a5e0`](https://github.com/falcosecurity/plugins/commit/9f3a5e0e) chore(plugins/github): update readme +* [`9f3a5e0`](https://github.com/falcosecurity/plugins/commit/9f3a5e0e) chore(plugins/github): update readme + +* [`0b7468a`](https://github.com/falcosecurity/plugins/commit/0b7468a0) update(plugins/github): fix makefile cleanup -- [`0b7468a`](https://github.com/falcosecurity/plugins/commit/0b7468a0) update(plugins/github): fix makefile cleanup ## v0.3.1 -- [`1bf3df4`](https://github.com/falcosecurity/plugins/commit/1bf3df4c) update(plugin/github): bump version to 0.3.1 +* [`1bf3df4`](https://github.com/falcosecurity/plugins/commit/1bf3df4c) update(plugin/github): bump version to 0.3.1 + +* [`cf809fa`](https://github.com/falcosecurity/plugins/commit/cf809fa9) fix(plugins/github): correctly parse git diffs -- [`cf809fa`](https://github.com/falcosecurity/plugins/commit/cf809fa9) fix(plugins/github): correctly parse git diffs ## v0.3.0 -- [`c2412cf`](https://github.com/falcosecurity/plugins/commit/c2412cf5) update(plugins/github): bump version to 0.3.0 +* [`c2412cf`](https://github.com/falcosecurity/plugins/commit/c2412cf5) update(plugins/github): bump version to 0.3.0 + ## v0.2.0 -- [`d9c1f08`](https://github.com/falcosecurity/plugins/commit/d9c1f084) update(plugins/github): adapt plugin for plugin-sdk-go v0.4.0 +* [`d9c1f08`](https://github.com/falcosecurity/plugins/commit/d9c1f084) update(plugins/github): adapt plugin for plugin-sdk-go v0.4.0 + +* [`71f653f`](https://github.com/falcosecurity/plugins/commit/71f653f3) chore(plugins/github): address review suggestions -- [`71f653f`](https://github.com/falcosecurity/plugins/commit/71f653f3) chore(plugins/github): address review suggestions +* [`32cccff`](https://github.com/falcosecurity/plugins/commit/32cccff1) chore(plugins/github): use log instead of fmt prints -- [`32cccff`](https://github.com/falcosecurity/plugins/commit/32cccff1) chore(plugins/github): use log instead of fmt prints +* [`dbf7459`](https://github.com/falcosecurity/plugins/commit/dbf7459f) chore(plugins/github): reduce method visibility -- [`dbf7459`](https://github.com/falcosecurity/plugins/commit/dbf7459f) chore(plugins/github): reduce method visibility +* [`a1ef331`](https://github.com/falcosecurity/plugins/commit/a1ef331c) chore(plugins/github): solve warnings -- [`a1ef331`](https://github.com/falcosecurity/plugins/commit/a1ef331c) chore(plugins/github): solve warnings +* [`c79c890`](https://github.com/falcosecurity/plugins/commit/c79c8904) refactor(plugin/github): adhere to package design and init plugin main file -- [`c79c890`](https://github.com/falcosecurity/plugins/commit/c79c8904) refactor(plugin/github): adhere to package design and init plugin main file +* [`79336d4`](https://github.com/falcosecurity/plugins/commit/79336d4d) chore(plugins/github): insert copyright headers -- [`79336d4`](https://github.com/falcosecurity/plugins/commit/79336d4d) chore(plugins/github): insert copyright headers +* [`57caa6c`](https://github.com/falcosecurity/plugins/commit/57caa6c4) update(plugins/github): bump dependencies version -- [`57caa6c`](https://github.com/falcosecurity/plugins/commit/57caa6c4) update(plugins/github): bump dependencies version +* [`678787f`](https://github.com/falcosecurity/plugins/commit/678787f8) update(plugins/github/rules): add version dependencies in ruleset -- [`678787f`](https://github.com/falcosecurity/plugins/commit/678787f8) update(plugins/github/rules): add version dependencies in ruleset +* [`982ac09`](https://github.com/falcosecurity/plugins/commit/982ac09b) refactor(plugins/github): create package directory -- [`982ac09`](https://github.com/falcosecurity/plugins/commit/982ac09b) refactor(plugins/github): create package directory +* [`86b4bc3`](https://github.com/falcosecurity/plugins/commit/86b4bc33) chore(plugins/github): apply suggestions from review -- [`86b4bc3`](https://github.com/falcosecurity/plugins/commit/86b4bc33) chore(plugins/github): apply suggestions from review -z \ No newline at end of file diff --git a/plugins/github/pkg/github/extract.go b/plugins/github/pkg/github/extract.go index 959e324f..179abcfe 100644 --- a/plugins/github/pkg/github/extract.go +++ b/plugins/github/pkg/github/extract.go @@ -32,8 +32,9 @@ func (p *Plugin) Fields() []sdk.FieldEntry { {Type: "string", Name: "github.type", Display: "Message Type", Desc: "Message type, e.g. 'star' or 'repository'."}, {Type: "string", Name: "github.action", Display: "Action Type", Desc: "The github event action. This field typically qualifies the github.type field. For example, a message of type 'star' can have action 'created' or 'deleted'."}, {Type: "string", Name: "github.user", Display: "User", Desc: "Name of the user that triggered the event."}, - {Type: "string", Name: "github.repo.url", Display: "Repository", Desc: "URL of the git repository where the event occurred. Github Webhook payloads contain the repository property when the event occurs from activity in a repository."}, - {Type: "string", Name: "github.repo.name", Display: "Repository", Desc: "Name of the git repository where the event occurred. Github Webhook payloads contain the repository property when the event occurs from activity in a repository."}, + {Type: "string", Name: "github.repo", Display: "Repository", Desc: "(deprecated) URL of the git repository where the event occurred. Github Webhook payloads contain the repository property when the event occurs from activity in a repository."}, + {Type: "string", Name: "github.repo.url", Display: "Repository URL", Desc: "URL of the git repository where the event occurred. Github Webhook payloads contain the repository property when the event occurs from activity in a repository."}, + {Type: "string", Name: "github.repo.name", Display: "Repository Name", Desc: "Name of the git repository where the event occurred. Github Webhook payloads contain the repository property when the event occurs from activity in a repository."}, {Type: "string", Name: "github.org", Display: "Organization", Desc: "Name of the organization the git repository belongs to."}, {Type: "string", Name: "github.owner", Display: "Owner", Desc: "Name of the repository's owner."}, {Type: "string", Name: "github.repo.public", Display: "Public", Desc: "'true' if the repository affected by the action is public. 'false' otherwise."}, @@ -116,6 +117,8 @@ func getfieldStr(jdata *fastjson.Value, field string) (bool, string) { res = string(jdata.GetStringBytes("action")) case "github.user": res = string(jdata.Get("sender", "login").GetStringBytes()) + case "github.repo": + res = string(jdata.Get("repository", "html_url").GetStringBytes()) case "github.repo.url": res = string(jdata.Get("repository", "html_url").GetStringBytes()) case "github.repo.name":