Skip to content

Commit

Permalink
Add the 'auditd-system' message_type choice to the logging resource m…
Browse files Browse the repository at this point in the history
…odule (#459)

* add new type to 'message_type'

* add changelog

* make changes based on PR comments
  • Loading branch information
aida-shumburo authored Nov 20, 2024
1 parent bf69b1a commit d439ba9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/459-add-new-message-type.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- sonic-logging - Add new 'auditd_system' choice to the 'message_type' choices for the logging resource module (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/459).
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, **kwargs):
'options': {
'host': {'required': True,
'type': 'str'},
'message_type': {'choices': ['log', 'event', 'audit'],
'message_type': {'choices': ['log', 'event', 'audit', 'auditd-system'],
'type': 'str'},
'severity': {'choices': ['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency'],
'type': 'str'},
Expand Down
5 changes: 3 additions & 2 deletions plugins/modules/sonic_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
- log
- event
- audit
- auditd-system
severity:
version_added: 3.1.0
type: str
Expand Down Expand Up @@ -212,7 +213,7 @@
remote_port: 622
protocol: TCP
source_interface: Ethernet24
message_type: audit
message_type: auditd-system
state: overridden
#
# After state:
Expand All @@ -222,7 +223,7 @@
#--------------------------------------------------------------------------------------
#HOST PORT SOURCE-INTERFACE VRF MESSAGE-TYPE PROTOCOL
#--------------------------------------------------------------------------------------
#10.11.1.2 622 Ethernet24 - audit tcp
#10.11.1.2 622 Ethernet24 - auditd-system tcp
#
# Using replaced
#
Expand Down
6 changes: 3 additions & 3 deletions tests/regression/roles/sonic_logging/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tests:
source_interface: "{{ vlan1 }}"
remote_port: 818
protocol: TCP
message_type: event
message_type: auditd-system
vrf: Vrf_logging_2
- host: "{{ logging_ip_server_7 }}"
severity: debug
Expand Down Expand Up @@ -100,7 +100,7 @@ tests:
source_interface: "{{ interface5 }}"
remote_port: 818
protocol: TLS
message_type: event
message_type: auditd-system

- name: test_case_05
description: Overridden logging remote servers
Expand Down Expand Up @@ -134,7 +134,7 @@ tests:
source_interface: "{{ vlan1 }}"
remote_port: 313
protocol: UDP
message_type: audit
message_type: auditd-system
vrf: Vrf_logging_2
- host: "{{ logging_host_server }}"
severity: warning
Expand Down

0 comments on commit d439ba9

Please sign in to comment.