@@ -39,25 +39,104 @@ disabled = false
3939pulldown_type = 1
4040
4141[github_json]
42- FIELDALIAS-dependabot = "alert.affected_package_name" AS affected_package_name "alert.external_identifier" AS cve "alert.external_reference" AS url "alert.most_recent_instance.location.path" AS alert_location_path "alert.rule.description" AS alert_description "alert.rule.security_severity_level" AS severity_level "alert.severity" AS severity eventtype AS vendor_product "repository.html_url" AS dest "repository.owner.login" AS user
43- EVAL-dvc = replace(host, ":\d+", "")
44- EVAL-signature = CASE(isnull(alert_description), UPPER(severity) + " Dependency Vulnerability on package " + affected_package_name, 1=1, alert_description)
45- EVAL-xref = if(isnotnull(affected_package_name), affected_package_name, alert_location_path)
46- FIELDALIAS-RepoAlias = "organization.login" ASNEW organization "repository.name" ASNEW repository_name
47- EVAL-category = if(isnotnull(alert_description), "code", if(isnotnull(affected_package_name), "dependency", ""))
42+ # Basic settings
43+ TRUNCATE = 100000
4844disabled = false
49- pullrequest_base_sha =
50- EVAL-pullrequest_base_sha = 'pull_request.base.sha'
51- EVAL-pullrequest_base_user_login = 'pull_request.base.user.login'
52- EVAL-repository_name = 'repository.name'
5345KV_MODE = json
54- EXTRACT-commit_hash = | spath commits{} output=commits | mvexpand commits | rex field=commits "(?<=\"id\"\:\")(?<commit_hash>\w*)"
46+ pulldown_type = true
47+ DATETIME_CONFIG =
48+ LINE_BREAKER = ([\r\n]+)
49+ SHOULD_LINEMERGE = false
50+ #Calculated Fields
51+ EVAL-action = if(isnotnull('action'), 'action', null())
52+ EVAL-asset_content_type = if(isnotnull('release.assets{}.content_type'), 'release.assets{}.content_type', null())
53+ EVAL-asset_name = if(isnotnull('release.assets{}.name'), 'release.assets{}.name', null())
54+ EVAL-asset_uploader_login = if(isnotnull('release.assets{}.uploader.login'), 'release.assets{}.uploader.login', null())
55+ EVAL-assigned_reviewers = if(isnotnull('pull_request.requested_reviewers{}.login'), 'pull_request.requested_reviewers{}.login', null())
56+ EVAL-assigned_user = if(isnotnull('issue.assignee.login'), 'issue.assignee.login', 'assignee.login')
57+ EVAL-branch = if(('ref_type'=="branch" AND 'ref'!=""), 'ref', if(isnotnull('commit_branch'), 'ref', null()))
58+ EVAL-category = if(isnotnull(alert_description), "code", if(isnotnull(affected_package_name), "dependency", ""))
59+ EVAL-closed_date = if(isnotnull('issue.closed_at'), 'issue.closed_at', null())
60+ EVAL-commit_branch = if((isnull('commit_branch') AND isnotnull('pull_request.head.ref') AND ('eventtype'=="GitHub::PullRequest" OR 'eventtype'=="GitHub::PullRequest::Review")), 'pull_request.head.ref', if((isnull('commit_branch') AND isnotnull('pull_request.base.ref') AND ('eventtype'=="GitHub::PullRequest" OR 'eventtype'=="GitHub::PullRequest::Review")), 'pull_request.base.ref', if((isnull('commit_branch') AND isnotnull('ref')), 'ref', 'commit_branch')))
61+ EVAL-commit_files_added = if(isnotnull('commits{}.added{}'), 'commits{}.added{}', null())
62+ EVAL-commit_files_modified = if(isnotnull('commits{}.modified{}'), 'commits{}.modified{}', null())
63+ EVAL-commit_files_removed = if(isnotnull('commits{}.removed{}'), 'commits{}.removed{}', null())
64+ EVAL-commit_hash = if(isnotnull('commits{}.id'), 'commits{}.id', null())
65+ EVAL-commit_message = if(isnotnull('commits{}.message'), 'commits{}.message', null())
66+ EVAL-commit_timestamp = if(isnotnull('commits{}.timestamp'), 'commits{}.timestamp', null())
67+ EVAL-commit_username = if(isnotnull('commits{}.author.username'), 'commits{}.author.username', null())
68+ EVAL-commits_author_list = if(isnotnull('commits{}.author.username'), 'commits{}.author.username', null())
69+ EVAL-commits_list = if(isnotnull('commits{}.id'), 'commits{}.id', null())
70+ EVAL-commits_message_list = if(isnotnull('commits{}.message'), 'commits{}.message', null())
71+ EVAL-commits_timestamp_list = if(isnotnull('commits{}.timestamp'), 'commits{}.timestamp', null())
72+ EVAL-current_priority = if('issue.labels{}.name' like "Priority%", mvfilter(match('issue.labels{}.name', "[pP]riority:\sLow|[pP]riority:\sHigh|[pP]riority:\sMedium")), null())
73+ EVAL-current_push = if(isnotnull('after'), 'after', null())
74+ EVAL-dvc = replace(host, ":\d+", "")
75+ EVAL-earliest_commit_author_user = if(isnotnull(mvindex('commits{}.author.username', 0)), mvindex('commits{}.author.username', 0) , null())
76+ EVAL-earliest_commit_date = if((isnotnull('commits{}.id') AND isnull('commit_timestamp')), 'head_commit.timestamp', if((isnotnull('commits{}.id') AND isnotnull('commit_timestamp')), 'commit_timestamp', ""))
77+ EVAL-earliest_commit_hash = if(isnotnull(mvindex('commits{}.id', 0)), mvindex('commits{}.id', 0) , null())
78+ EVAL-earliest_commit_message = if(isnotnull(mvindex('commits{}.message', 0)), mvindex('commits{}.message', 0) , null())
79+ EVAL-files_added = if(isnotnull('commits{}.added{}'), 'commits{}.added{}', null())
80+ EVAL-files_modified = if(isnotnull('commits{}.modified{}'), 'commits{}.modified{}', null())
81+ EVAL-files_removed = if(isnotnull('commits{}.removed{}' ), 'commits{}.removed{}' , null())
82+ EVAL-issue_assignees = if('issue.assignees{}.login'!="", 'issue.assignees{}.login', null)
5583EVAL-issue_assigned_date = if("issue.updated_at"!="" AND action="assigned", 'issue.updated_at', null())
84+ EVAL-issue_description = if(isnotnull('issue.body'), 'issue.body', null())
85+ EVAL-issue_href = if(isnotnull('issue.html_url'), 'issue.html_url', null())
86+ EVAL-issue_subject = if(isnotnull('issue.title'), 'issue.title', null())
5687EVAL-issue_tags = if(isnotnull('issue.labels{}.name'), 'issue.labels{}.name', null())
88+ EVAL-issueNumber = if(isnotnull('issue.number'), 'issue.number', 'issueNumber')
89+ EVAL-last_updated = if("issue.update_at"="*", 'issue.update_at', strftime(_time,"%Y-%m-%d %H:%M:%S"))
90+ EVAL-latest_commit_author_user = if((isnotnull('commits{}.id') AND isnull('commit_username')), 'head_commit.author.username', if((isnotnull('commits{}.id') AND isnotnull('commit_username')), 'commit_username', ""))
91+ EVAL-latest_commit_date = if((isnotnull('commits{}.id') AND isnull('commit_timestamp')), 'head_commit.timestamp', if((isnotnull('commits{}.id') AND isnotnull('commit_timestamp')), 'commit_timestamp', ""))
92+ EVAL-latest_commit_hash = if((isnotnull('commits{}.id') AND isnull('commit_hash')), 'head_commit.id', if((isnotnull('commits{}.id') AND isnotnull('commit_hash')), 'commit_hash', if(isnotnull(after), after, null())))
93+ EVAL-latest_commit_message = if((isnotnull('commits{}.id') AND isnull('commit_message')), 'head_commit.message', if((isnotnull('commits{}.id') AND isnotnull('commit_message')), 'commit_message', ""))
94+ EVAL-object_attrs = "branch:" + pull_request_title + "|business:" + business
95+ EVAL-object_category = if(isnotnull(workflow_run.event), "workflow", if(isnotnull(repo), "repository", ""))
96+ EVAL-organization_name = if(isnotnull('organization.login'), 'organization.login', null())
97+ EVAL-pr_author_login = if(isnotnull('sender.login'), 'sender.login', null())
98+ EVAL-pr_created_date = if(isnotnull('pull_request.created_at'), 'pull_request.created_at', null())
99+ EVAL-pr_id = if((isnotnull('pull_request.number')), 'pull_request.number', if((isnotnull('number')), 'number', null()))
100+ EVAL-pr_message = if(isnotnull('pull_request.body'), 'pull_request.body', null())
101+ EVAL-previous_push = if(isnotnull('before'), 'before', null())
102+ EVAL-pullrequest_base_sha = 'pull_request.base.sha'
103+ EVAL-pullrequest_base_user_login = 'pull_request.base.user.login'
104+ EVAL-pull_request_merged = if(isnotnull('pull_request.merged'), 'pull_request.merged', null())
105+ EVAL-pull_request_merged_at = if(isnotnull('pull_request.merged_at'), 'pull_request.merged_at', null())
106+ EVAL-ref = if((isnull('ref') AND isnotnull('pull_request.head.ref') AND ('eventtype'=="GitHub::PullRequest" OR 'eventtype'=="GitHub::PullRequest::Review")), 'pull_request.head.ref', if((isnull('ref') AND isnotnull('pull_request.base.ref') AND ('eventtype'=="GitHub::PullRequest" OR 'eventtype'=="GitHub::PullRequest::Review")), 'pull_request.base.ref', 'ref'))
107+ EVAL-ref_tags = if((isnotnull('ref') AND eventtype="GitHub::Release::Push"), ref, null())
108+ EVAL-release_author = if(isnotnull('release.author.login'), 'release.author.login', null())
109+ EVAL-release_created_at = if(isnotnull('release.created_at'), 'release.created_at', null())
110+ EVAL-release_name = if(isnotnull('release.name'), 'release.name', null())
111+ EVAL-release_status = if(isnotnull('action'), 'action', null())
112+ EVAL-release_sender_name = if(isnotnull('sender.login'), 'sender.login', null())
113+ EVAL-release_tags = if(isnotnull('release.tag_name'), 'release.tag_name', if(isnotnull('release_tags'), release_tags, "beep"))
114+ EVAL-release_url = if(isnotnull('release.url'), 'release.url', null())
115+ EVAL-repository_name = if(isnotnull('repository.name'), 'repository.name', null())
57116EVAL-repository_organization = if(isnotnull('organization.login'), 'organization.login', null())
58- EVAL-current_priority = if('issue.labels{}.name' like "Priority%", mvfilter(match('issue.labels{}.name', "[pP]riority:\sLow|[pP]riority:\sHigh|[pP]riority:\sMedium")), null())
117+ EVAL-result = "success"
118+ EVAL-review_author_login = if(isnotnull('review.user.login'), 'review.user.login', null())
119+ EVAL-review_state = if(isnotnull('review.state'), 'review.state', null())
120+ EVAL-severity_id = CASE(severity=="critical",4, severity_level=="critical",4, severity=="high",3, severity_level=="high",3, severity=="moderate",2,severity_level=="moderate", 2, true==true, 1)
121+ EVAL-signature = CASE(isnull(alert_description), UPPER(severity) + " Dependency Vulnerability on package " + affected_package_name, 1=1, alert_description)
122+ EVAL-status_update_date = if(('action'!="" AND isnotnull('issue.updated_at')), 'issue.updated_at', null())
123+ EVAL-status_current = if(action=="deleted", "deleted", 'issue.state')
124+ EVAL-submitter_user = if(isnotnull('issue.user.login'), 'issue.user.login', null())
125+ EVAL-submission_date = if(isnotnull('issue.created_at'), 'issue.created_at', null())
126+ EVAL-vendor_product = "github"
127+ EVAL-xref = if(isnotnull(affected_package_name), affected_package_name, alert_location_path)
128+ # Field Aliases
129+ FIELDALIAS-dependabot = "alert.affected_package_name" AS affected_package_name "alert.external_identifier" AS cve "alert.external_reference" AS url "alert.most_recent_instance.location.path" AS alert_location_path "alert.rule.description" AS alert_description "alert.rule.security_severity_level" AS severity_level "alert.severity" AS severity eventtype AS vendor_product "repository.owner.login" AS user
130+ FIELDALIAS-RepoAlias = "organization.login" ASNEW organization "repository.name" ASNEW repository_name
59131FIELDALIAS-user = actor AS user
60- TRUNCATE = 100000
132+ FIELDALIAS-workflow_changes = action ASNEW command actor_ip ASNEW src document_id ASNEW object_id pull_request_url ASNEW object_path "workflow_run.event" ASNEW command "workflow_run.head_branch" ASNEW branch "workflow_run.head_commit.author.name" ASNEW user "workflow_run.head_repository.full_name" ASNEW repository
133+ # Field Extractions
134+ EXTRACT-change_type = "action":"(?<change_type>[^\.]+).*","((actor)|(workflow)|(_document))
135+ EXTRACT-commit_branch = (?<commit_branch>(?<=refs\/heads\/)[\-\w\d\s]*)
136+ EXTRACT-commit_hash = | spath commits{} output=commits | mvexpand commits | rex field=commits "(?<=\"id\"\:\")(?<commit_hash>\w*)"
137+ EXTRACT-release_tags = "ref":"refs\/tags\/(?<release_tags>[0-9|aA-zZ.]*)"
138+ EXTRACT-object = "repo":".+/{1}(?<object>[^"]+)",
139+ REPORT-issueNumber = issueNumber
61140
62141[github_audit]
63142KV_MODE = JSON
0 commit comments