Add metrices for CVS
What does this MR do and why?
Add metrics for CVS
Essential metrics for CVS on advisory DB change
Changelog: added EE: true
How to setup:
-
Follow the link and setup snowplow micro: gitlab-development-kit!2308 (merged)
-
Go to the console and run
PackageMetadata::AdvisoryScanService.execute(advisory)
-
go to http://gitlab.localdev:9091/micro/all and check the event
Response
Click to expand
[
{
"rawEvent": {
"api": {
"vendor": "com.snowplowanalytics.snowplow",
"version": "tp1"
},
"parameters": {
"e": "se",
"eid": "934a9cef-fe67-4fbb-a2f3-48a22a497957",
"cx": "eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy9jb250ZXh0cy9qc29uc2NoZW1hLzEtMC0xIiwiZGF0YSI6W3sic2NoZW1hIjoiaWdsdTpjb20uZ2l0bGFiL2dpdGxhYl9zdGFuZGFyZC9qc29uc2NoZW1hLzEtMC05IiwiZGF0YSI6eyJlbnZpcm9ubWVudCI6ImRldmVsb3BtZW50Iiwic291cmNlIjoiZ2l0bGFiLXJhaWxzIiwicGxhbiI6bnVsbCwiZXh0cmEiOnt9LCJ1c2VyX2lkIjpudWxsLCJpc19naXRsYWJfdGVhbV9tZW1iZXIiOm51bGwsIm5hbWVzcGFjZV9pZCI6bnVsbCwicHJvamVjdF9pZCI6bnVsbCwiY29udGV4dF9nZW5lcmF0ZWRfYXQiOiIyMDIzLTEwLTE3IDEyOjQwOjEzIFVUQyJ9fSx7InNjaGVtYSI6ImlnbHU6Y29tLmdpdGxhYi9zZWN1cmVfY3ZzL2pzb25zY2hlbWEvMS0wLTAiLCJkYXRhIjp7ImFkdmlzb3J5X2lkIjoxLCJhZHZpc29yeV94aWQiOiJmNDYwOWJjZS1iNGNlLTQ5ZDEtOWM5ZC0wZjJmZmFhODJjY2MiLCJzb3VyY2VfeGlkIjoiZ2xhZCIsInN0YXJ0X3RpbWUiOiIyMDIzLTEwLTE3VDEyOjQwOjEzWiIsImVuZF90aW1lIjoiMjAyMy0xMC0xN1QxMjo0MDoxM1oiLCJjb3VudHMiOnsicG9zc2libHlfYWZmZWN0ZWRfcHJvamVjdHMiOjAsImtub3duX2FmZmVjdGVkX3Byb2plY3RzIjowLCJwb3NzaWJseV9hZmZlY3RlZF9zYm9tX29jY3VycmVuY2VzIjowLCJrbm93bl9hZmZlY3RlZF9zYm9tX29jY3VycmVuY2VzIjowfX19XX0=",
"tna": "gl",
"stm": "1697546413406",
"tv": "rb-0.8.0",
"se_ac": "scan",
"se_la": "secure_cvs",
"se_ca": "VulnerabilityScanning::AdvisoryScanner",
"p": "srv",
"dtm": "1697546413404"
},
"contentType": null,
"source": {
"name": "snowplow-micro-2.0.0-stdout$",
"encoding": "UTF-8",
"hostname": "gitlab.localdev"
},
"context": {
"timestamp": "2023-10-17T12:40:13.443Z",
"ipAddress": "172.17.0.1",
"useragent": "Ruby",
"refererUri": null,
"headers": [
"Timeout-Access: \u003Cfunction1\u003E",
"Accept-Encoding: gzip, deflate;q=0.6, identity;q=0.3",
"Accept: */*",
"User-Agent: Ruby",
"Connection: close",
"Host: gitlab.localdev:9091"
],
"userId": "c245473b-0597-4a26-b3d8-12dc55dcfc5f"
}
},
"eventType": "struct",
"schema": "iglu:com.google.analytics/event/jsonschema/1-0-0",
"contexts": [
"iglu:com.gitlab/gitlab_standard/jsonschema/1-0-9",
"iglu:com.gitlab/secure_cvs/jsonschema/1-0-0"
],
"event": {
"app_id": null,
"platform": "srv",
"etl_tstamp": "2023-10-17T12:40:13.444Z",
"collector_tstamp": "2023-10-17T12:40:13.443Z",
"dvce_created_tstamp": "2023-10-17T12:40:13.404Z",
"event": "struct",
"event_id": "934a9cef-fe67-4fbb-a2f3-48a22a497957",
"txn_id": null,
"name_tracker": "gl",
"v_tracker": "rb-0.8.0",
"v_collector": "snowplow-micro-2.0.0-stdout$",
"v_etl": "snowplow-micro-2.0.0",
"user_id": null,
"user_ipaddress": "172.17.0.1",
"user_fingerprint": null,
"domain_userid": null,
"domain_sessionidx": null,
"network_userid": "c245473b-0597-4a26-b3d8-12dc55dcfc5f",
"geo_country": null,
"geo_region": null,
"geo_city": null,
"geo_zipcode": null,
"geo_latitude": null,
"geo_longitude": null,
"geo_region_name": null,
"ip_isp": null,
"ip_organization": null,
"ip_domain": null,
"ip_netspeed": null,
"page_url": null,
"page_title": null,
"page_referrer": null,
"page_urlscheme": null,
"page_urlhost": null,
"page_urlport": null,
"page_urlpath": null,
"page_urlquery": null,
"page_urlfragment": null,
"refr_urlscheme": null,
"refr_urlhost": null,
"refr_urlport": null,
"refr_urlpath": null,
"refr_urlquery": null,
"refr_urlfragment": null,
"refr_medium": null,
"refr_source": null,
"refr_term": null,
"mkt_medium": null,
"mkt_source": null,
"mkt_term": null,
"mkt_content": null,
"mkt_campaign": null,
"contexts": {
"schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
"data": [
{
"schema": "iglu:com.gitlab/gitlab_standard/jsonschema/1-0-9",
"data": {
"environment": "development",
"source": "gitlab-rails",
"plan": null,
"extra": {
},
"user_id": null,
"is_gitlab_team_member": null,
"namespace_id": null,
"project_id": null,
"context_generated_at": "2023-10-17 12:40:13 UTC"
}
},
{
"schema": "iglu:com.gitlab/secure_cvs/jsonschema/1-0-0",
"data": {
"advisory_id": 1,
"advisory_xid": "f4609bce-b4ce-49d1-9c9d-0f2ffaa82ccc",
"source_xid": "glad",
"start_time": "2023-10-17T12:40:13Z",
"end_time": "2023-10-17T12:40:13Z",
"counts": {
"possibly_affected_projects": 0,
"known_affected_projects": 0,
"possibly_affected_sbom_occurrences": 0,
"known_affected_sbom_occurrences": 0
}
}
}
]
},
"se_category": "VulnerabilityScanning::AdvisoryScanner",
"se_action": "scan",
"se_label": "secure_cvs",
"se_property": null,
"se_value": null,
"unstruct_event": null,
"tr_orderid": null,
"tr_affiliation": null,
"tr_total": null,
"tr_tax": null,
"tr_shipping": null,
"tr_city": null,
"tr_state": null,
"tr_country": null,
"ti_orderid": null,
"ti_sku": null,
"ti_name": null,
"ti_category": null,
"ti_price": null,
"ti_quantity": null,
"pp_xoffset_min": null,
"pp_xoffset_max": null,
"pp_yoffset_min": null,
"pp_yoffset_max": null,
"useragent": "Ruby",
"br_name": null,
"br_family": null,
"br_version": null,
"br_type": null,
"br_renderengine": null,
"br_lang": null,
"br_features_pdf": null,
"br_features_flash": null,
"br_features_java": null,
"br_features_director": null,
"br_features_quicktime": null,
"br_features_realplayer": null,
"br_features_windowsmedia": null,
"br_features_gears": null,
"br_features_silverlight": null,
"br_cookies": null,
"br_colordepth": null,
"br_viewwidth": null,
"br_viewheight": null,
"os_name": null,
"os_family": null,
"os_manufacturer": null,
"os_timezone": null,
"dvce_type": null,
"dvce_ismobile": null,
"dvce_screenwidth": null,
"dvce_screenheight": null,
"doc_charset": null,
"doc_width": null,
"doc_height": null,
"tr_currency": null,
"tr_total_base": null,
"tr_tax_base": null,
"tr_shipping_base": null,
"ti_currency": null,
"ti_price_base": null,
"base_currency": null,
"geo_timezone": null,
"mkt_clickid": null,
"mkt_network": null,
"etl_tags": null,
"dvce_sent_tstamp": "2023-10-17T12:40:13.406Z",
"refr_domain_userid": null,
"refr_dvce_tstamp": null,
"derived_contexts": {
},
"domain_sessionid": null,
"derived_tstamp": "2023-10-17T12:40:13.441Z",
"event_vendor": "com.google.analytics",
"event_name": "event",
"event_format": "jsonschema",
"event_version": "1-0-0",
"event_fingerprint": null,
"true_tstamp": null
}
}
]
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #424229 (closed)
Edited by Olivier Gonzalez