Skip to content

Commit b43b7e2

Browse files
sdaniel6TOUFIKIzakarya
authored andcommitted
CRTX-180889-Synopsys-Coverity (demisto#40641)
* creatinhg a new pack * fixed readme file * fixed xif file * fixed schema * fixed readme * fixed readme
1 parent bedc10e commit b43b7e2

File tree

9 files changed

+158
-0
lines changed

9 files changed

+158
-0
lines changed

Packs/SynopsysCoverity/.pack-ignore

Whitespace-only changes.

Packs/SynopsysCoverity/.secrets-ignore

Whitespace-only changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[MODEL: dataset = synopsys_coverity_raw]
2+
alter event_type = _raw_log -> ["@type"],
3+
log_level = _raw_log -> level,
4+
src_ip = _raw_log -> remoteHost,
5+
src_username = coalesce(_raw_log -> username, _raw_log -> userName, _raw_log -> clientUserName),
6+
src_hostname = _raw_log -> hostname
7+
8+
| alter xdm.event.type = event_type,
9+
xdm.event.id = _raw_log -> id,
10+
xdm.event.duration = to_integer(_raw_log -> duration),
11+
xdm.event.description = _raw_log -> details,
12+
xdm.event.operation = coalesce(_raw_log -> method, _raw_log -> action, _raw_log -> eventType),
13+
xdm.event.operation_sub_type = coalesce(to_string(_raw_log -> viewId), to_string(_raw_log -> protocol), to_string(_raw_log -> queueType)),
14+
xdm.event.outcome_reason = _raw_log -> failureReason,
15+
xdm.event.outcome = if(_raw_log -> logInSucceeded = "true", XDM_CONST.OUTCOME_SUCCESS),
16+
xdm.event.log_level = if(log_level in ("CRITICAL"), XDM_CONST.LOG_LEVEL_CRITICAL, log_level in ("ERROR"), XDM_CONST.LOG_LEVEL_ERROR, log_level in ("WARNING"), XDM_CONST.LOG_LEVEL_WARNING, log_level in ("INFO*"), XDM_CONST.LOG_LEVEL_INFORMATIONAL, to_string(log_level)),
17+
xdm.source.user.username = src_username,
18+
xdm.source.user.identifier = _raw_log -> userId,
19+
xdm.source.host.hostname = src_hostname,
20+
xdm.source.ipv4 = arrayindex(regextract(src_ip, "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"), 0),
21+
xdm.source.ipv6 = arrayindex(regextract(src_ip, "[a-fA-F0-9\:]{1,5}[a-fA-F0-9\:]{1,5}[a-fA-F0-9\:]{1,5}[a-fA-F0-9\:]{1,5}[a-fA-F0-9\:]{1,5}[a-fA-F0-9\:]{1,5}[a-fA-F0-9\:]{1,5}[a-fA-F0-9\:]{1,5}"), 0),
22+
xdm.source.user_agent = _raw_log -> userAgent,
23+
xdm.source.application.name = _raw_log -> endpoint,
24+
xdm.source.application.version = _raw_log -> version,
25+
xdm.session_context_id = to_string(_raw_log -> sessionId),
26+
xdm.target.file.path = _raw_log -> filename,
27+
xdm.target.resource.parent_id = to_string(_raw_log -> projectId),
28+
xdm.target.resource.name = coalesce(_raw_log -> projectName, _raw_log -> stream),
29+
xdm.target.user.identifier = to_string(_raw_log -> targetId),
30+
xdm.target.resource.id = coalesce(to_string(_raw_log -> cid), to_string(_raw_log -> issueInstanceId)),
31+
xdm.target.url = _raw_log -> url,
32+
xdm.auth.service = _raw_log -> authenticationSource;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fromversion: 8.5.0
2+
id: Synopsys_Coverity_ModelingRule
3+
name: Synopsys Coverity Modeling Rule
4+
rules: ''
5+
schema: ''
6+
tags: synopsys
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"synopsys_coverity_raw": {
3+
"_raw_log": {
4+
"type": "string",
5+
"is_array": false
6+
},
7+
"log_level": {
8+
"type": "string",
9+
"is_array": false
10+
},
11+
"event_type": {
12+
"type": "string",
13+
"is_array": false
14+
},
15+
"src_ip": {
16+
"type": "string",
17+
"is_array": false
18+
},
19+
"src_hostname": {
20+
"type": "string",
21+
"is_array": false
22+
},
23+
"src_username": {
24+
"type": "string",
25+
"is_array": false
26+
}
27+
}
28+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[INGEST:vendor="synopsys", product="coverity", target_dataset="synopsys_coverity_raw" , no_hit=keep]
2+
filter _raw_log -> timestamp ~= "\d{4}-\d{1,2}-\d{1,2}T\d{2}:\d{2}:\d{2}\.\d+[+|-]\d{2}\d{2}"
3+
| alter _time = parse_timestamp("%FT%H:%M:%E*S%z", _raw_log -> timestamp);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: Synopsys Coverity Parsing Rule
2+
id: Synopsys_Coverity_ParsingRule
3+
fromversion: 8.3.0
4+
tags: []
5+
rules: ''
6+
samples: ''

Packs/SynopsysCoverity/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This pack includes
2+
3+
Data normalization capabilities:
4+
5+
Parsing and modeling rules (XDM schema) for Synopsys Coverity enhanced usage logs that are ingested via File Collector on Cortex XSIAM.
6+
7+
The ingested Synopsys Coverity logs can be queried in XQL Search using the `synopsys_coverity_raw` dataset.
8+
9+
### Configuration on Server Side
10+
11+
Synopsis Coverity does not support native log forwarding (for example, Syslog). Instead, it writes enhanced usage logs to local files on the host filesystem.
12+
13+
1. Ensure that Synopsis Coverity is configured to generate enhanced usage logs.
14+
The log files are typically written under the Synopsis Coverity installation directory, usually under `<install_dir>\logs`
15+
2. Verify that the logs are being written in **JSON format** (e.g., coverity_usage-*.log).
16+
17+
If logs are not found in the default path, refer to [Coverity Enhanced Usage Logging documentation](https://documentation.blackduck.com/bundle/coverity-docs/page/coverity-platform/topics/enhanced_usage_logging.html) for exact location and format details.
18+
19+
#### Filebeat Collection
20+
21+
In order to collect the logs and forward them to Cortex XSIAM, use the following collector:
22+
23+
##### XDRC (XDR Collector)
24+
25+
You will configure a profile for the XDR Collector and assign the correct vendor and product values.
26+
27+
To set up the collector, follow the instructions outlined in the official [Cortex XSIAM XDR Collector documentation](https://docs.paloaltonetworks.com/cortex/cortex-xdr/cortex-xdr-pro-admin/cortex-xdr-collectors/xdr-collector-datasets#id7f0fcd4d-b019-4959-a43a-40b03db8a8b).
28+
29+
###### Filebeat Configuration File
30+
31+
Paste the following YAML configuration in the Filebeat Configuration File section of the relevant XDR Collector profile:
32+
33+
```
34+
filebeat.inputs:
35+
- type: filestream
36+
enabled: true
37+
paths:
38+
- <install_dir>\logs\*.log
39+
processors:
40+
- add_fields:
41+
fields:
42+
vendor: synopsys
43+
product: coverity
44+
```
45+
46+
**Note:**
47+
If your Synopsis Coverity logs are stored in a different directory, update the path field accordingly.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "Synopsys Coverity",
3+
"description": "Parsing and modeling rules for Synopsys Coverity logs",
4+
"support": "xsoar",
5+
"currentVersion": "1.0.0",
6+
"author": "Cortex XSOAR",
7+
"url": "https://www.paloaltonetworks.com/cortex",
8+
"email": "",
9+
"categories": [
10+
"Analytics & SIEM",
11+
"IT Services",
12+
"Cloud Services"
13+
],
14+
"tags": [
15+
"Security"
16+
],
17+
"useCases": [
18+
"Vulnerability Management"
19+
],
20+
"keywords": [
21+
"synopsys",
22+
"coverity",
23+
"synopsys coverity"
24+
],
25+
"marketplaces": [
26+
"marketplacev2",
27+
"platform"
28+
],
29+
"supportedModules": [
30+
"X1",
31+
"X3",
32+
"X5",
33+
"ENT_PLUS",
34+
"agentix"
35+
]
36+
}

0 commit comments

Comments
 (0)