Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the 'auditd-system' message_type choice to the logging resource module #459

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please show the corresponding changed result containing auditd-system in the "After state" display for this example.

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
Loading