VoIP.info Asterisk

Asterisk security-event logging: generation, channel and custody evidence

Trace a security event from the producing subsystem through res_security_log, the dynamic SECURITY level, logger channel, file custody, rotation and downstream consumers.

Reviewed 2026-10-18Current first-party Asterisk security-framework, logging, command, configuration and source evidence reviewed October 18, 2026. Security-event generation, res_security_log module state, dynamic SECURITY level registration, logger channel configuration, destination path, file write, rotation, downstream parser, alert and enforcement action remain separate evidence. A security event is not by itself proof of compromise, and a written record is not proof of a ban or alert. No host, module, logger channel, file, permission, event, parser, firewall, packet, account or call was inspected or testedAdvancedDocumentation based · not lab tested

Model the complete security-event pipeline

Asterisk documents two security-framework components: event generation and an event logger. Producing code emits a typed event with required and optional information; the logger module consumes those events and publishes them through a dynamic SECURITY logging level. logger.conf then decides whether that level reaches a file, console or syslog destination.

Preserve each boundary independently: generating subsystem, event subtype and fields, res_security_log load state, dynamic level registration, configured logger channel, resolved destination, successful write, rotation, collection, parser, alert and enforcement action. A missing file does not prove that no event was generated, and a record in a file does not prove that a downstream control acted.

Inventory the exact running module and logger state

Record the running Asterisk branch and build, module inventory, configuration owner and the output of logger show channels. The current source registers the uppercase SECURITY dynamic level when res_security_log loads, subscribes to the Asterisk security topic and unregisters that level when unloaded. Treat a module file on disk, a loaded module and an active channel as separate states.

Keep ordinary notice, warning, error, debug and verbose output separate from security-event output. Raising console verbosity or enabling broad debug does not create the dedicated security destination and can add unrelated volume.

Configure one explicit destination and prove its path

The official example is a logger entry such as security_log => security. Relative filenames resolve under the configured astlogdir; absolute paths remain absolute. Preserve the selected filename, configured log directory, service user and group, directory and file permissions, filesystem and free-space state.

After a controlled configuration change, reload the logger and read back its channels. logger reload reloads logger state; logger show channels lists configured channels. Neither command alone proves that a producing subsystem emitted an event or that the target accepted a new write.

Read each event as typed evidence, not a verdict

The logger source serializes a SecurityEvent subtype plus that subtype’s required and optional information. Common fields can describe time, severity, service, event version, account or session identity, and local or remote addresses, but the applicable field set comes from the event type and running branch. Preserve the complete original record before normalization.

Do not convert every challenge, successful authentication or failed credential exchange into a compromise finding. Correlate the event type, service, addresses, account, session, transport evidence and expected system activity. Redact secrets while retaining the fields needed to distinguish local management traffic, a test endpoint, an internet scan and a real account attempt.

Design retention and rotation as part of evidence custody

Asterisk supports internal rotation strategies and logger rotate; the current sample also warns that logs can grow quickly and that a bounded logger queue can discard new messages when full. Record the active rotation owner, strategy, schedule, retention count, compression or shipping step, disk thresholds and whether a rotation reopened the intended file.

A rotated, renamed, compressed, deleted, permission-blocked or collector-moved file is not the same as an event-generation failure. Preserve timestamps and host identity across files so one event can be followed without assuming continuous custody.

Prove downstream collection and enforcement separately

A security file may feed a collector, parser, dashboard or defensive control, but those are separate products and policies. For one authorized test event, preserve the Asterisk record, collector receipt, parsed fields, correlation result, alert and any enforcement decision as separate timestamps. Do not infer a block from a parser match or a match from file growth.

Use the missing-or-noisy diagnostic when the chain diverges. No host, module, event, file, collector, alert, firewall action, packet, account or call was inspected or tested for this guide.

Sources & applicability

Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.

Examples require adaptation to your topology. No live PBX or hardware testing is claimed.