Skip to content

Commit 9699eb6

Browse files
authored
Merge pull request #50 from misje/dev
0.3.0
2 parents cc13866 + 5c18c64 commit 9699eb6

36 files changed

+550
-708
lines changed

CHANGELOG.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,67 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
## 0.3.0 - 2024-06-09
11+
12+
### Added
13+
14+
- Search docker URLs when searching for URL SCOs
15+
- Ignore observables with the empty SHA-256 hash
16+
(e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
17+
- Create file SCOs from Office 365 logs in enrichment
18+
- Create directory SCOs from Office 365 logs in enrichment
19+
- Use vulnerability score for vulnerability_incident_cvss3_score_threshold
20+
check if CVSS3 score is unavailable
21+
- Search directories in Office 365
22+
- Add a small sleep() of 100 ms, potentially solving
23+
[#11](https://github.com/misje/opencti-wazuh-connector/issues/11)
24+
- New setting *rule_exclude_list* that allows for ignoring certain alert rules
25+
altogether
26+
- New setting *incident_rule_exclude_list* that prevents incident creation for
27+
certain alert rules
28+
- Mention in *event creation* in docs that incidents from sighted
29+
vulnerabilities are not created by default unless configured
30+
- Document alert rules in glossary, with screenshots of the rule viewer in
31+
Wazuh
32+
- Add a timeout to OpenSearch queries (default 20 s), preventing a complete
33+
freeze if OpenSearch fails to reply
34+
- Add new setting *vulnerability_incident_active_only* that allows for only
35+
creating incidents for sighted vulnerabilities if they are no longer active
36+
37+
### Changed
38+
39+
- OpenCTI 6.1.10 is used
40+
- No longer enrich URLs without host and scheme by default (e.g. "/",
41+
"/foo/bar"), but leave the possibility as a new configuration option,
42+
*enrich_urls_without_host".
43+
- If the vulnerability being enriched does not contain any CVSS3 information,
44+
extract this from alerts before running the logic in
45+
*vulnerability_incident_cvss3_score_threshold*. This allows for creating
46+
incidents based on CVSS score threshold even if this information is not
47+
present in the source entity.
48+
49+
### Fixed
50+
51+
- Avoid crashing when enriching untriaged vulnerabilities (when *published* is
52+
not set)
53+
- Set confidence explicitly for sightings as a workaround for OpenCTI bug
54+
#6835. This ensures that sightings now get the correct confidence (that of
55+
the user/group running the connector).
56+
- Fix bug in vulnerability_incident_cvss3_score_threshold logic
57+
- Fix a number of typos and bugs in documentation
58+
- Do not use months in timedeltas in tests, causing issues with 30/31 days in a
59+
month
60+
- Remove "Observable" from incident description, since not all enriched
61+
entities are observables
62+
- Do not match file names partially (regex mistake)
63+
64+
### Removed
65+
66+
- Remove all traces of the Wazuh API. It was only partially implemented, and
67+
will be added back when development of this as a separate enhancement is
68+
completed.
69+
- Remove some debug output
70+
1071
## 0.2.1 - 2024-05-24
1172

1273
### Changed

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ RUN apk --no-cache add build-base libmagic && \
1414
RUN pip3 install --no-cache-dir -r requirements.txt
1515
COPY src /opt/opencti-connector-wazuh
1616
COPY entrypoint.sh /
17-
RUN chmod +x /entrypoint.sh && \
18-
mkdir -p /var/cache/wazuh
17+
RUN chmod +x /entrypoint.sh
1918
ENTRYPOINT ["/entrypoint.sh"]

docs/source/alert_search.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ create incidents depending your configuration.
2525
Configuration
2626
~~~~~~~~~~~~~
2727

28-
Use CONNECTOR_SCOPE to select which entities to search for. Use the various
29-
settings in :attr:`~wazuh.search_config.SearchConfig` to determine how searches
30-
are performed.
28+
Use :attr:`CONNECTOR_SCOPE <wazuh.connector_config.ConnectorConfig.scope>` to
29+
select which entities to search for. Use the various settings in
30+
:attr:`~wazuh.search_config.SearchConfig` to determine how searches are
31+
performed.
3132

3233
Observables that have been created by the connector through :ref:`enrichment
3334
<enrichment>` are not looked up by default (determined by

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
project = "opencti-wazuh-connector"
66
copyright = "2024, Andreas Misje" # pylint: disable=redefined-builtin
77
author = "Andreas Misje"
8-
release = "0.1.0"
8+
release = "0.3.0"
99
## The full version, including alpha/beta/rc tags
1010
# with open("../../../version.txt", "r") as f:
1111
# release = f.readline().rstrip()

docs/source/conf_other_considerations.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ settings determines when to create incidents:
5050
- :attr:`~wazuh.config.Config.require_indicator_detection`
5151
- :attr:`~wazuh.config.Config.ignore_revoked_indicators`
5252
- :attr:`~wazuh.config.Config.indicator_score_threshold`
53+
- :attr:`~wazuh.config.Config.vulnerability_incident_cvss3_score_threshold`
54+
- :attr:`~wazuh.config.Config.incident_rule_exclude_list`
5355

5456
Playbooks
5557
~~~~~~~~~

docs/source/config_reference.rst

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ CONNECTOR settings
3131
.. automodule:: wazuh.connector_config
3232
:members:
3333

34+
.. _opensearch-config:
35+
3436
OpenSearch configuration
3537
------------------------
3638

3739
.. automodule:: wazuh.opensearch_config
3840
:members:
3941

42+
.. _search-config:
43+
4044
Search configuration
4145
--------------------
4246

@@ -52,11 +56,3 @@ Look at :ref:`the enrichment topic <enrichment>` for details.
5256

5357
.. autopydantic_settings:: wazuh.enrich_config.EnrichmentConfig
5458
:settings-show-json-error-strategy: coerce
55-
56-
Wazuh API configuration
57-
-----------------------
58-
59-
Wazuh API is only partially supported.
60-
61-
.. automodule:: wazuh.wazuh_api_config
62-
:members:

docs/source/connector-compose.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
connector-wazuh:
3-
image: ghcr.io/misje/opencti-wazuh-connector:0.2.1
3+
image: ghcr.io/misje/opencti-wazuh-connector:0.3.0
44
restart: always
55
environment:
66
# A timezone is needed for datetime tools to work as expected:
@@ -10,12 +10,11 @@ services:
1010
- OPENCTI_TOKEN=84387577-27ac-4751-b268-6893045aa73c
1111
- CONNECTOR_ID=81f9d582-2b4e-45f1-98b6-f33492d66b6e
1212
- CONNECTOR_NAME=Wazuh
13-
- CONNECTOR_SCOPE=Artifact,Directory,Domain-Name,Email-Addr,Hostname,IPv4-Addr,IPv6-Addr,Mac-Addr,Network-Traffic,Process,Software,StixFile,Url,User-Account,User-Agent,Windows-Registry-Key,Windows-Registry-Value-Type,Vulnerability,Indicator
13+
- CONNECTOR_SCOPE=Artifact,Directory,Domain-Name,Email-Addr,Hostname,IPv4-Addr,IPv6-Addr,Mac-Addr,Network-Traffic,Process,StixFile,Url,User-Account,User-Agent,Windows-Registry-Key,Windows-Registry-Value-Type,Vulnerability,Indicator # You may also just use "all" if you want to search available entities
1414
- CONNECTOR_AUTO=true
1515
- CONNECTOR_LOG_LEVEL=warning
1616
- CONNECTOR_EXPOSE_METRICS=true
1717
- AGENTS_AS_SYSTEMS=true
18-
- WAZUH_API_ENABLED=false # This API is still in development
1918
- WAZUH_APP_URL=https://mywazuh.example.org
2019
- WAZUH_AUTHOR_NAME=Wazuh
2120
- WAZUH_BUNDLE_ABORT_LIMIT=500
@@ -25,10 +24,15 @@ services:
2524
- WAZUH_CREATE_INCIDENT_RESPONSE=true
2625
- WAZUH_CREATE_INCIDENT_SUMMARY=true
2726
- WAZUH_CREATE_INCIDENT_SUMMARY=true
27+
- WAZUH_VULNERABILITY_INCIDENT_CVSS3_SCORE_THRESHOLD= # CVSS3 score (0–10, or empty)
28+
- WAZUH_VULNERABILITY_INCIDENT_ACTIVE_ONLY=true
2829
- WAZUH_CREATE_INCIDENT_THRESHOLD=1
30+
- WAZUH_RULE_EXCLUDE_LIST=
31+
- WAZUH_INCIDENT_RULE_EXCLUDE_LIST=
2932
- WAZUH_CREATE_OBS_SIGHTINGS=true
3033
- WAZUH_CREATE_SIGHTING_SUMMARY=true
3134
- WAZUH_ENRICH_FILENAME_BEHAVIOUR=create-dir,remove-path
35+
- WAZUH_ENRICH_URLS_WITHOUT_HOST=false
3236
- WAZUH_ENRICH_TYPES=all
3337
- WAZUH_ENRICH_AGENT=true
3438
- WAZUH_ENRICH_LABELS=wazuh_ignore
@@ -44,6 +48,7 @@ services:
4448
- WAZUH_MAX_TLP=TLP:RED
4549
- WAZUH_OPENSEARCH_EXCLUDE_MATCH=data.integration:opencti
4650
- WAZUH_OPENSEARCH_FILTER=
51+
- "WAZUH_OPENSEARCH_TIMEOUT=20 seconds"
4752
- WAZUH_OPENSEARCH_INCLUDE_MATCH=
4853
- WAZUH_OPENSEARCH_INDEX=wazuh-alerts-*
4954
- WAZUH_OPENSEARCH_LIMIT=50
@@ -68,8 +73,6 @@ services:
6873
- WAZUH_SYSTEM_NAME="Wazuh SIEM"
6974
- WAZUH_TLPS=TLP:AMBER+STRICT
7075
- WAZUH_VULNERABILITY_INCIDENT_CVSS3_SCORE_THRESHOLD=
71-
volumes:
72-
- /var/cache/wazuh
7376
links:
7477
- opencti:opencti
7578
# Set a limit on logs:

docs/source/env-config.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ whitespace or special characters, it must be quoted like this:
4545
Special characters
4646
^^^^^^^^^^^^^^^^^^
4747

48-
Dollar signs, **$**, but be escaped by an additional dollar sign, **$$**. This
48+
Dollar signs, **$**, must be escaped by an additional dollar sign, **$$**. This
4949
may be necessary in passphrases that contain these characters, e.g.:
5050

51+
"WAZUH_PASSWORD=MyPa$word" → "WAZUH_PASSWORD=MyPa$$word"
5152
"WAZUH_PASSWORD=MyPa$$word" → "WAZUH_PASSWORD=MyPa$$$$word"
5253

5354
Enumerators
@@ -61,6 +62,18 @@ any of the following values are accepted:
6162
- ipv4-addr
6263
- Ipv4addr
6364

65+
Date and time
66+
^^^^^^^^^^^^^
67+
68+
Dates/times and relative times can be represented in almost any conceivable
69+
format (and in any langauge if locales are set up correctly), thanks to the
70+
Python library *dateparser*. Examples:
71+
72+
- 2024-01-02 03:04:05
73+
- January 24, 2029 10:00 PM EST
74+
- In two months
75+
- Three weeks ago
76+
6477
Complex data types
6578
^^^^^^^^^^^^^^^^^^
6679

@@ -74,7 +87,7 @@ values may be specified as a comma-separated list, e.g.:
7487
.. note::
7588

7689
All sets of enums accept the special string "all", which will include every
77-
defined enumerator.
90+
defined enumerator, if the data type is a *set*.
7891

7992
Other complex data types have their own environment variable-friendly syntax,
8093
documented in the settings reference.

docs/source/example_summary_note.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,19 @@ The meaning of all the fields in the summary table are as follows:
3131
* - Total hits
3232
- The total number of matches
3333
* - Max hits
34-
- Maximum number of results to return, as per :py:attr:`~wazuh.config.Config.hits_limit`
34+
- Maximum number of results to return, as per
35+
:py:attr:`~wazuh.opensearch_config.OpenSearchConfig.limit`
3536
* - Dropped
3637
- Results dropped (Total hits - Max hits)
3738
* - Search since
38-
- Time filter used, as per :py:attr:`~wazuh.config.Config.search_after`
39+
- Time filter used, as per
40+
:py:attr:`~wazuh.opensearch_config.OpenSearchConfig.search_after`
3941
* - Include filter
40-
- Additional search filters used, as per :py:attr:`~wazuh.config.Config.search_include`
42+
- Additional search filters used, as per
43+
:py:attr:`~wazuh.config.OpenSearchConfig.include_match`
4144
* - Exclude filter
42-
- Additional search filters used, as per :py:attr:`~wazuh.config.Config.search_exclude`
45+
- Additional search filters used, as per
46+
:py:attr:`~wazuh.config.OpenSearchConfig.exclude_match`
4347
* - Connector v.
4448
- The connector version at enrichment time
4549

docs/source/full-demo-compose.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
redis:
3-
image: redis:7.2.4
3+
image: redis:7.2.5
44
restart: always
55
volumes:
66
- redisdata:/data
@@ -33,7 +33,7 @@ services:
3333
max-size: 50m
3434

3535
minio:
36-
image: minio/minio:RELEASE.2024-01-16T16-07-38Z
36+
image: minio/minio:RELEASE.2024-05-28T17-19-04Z
3737
volumes:
3838
- s3data:/data
3939
ports:
@@ -63,7 +63,7 @@ services:
6363
max-size: 50m
6464

6565
opencti:
66-
image: opencti/platform:6.1.4
66+
image: opencti/platform:6.1.10
6767
environment:
6868
- NODE_OPTIONS=--max-old-space-size=8096
6969
- APP__PORT=8080
@@ -103,7 +103,7 @@ services:
103103
max-size: 50m
104104

105105
worker:
106-
image: opencti/worker:6.1.4
106+
image: opencti/worker:6.1.10
107107
environment:
108108
- OPENCTI_URL=http://opencti:8080
109109
- OPENCTI_TOKEN=${OPENCTI_ADMIN_TOKEN}
@@ -120,7 +120,7 @@ services:
120120
max-size: 50m
121121

122122
connector-export-file-stix:
123-
image: opencti/connector-export-file-stix:6.1.4
123+
image: opencti/connector-export-file-stix:6.1.10
124124
environment:
125125
- OPENCTI_URL=http://opencti:8080
126126
- OPENCTI_TOKEN=${OPENCTI_ADMIN_TOKEN}
@@ -139,7 +139,7 @@ services:
139139
max-size: 50m
140140

141141
connector-import-file-stix:
142-
image: opencti/connector-import-file-stix:6.1.4
142+
image: opencti/connector-import-file-stix:6.1.10
143143
environment:
144144
- OPENCTI_URL=http://opencti:8080
145145
- OPENCTI_TOKEN=${OPENCTI_ADMIN_TOKEN}
@@ -180,8 +180,6 @@ services:
180180
- WAZUH_OPENSEARCH_USERNAME=cti_connector
181181
- WAZUH_OPENSEARCH_VERIFY_TLS=true
182182
- WAZUH_TLPS=TLP:AMBER+STRICT
183-
volumes:
184-
- /var/cache/wazuh
185183
# Set a limit on logs:
186184
logging:
187185
options:

0 commit comments

Comments
 (0)