Skip to content

Commit 737b882

Browse files
committed
Compatibility with Graylog 7.0.1 - #59
1 parent dad665f commit 737b882

File tree

9 files changed

+1605
-1428
lines changed

9 files changed

+1605
-1428
lines changed

.mvn/wrapper/maven-wrapper.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
18-
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
17+
wrapperVersion=3.3.2
18+
distributionType=only-script
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.10/apache-maven-3.9.10-bin.zip

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [7.0.0](https://github.com/airbus-cyber/graylog-plugin-logging-alert/compare/6.3.0...7.0.0)
6+
### Changes
7+
* Add compatibility with [Graylog 7.0.1](https://graylog.org/post/announcing-graylog-7-0-1/) ([issue #59](https://github.com/airbus-cyber/graylog-plugin-logging-alert/issues/59))
8+
9+
510
## [6.3.0](https://github.com/airbus-cyber/graylog-plugin-logging-alert/compare/6.1.7...6.3.0)
611
### Changes
7-
* Change Graylog minimum version to 6.3.7
12+
* Add compatibility with [Graylog 6.3.7](https://graylog.org/post/announcing-graylog-6-3-7/)
813

914

1015
## [6.1.8](https://github.com/airbus-cyber/graylog-plugin-logging-alert/compare/6.1.7...6.1.8)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Alert example recorded as an internal log message:
2222

2323
| Plugin Version | Graylog Version |
2424
|----------------|-----------------|
25+
| 7.0.0 | 7.0.1 |
2526
| 6.3.x | 6.3.7 |
2627
| 6.1.3+ | 6.1.4+ |
2728
| 6.1.0 to 6.1.2 | 6.1.0+ |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "LoggingAlert",
3-
"version": "6.3.0",
3+
"version": "7.0.0",
44
"description": "Graylog plugin LoggingAlert Web Interface",
55
"repository": {
66
"type": "git",

pom.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
<parent>
2424
<groupId>org.graylog.plugins</groupId>
2525
<artifactId>graylog-plugin-web-parent</artifactId>
26-
<version>6.3.7</version>
26+
<version>7.0.1</version>
2727
</parent>
2828

2929
<groupId>com.airbus-cyber-security.graylog</groupId>
3030
<artifactId>graylog-plugin-logging-alert</artifactId>
31-
<version>6.3.0</version>
31+
<version>7.0.0</version>
3232
<packaging>jar</packaging>
3333
<name>${project.artifactId}</name>
3434
<description>Graylog ${project.artifactId} plugin.</description>
@@ -141,7 +141,6 @@
141141
<dependency>
142142
<groupId>com.fasterxml.jackson.core</groupId>
143143
<artifactId>jackson-annotations</artifactId>
144-
<version>${jackson.version}</version>
145144
<scope>provided</scope>
146145
</dependency>
147146
<dependency>
@@ -249,10 +248,10 @@
249248
<rules>
250249
<banDuplicatePomDependencyVersions/>
251250
<requireMavenVersion>
252-
<version>[3.9.0,)</version>
251+
<version>[3.9.6,3.99.99]</version>
253252
</requireMavenVersion>
254253
<requireJavaVersion>
255-
<version>[17.0,17.99]</version>
254+
<version>[21.0,21.99]</version>
256255
</requireJavaVersion>
257256
<requireOS>
258257
<family>unix</family>

runtime/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66

77
# MongoDB: https://hub.docker.com/_/mongo/
88
mongo:
9-
image: "mongo:6.0"
9+
image: "mongo:7.0"
1010
container_name: mongo
1111
# uncomment to expose mongodb on localhost:27017
1212
ports:
@@ -16,8 +16,8 @@ services:
1616
# * https://hub.docker.com/r/opensearchproject/opensearch
1717
# * https://opensearch.org/docs/2.12/install-and-configure/install-opensearch/docker/#sample-docker-composeyml
1818
opensearch:
19-
image: "opensearchproject/opensearch:2.15.0"
20-
container_name: opensearch2.15
19+
image: "opensearchproject/opensearch:2.19.3"
20+
container_name: opensearch
2121
environment:
2222
- plugins.security.disabled=true
2323
- discovery.type=single-node

src/main/java/com/airbus_cyber_security/graylog/events/notifications/types/MessageBodyBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ private Map<String, Object> getModel(EventNotificationContext context, Immutable
7878
.eventDefinitionType(definitionDto.map(d -> d.config().type()).orElse(UNKNOWN))
7979
.eventDefinitionTitle(definitionDto.map(EventDefinitionDto::title).orElse(UNKNOWN))
8080
.eventDefinitionDescription(definitionDto.map(EventDefinitionDto::description).orElse(UNKNOWN))
81+
.remediationSteps(definitionDto.map(EventDefinitionDto::remediationSteps).orElse(UNKNOWN))
8182
.jobDefinitionId(jobTriggerDto.map(JobTriggerDto::jobDefinitionId).orElse(UNKNOWN))
8283
.jobTriggerId(jobTriggerDto.map(JobTriggerDto::id).orElse(UNKNOWN))
8384
.event(context.event())

validation/graylog/rest_api.py

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ def default_deflector_is_up(self):
4545

4646
def create_notification(self, single_message=False, log_body=_DEFAULT_LOG_BODY, description='', title='N'):
4747
notification_configuration = {
48-
'config': {
49-
'log_body': log_body,
50-
'single_notification': single_message,
51-
'type': 'logging-alert-notification'
52-
},
53-
'description': description,
54-
'title': title
48+
'entity': {
49+
'config': {
50+
'log_body': log_body,
51+
'single_notification': single_message,
52+
'type': 'logging-alert-notification'
53+
},
54+
'description': description,
55+
'title': title
56+
}
5557
}
5658
response = self._post('events/notifications', notification_configuration)
5759
notification = response.json()
@@ -66,34 +68,37 @@ def create_event_definition(self, notification_identifier, streams=None, backlog
6668
if streams is None:
6769
streams = []
6870
events_definition_configuration = {
69-
'alert': True,
70-
'config': {
71-
'conditions': conditions,
72-
'event_limit': 100,
73-
'execute_every_ms': period*1000,
74-
'filters': [],
75-
'group_by': [],
76-
'query': '',
77-
'query_parameters': [],
78-
'search_within_ms': period*1000,
79-
'series': series,
80-
'streams': streams,
81-
'type': 'aggregation-v1'
82-
},
83-
'description': '',
84-
'field_spec': {},
85-
'key_spec': [],
86-
'notification_settings': {
87-
'backlog_size': backlog_size,
88-
'grace_period_ms': 0
71+
'entity': {
72+
'alert': True,
73+
'config': {
74+
'conditions': conditions,
75+
'event_limit': 100,
76+
'execute_every_ms': period*1000,
77+
'filters': [],
78+
'group_by': [],
79+
'query': '',
80+
'query_parameters': [],
81+
'search_within_ms': period*1000,
82+
'series': series,
83+
'streams': streams,
84+
'type': 'aggregation-v1'
85+
},
86+
'description': '',
87+
'field_spec': {},
88+
'key_spec': [],
89+
'notification_settings': {
90+
'backlog_size': backlog_size,
91+
'grace_period_ms': 0
92+
},
93+
'notifications': [{
94+
'notification_id': notification_identifier
95+
}],
96+
'priority': 2,
97+
'title': 'E'
8998
},
90-
'notifications': [{
91-
'notification_id': notification_identifier
92-
}],
93-
'priority': 2,
94-
'title': 'E'
99+
'share_request': {}
95100
}
96-
self._post('events/definitions', events_definition_configuration)
101+
self._post('events/definitions?schedule=true', events_definition_configuration)
97102

98103
def gelf_input_is_running(self, identifier):
99104
response = self._get('system/inputstates/')
@@ -135,10 +140,12 @@ def create_stream_with_rule(self, title, field, value):
135140
response = self._get('system/indices/index_sets')
136141
default_index_set_identifier = response.json()['index_sets'][0]['id']
137142
stream = {
138-
'description': title,
139-
'index_set_id': default_index_set_identifier,
140-
'remove_matches_from_default_stream': False,
141-
'title': title
143+
'entity': {
144+
'description': title,
145+
'index_set_id': default_index_set_identifier,
146+
'remove_matches_from_default_stream': False,
147+
'title': title},
148+
'share_request': {}
142149
}
143150
response = self._post('streams', stream)
144151
stream_identifier = response.json()['stream_id']

0 commit comments

Comments
 (0)