|
PACS System 0.1.0
PACS DICOM system library
|
High-level facade for emitting ATNA audit events from DICOM services. More...
#include <atna_service_auditor.h>

Public Member Functions | |
| atna_service_auditor (const syslog_transport_config &config, std::string audit_source_id) | |
| Construct an auditor with syslog transport configuration. | |
| ~atna_service_auditor ()=default | |
| atna_service_auditor (const atna_service_auditor &)=delete | |
| atna_service_auditor & | operator= (const atna_service_auditor &)=delete |
| atna_service_auditor (atna_service_auditor &&) noexcept | |
| atna_service_auditor & | operator= (atna_service_auditor &&) noexcept |
| void | audit_instance_stored (const std::string &source_ae, const std::string &dest_ae, const std::string &study_uid, const std::string &patient_id, bool success) |
| Audit a C-STORE (DICOM Instances Transferred) event. | |
| void | audit_query (const std::string &calling_ae, const std::string &called_ae, const std::string &query_level, bool success) |
| Audit a C-FIND (Query) event. | |
| void | audit_authentication (const std::string &user_id, bool is_login, bool success) |
| Audit a User Authentication event. | |
| void | audit_security_alert (const std::string &user_id, const std::string &alert_description) |
| Audit a Security Alert event (e.g., access denied) | |
| void | set_enabled (bool enabled) noexcept |
| Enable or disable audit event emission. | |
| bool | is_enabled () const noexcept |
| Check if audit event emission is enabled. | |
| size_t | events_sent () const noexcept |
| Get the number of audit events successfully sent. | |
| size_t | events_failed () const noexcept |
| Get the number of audit event send failures. | |
| void | reset_statistics () noexcept |
| Reset statistics counters. | |
| const std::string & | audit_source_id () const noexcept |
| Get the audit source identifier. | |
| const atna_syslog_transport & | transport () const noexcept |
| Get the underlying transport (for advanced use) | |
Private Member Functions | |
| void | send_audit (const atna_audit_message &message) |
| Send an audit message via syslog transport. | |
Private Attributes | |
| std::string | audit_source_id_ |
| Audit source identifier (e.g., "PACS_SYSTEM_01") | |
| atna_syslog_transport | transport_ |
| Syslog transport for sending audit messages. | |
| std::atomic< bool > | enabled_ {true} |
| Whether audit is enabled. | |
| std::atomic< size_t > | events_sent_ {0} |
| Statistics. | |
| std::atomic< size_t > | events_failed_ {0} |
High-level facade for emitting ATNA audit events from DICOM services.
Combines the audit message generator (atna_audit_logger) with the syslog transport (atna_syslog_transport) to provide simple, one-call audit methods for common DICOM operations.
Definition at line 52 of file atna_service_auditor.h.
| kcenon::pacs::security::atna_service_auditor::atna_service_auditor | ( | const syslog_transport_config & | config, |
| std::string | audit_source_id ) |
Construct an auditor with syslog transport configuration.
| config | Syslog transport configuration |
| audit_source_id | Identifier for this audit source (e.g., "PACS_01") |
Definition at line 14 of file atna_service_auditor.cpp.
|
default |
|
delete |
|
noexcept |
Definition at line 20 of file atna_service_auditor.cpp.
| void kcenon::pacs::security::atna_service_auditor::audit_authentication | ( | const std::string & | user_id, |
| bool | is_login, | ||
| bool | success ) |
Audit a User Authentication event.
| user_id | User identifier (AE title or username) |
| is_login | true for login, false for logout |
| success | Whether the authentication succeeded |
Definition at line 101 of file atna_service_auditor.cpp.
References audit_source_id_, kcenon::pacs::security::atna_audit_logger::build_user_authentication(), enabled_, send_audit(), kcenon::pacs::security::serious_failure, and kcenon::pacs::security::success.

| void kcenon::pacs::security::atna_service_auditor::audit_instance_stored | ( | const std::string & | source_ae, |
| const std::string & | dest_ae, | ||
| const std::string & | study_uid, | ||
| const std::string & | patient_id, | ||
| bool | success ) |
Audit a C-STORE (DICOM Instances Transferred) event.
| source_ae | Calling AE title (sender) |
| dest_ae | Called AE title (receiver) |
| study_uid | Study Instance UID |
| patient_id | Patient ID (optional, empty if unavailable) |
| success | Whether the operation succeeded |
Definition at line 48 of file atna_service_auditor.cpp.
References audit_source_id_, kcenon::pacs::security::atna_audit_logger::build_dicom_instances_transferred(), enabled_, send_audit(), kcenon::pacs::security::serious_failure, and kcenon::pacs::security::success.
Referenced by kcenon::pacs::services::storage_scp::handle_message().


| void kcenon::pacs::security::atna_service_auditor::audit_query | ( | const std::string & | calling_ae, |
| const std::string & | called_ae, | ||
| const std::string & | query_level, | ||
| bool | success ) |
Audit a C-FIND (Query) event.
| calling_ae | Calling AE title (query requester) |
| called_ae | Called AE title (query responder) |
| query_level | Query level string (PATIENT/STUDY/SERIES/IMAGE) |
| success | Whether the operation succeeded |
Definition at line 76 of file atna_service_auditor.cpp.
References audit_source_id_, kcenon::pacs::security::atna_audit_logger::build_query(), enabled_, send_audit(), kcenon::pacs::security::serious_failure, and kcenon::pacs::security::success.
Referenced by kcenon::pacs::services::query_scp::handle_message().


| void kcenon::pacs::security::atna_service_auditor::audit_security_alert | ( | const std::string & | user_id, |
| const std::string & | alert_description ) |
Audit a Security Alert event (e.g., access denied)
| user_id | User identifier |
| alert_description | Description of the security alert |
Definition at line 123 of file atna_service_auditor.cpp.
References audit_source_id_, kcenon::pacs::security::atna_audit_logger::build_security_alert(), enabled_, and send_audit().

|
nodiscardnoexcept |
Get the audit source identifier.
Definition at line 173 of file atna_service_auditor.cpp.
References audit_source_id_.
|
nodiscardnoexcept |
Get the number of audit event send failures.
Definition at line 160 of file atna_service_auditor.cpp.
References events_failed_.
|
nodiscardnoexcept |
Get the number of audit events successfully sent.
Definition at line 156 of file atna_service_auditor.cpp.
References events_sent_.
|
nodiscardnoexcept |
Check if audit event emission is enabled.
Definition at line 148 of file atna_service_auditor.cpp.
References enabled_.
|
noexcept |
Definition at line 28 of file atna_service_auditor.cpp.
References kcenon::pacs::security::other.
|
delete |
|
noexcept |
Reset statistics counters.
Definition at line 164 of file atna_service_auditor.cpp.
References events_failed_, and events_sent_.
|
private |
Send an audit message via syslog transport.
Converts the message to XML and sends it. Updates statistics.
| message | The audit message to send |
Definition at line 185 of file atna_service_auditor.cpp.
References events_failed_, events_sent_, kcenon::pacs::security::atna_syslog_transport::send(), kcenon::pacs::security::atna_audit_logger::to_xml(), and transport_.
Referenced by audit_authentication(), audit_instance_stored(), audit_query(), and audit_security_alert().


|
noexcept |
Enable or disable audit event emission.
When disabled, audit methods return immediately without generating or sending any messages. Useful for testing or low-resource environments.
| enabled | true to enable, false to disable |
Definition at line 144 of file atna_service_auditor.cpp.
|
nodiscardnoexcept |
Get the underlying transport (for advanced use)
Definition at line 177 of file atna_service_auditor.cpp.
References transport_.
|
private |
Audit source identifier (e.g., "PACS_SYSTEM_01")
Definition at line 199 of file atna_service_auditor.h.
Referenced by audit_authentication(), audit_instance_stored(), audit_query(), audit_security_alert(), and audit_source_id().
|
private |
Whether audit is enabled.
Definition at line 205 of file atna_service_auditor.h.
Referenced by audit_authentication(), audit_instance_stored(), audit_query(), audit_security_alert(), and is_enabled().
|
private |
Definition at line 209 of file atna_service_auditor.h.
Referenced by events_failed(), reset_statistics(), and send_audit().
|
private |
Statistics.
Definition at line 208 of file atna_service_auditor.h.
Referenced by events_sent(), reset_statistics(), and send_audit().
|
private |
Syslog transport for sending audit messages.
Definition at line 202 of file atna_service_auditor.h.
Referenced by send_audit(), and transport().