airbus-cyber / graylog-plugin-alert-wizard

Alert Wizard plugin for Graylog to manage the alert rules
Other
45 stars 7 forks source link

Cannot rename a rule #128

Open frantz45 opened 6 months ago

frantz45 commented 6 months ago
  1. Edit an existing rule
  2. Change its title
  3. Click Save

A red banner appears: Updating alert rule failed with status: There was an error fetching a rousrce: Internal Server Error. Additional Information: Cannot invoke "com.airbus_cyber_security.graylog.wizard.alert.model.AlertRule.getStreamIdentifier()" because "oldAlert" is null

c8y3 commented 1 month ago

A test for this:

    def test_update_alert_rule_title_should_not_fail(self):
        title = 'aaa'
        rule = self._graylog.create_alert_rule_count(title, _PERIOD)
        response = self._graylog.update_alert_rule(title, {**rule, 'title': 'new_title'})
        self.assertEqual('new_title', response['title'])
c8y3 commented 1 month ago

The root issue is that alert rules are identified by their titles when unique identifiers should be used instead