Configure System Logging for Security Devices
System Logging Overview for Security Devices
Junos OS supports configuring and monitoring
of system log messages (also called syslog messages). You can configure files to log system messages and also assign
attributes, such as severity levels, to messages. Reboot requests
are recorded to the system log files, which you can view with the show log
command.
This section contains the following topics:
Control Plane and Data Plane Logs
Junos OS generates separate log messages to record events that occur on the system’s control and data planes.
The control plane logs, also called system logs, include events that occur on the routing platform. The system sends control plane events to the
eventd
process on the Routing Engine, which then handles the events by using Junos OS policies, by generating system log messages, or both. You can choose to send control plane logs to a file, user terminal, routing platform console, or remote machine. To generate control plane logs, use thesyslog
statement at the[system]
hierarchy level.The data plane logs, also called security logs, primarily include security events that are handled inside the data plane. Security logs can be in text or binary format, and they can be saved locally (event mode) or sent to an external server (stream mode). Binary format is required for stream mode and recommended to conserve log space in event mode.
Note the following:
Security logs can be saved locally (on box) or externally (off box), but not both.
SRX1400, SRX1500, SRX3400, SRX3600, SRX4100, SRX4200, SRX4600, SRX5400, SRX5600, and SRX5800 devices default to stream mode. To specify binary format and an external server, see Configuring Off-Box Binary Security Log Files.
Note:Logs might be dropped if you configure event mode logging on these devices.
Starting with Junos OS Release 15.1X49-D100, the default mode for SRX1500 device is stream mode. Prior to Junos OS Release 15.1X49-D100, the default mode for SRX1500 device was event mode.
Apart from Junos OS Release 18.4R1, 18,4R2, 19.1 and 19.2R1, in all the other releases starting in Junos OS Release 18.3R3, the default logging mode for SRX300, SRX320, SRX340, SRX345, SRX550, and SRX550M devices is stream mode. Data plane events are written to system log files in a similar manner to control plane events. To specify binary format for the security logs, see Configuring Off-Box Binary Security Log Files.
Starting in Junos OS Release 20.2R1, we support escape in stream log forwarding and on-box reporting to avoid parsing errors. Stream mode supports escape in
sd-syslog
andbinary
formats when logs are not sent toeventd
process. For the logs send toeventd
process, we recommend not to enable anescape
option as theeventd
process has enabled the escape for the structure log. Event mode supports escape only inbinary
format. By default theescape
option is disabled. You must enable theescape
option using theset security log escape
command.
Redundant System Log Server
Security system logging traffic intended for remote servers is sent through the network interface ports, which support two simultaneous system log destinations. Each system logging destination must be configured separately. When two system log destination addresses are configured, identical logs are sent to both destinations. While two destinations can be configured on any device that supports the feature, adding a second destination is primarily useful as a redundant backup for standalone and active/backup configured chassis cluster deployments.
The following redundant server information is available:
Facility:
cron
Description: cron scheduling process
Severity Level (from highest to lowest severity):
debug
Description: Software debugging messages
Binary Format for Security Logs
The Junos OS generates separate log messages to record events
that occur on the system’s control plane and data plane. The
control plane monitors events that occur on the routing platform.
Such events are recorded in system log messages. To generate system
log messages, use the syslog
statement at the [system]
hierarchy level.
Data plane log messages, referred to as security log messages,
record security events that the system handles directly inside the
data plane. To generate security log messages, use the log
statement at the [security]
hierarchy level.
System log messages are maintained in log files in text-based formats, such as BSD Syslog, Structured Syslog, and WebTrends Enhanced Log Format (WELF).
Security log messages can also be maintained in text-based formats. Because security logging can produce large amounts of data, however, text-based log files can quickly consume storage and CPU resources. Depending on your implementation of security logging, a log file in a binary-based format can provide more efficient use of on-box or off-box storage and improved CPU utilization. Binary format for security log messages is available on all SRX Series Firewalls.
When configured in event mode, security log messages generated in the data plane are directed to the control plane and stored locally on the device. Security log messages stored in binary format are maintained in a log file separate from that used to maintain system log messages. Events stored in a binary log file are not accessible with advanced log-scripting commands intended for text-based log files. A separate CLI operational command supports decoding, converting, and viewing binary log files that are stored locally on the device.
When configured in stream mode, security log messages generated in the data plane are streamed to a remote device. When these messages are stored in binary format, they are streamed directly to an external log collection server in a Juniper-specific binary format. Externally-stored binary log files can only be read using Juniper Secure Analytics (JSA) or Security Threat Response Manager (STRM).
Starting in Junos OS Release 17.4R2 and later, on SRX300, SRX320, SRX340, SRX345 Series devices and vSRX Virtual Firewall instances, when the device is configured in stream mode, you can configure maximum of eight system log hosts. In Junos OS Release 17.4R2 and earlier releases, you can configure only three system log hosts in the stream mode. If you configure more than three system log hosts, then the following error message is displayed error: configuration check-out failed.
For information about configuring on-box (event-mode) binary security logs, please see Configuring On-Box Binary Security Log Files. For information about configuring off-box (stream-mode) binary security logs, please see Configuring Off-Box Binary Security Log Files.
On-Box Logging and Reporting
This topic describes the on-box logging and reporting CLI functionality and the design aspects of on-box reporting for the SRX devices.
- Overview
- On-Box Reporting Features
- Table Selection
- Table Lifetime
- Table Dense Mode
- Chassis Cluster Scenario
Overview
On-box traffic logging to solid-state drives (SSDs) supports eight external log servers or files.
An all-in-one XML file is added that contains all the traffic logs information. The XML file also generates all the logging header files and traffic log related documents.
A new process (daemon) called local log management daemon (llmd) is supported in Services Processing Cards 0 (SPCs0) to handle on-box traffic logging. Traffic produced by flowd in SPCs is listed in traffics logs. The llmd saves these logs to the local SSD. Traffic logs are saved in the four different formats. See Table 1 to know about the log formats.
Log format | Description | Default |
---|---|---|
Syslog |
|
Yes |
Sd-syslog |
|
- |
Welf |
|
- |
Binary |
|
- |
protobuf |
|
On-box reporting mechanism is an enhancement to the existing logging functionality. The existing logging functionality is modified to collect system traffic logs, analyzes the logs, and generate reports of these logs in the form of tables using the CLI. On-box reporting feature is intended to provide a simple and easy to use interface for viewing security logs. The on-box reports are easy to use J-Web pages of various security events in the form of tables and graphs. The reports allow the IT security management to identify security information at a glance, and quickly decide the actions to be taken. Thorough analysis of logs is performed (based on session types) for features such as screen, IDP, Content Security and IPSec.
You can define filters for the log data that is reported on based on the following criteria:
The top, in-detail, and in-interval conditions cannot be used at the same time.
-
top <number>
—This option allow you to generate reports for top security events as specified in the command. for example: top 5 IPS attacks or top 6 URLs detected through Content Security. -
in-detail <number>
—This option allow you to generate detail log content. -
in-interval <time-period>
—This option allows you to generate the events logged between certain time intervals. -
summary
—This option allows you to generate the summary of the events. In this way, you can fine-tune the report to your needs, and displays only the data that you want to use.
The maximum in-interval number which shows the count in intervals is 30. If large duration is specified, then the counters are assembled to ensure the maximum in-interval is less than 30.
Both in-detail and summary have the “all” option, since different table have different attribute (like session table does not have the attribute “reason” but Content Security has), the “all” option does not have any filter except start-time and stop-time. If there is any other filter other than start time and stop time then an error is displayed.
For example: root@host> show security log report in-detail all reason reason1
error: "query condition error"
The application firewall logs for application and user visibility will list applications and nested applications. When the logs of these features list nested applications then nested applications are listed in J-Web. When the logs list nested applications as not-applicable or unknown then only the applications are listed in J-Web.
Use the following CLI commands for application and user visibility for all the applications and nested applications listing:
-
For top nested-application by count—
show security log report top session-close top-number <number> group-by application order-by count with user
-
For top nested-application by volume—
show security log report top session-close top-number <number> group-by application order-by volume with user
-
For top user by count with nested application—
show security log report top session-close top-number <number> group-by user order-by count with application
The on-box reporting feature is enabled by default when you load the factory-default configurations on the SRX Series Firewall with Junos OS Release 15.1X49-D100 or later.
If you are upgrading your SRX Series Firewall from a Junos OS Release prior to Junos
OS 15.1X49-D100, then the SRX Series Firewall inherits the existing configuration
and the on-box reporting feature is disabled by default. You need to configure the
set security log report
command and the set security
log mode stream
command to enable the on-box reporting feature on the
device that are upgraded.
Starting in Junos OS Release 19.3R1 , the factory-default
configuration does not include on-box reporting configuration to increase the
solid-state drive (SSD) lifetime. You can enable the on-box reporting feature by
configuring the set security log report
CLI command at
[edit security log]
hierarchy.
See J-Web User Guide for SRX Series Devices to perform this task on J-Web user interface.
Starting in Junos OS Release 21.3R1, the on-box reporting logs are stored on the memory file system (MFS) if there is no external SSD. The maximum number of logs that you can save on MFS is lesser than what you can save on an external SSD. This prevents memory exhaustion and failure. Logs saved in MFS are not retained after device reboot or power failure. See Table 2 to know the number of logs recorded in on-box reporting and off-box reporting.
Reporting Mode | Session | Screen | IDP | Content Security | IPsec-VPN | SKY |
---|---|---|---|---|---|---|
Off-box | 1200,000 | 120,000 | 120,000 | 120,000 | 40,000 | 120,000 |
On-box | 500,000 | 50,000 | 50,000 | 50,000 | 20,000 | 50,000 |
You must configure security policy for the session using the set security
policies from-zone zone-name to-zone zone-name policy
policy-name then log session-close
command
to list all the applications and nested applications in Application Tracking on
J-Web using the on-box reporting feature. See for more log (Security
Policies) for details.
After the log message is recorded, the log is stored within a log file which is then stored in the database table of the RE for further analysis (on SRX300, SRX320, SRX340, SRX345, and SRX550M devices) or on the SSD card for further analysis (on SRX1500, SRX4100, and SRX4200 devices).
This feature supports receiving top most reports based on count or volume of the session or the type of log, captures events occurring in each second within a specified time range, captures log content for a specified CLI condition. Various CLI conditions like “summary”, top”, “in-detail”, and “in-interval” are used to generate reports. You can generate only one report at one time using the CLI. All the CLI conditions cannot be used at the same time. You can generate only one report at one time using the CLI.
The benefits of this feature are:
-
Reports are stored locally on the SRX Series Firewall and there is no requirement for separate devices or tools for logs and reports storage.
-
The on-box reports are easy-to-use J-Web pages of various security events in the form of tables and graphs.
-
Provides a simple and easy-to-use interface for viewing security logs.
-
The reports generated enables the IT security management team to identify security information at a glance and quickly decide the actions to be taken.
The on-box reporting feature supports:
-
Generating reports based on the requirements. For example: count or volume of the session, types of logs for activities such as IDP, Content Security, IPsec VPN.
-
Capturing real-time events within a specified time range.
-
Capturing all the network activities in a logical, organized, and easy-to-understand format based on various CLI specified conditions.
On-Box Reporting Features
The on-box reporting feature supports:
-
Sqlite3 support as a library—sqlite3 was not supported prior to Junos OS release 15.1X49-D100. Starting with Junos OS Release 15.1X49-D100, an SQL log database (SQLite Version 3) is used by the daemons running on the RE as well as other potential modules to store logs on SRX Series Firewalls.
In Junos OS Release 19.4R1, we've upgraded the on-box logging database to improve query performance.
-
Running llmd in both Junos OS and Linux OS—The forwarding daemon (flowd) decodes database index from binary logs and sends both index and log to the local log management daemon (llmd).
On SRX300, SRX320, SRX340, SRX345, and SRX550M devices, llmd runs in Junos OS. On SRX1500, SRX4100, and SRX4200 devices, llmd runs in Linux. So, for supporting llmd to run in both Junos OS and Linux OS, the llmd code directory is moved from the Linux side to the Junos OS side.
-
Storing of logs into specified table of the sqlite3 database by llmd— A new syslog daemon is introduced to collect local logs on SRX Series Firewalls and saving them into the database.
Starting in Junos OS Release 19.3R1, Junos OS stores logs in multiple tables instead of a single table in a database file. Each table contains the timestamp of the oldest and latest logs. When you initiate a query based on the start and end time, llmd finds latest table to generate reports.
For example, if there are 5 million logs in one table of a database file generated in the last 10 hours, and if you want to take a report, you should spend more than half an hour. From Junos OS Release 19.3R1, one table is separated into multiple tables, and each table has 0.5 million of logs. To generate the same report, one table information is sufficient.
We recommend you to query with a shorter time for better performance.
-
Database table definition—For session logs, the data types are source-address, destination-address, application, user, and so on. For logs related to security features, the data types are attack-name, URL, profile protocol, and so on. Therefore, different tables are designed to store different types of logs to help improve the performance and save disk space. SRX Series Firewall creates a database table for each log type, when log data is recorded.
Each type of database table has its maximum record number that is device specific. When the table record number reaches the limitation, new logs replace the oldest logs. Junos OS stores log in an SRX Series Firewall in which active traffic is passed.
Starting in Junos OS Release 19.3R1, you can create multiple tables in a database file to store logs. You can define the capacity to store logs in a table.
If the limit of log number exceeds the table capacity, Junos OS stores the logs in the second table. For example, if the limit of logs in table 1 exceeds the table capacity, Junos OS stores logs in table 2.
If the limit of the log number exceeds the last table of file 1, Junos OS stores the logs in table 1 of file 2. For example, table n is the last table of file 1. When the logs exceed the table capacity, Junos OS stores the logs in table 1 of file 2.
To make immediate effect after you change the table number, use
clear security log report
operational command. -
Database table rotation—Each type of database table has its maximum record number that is device specific. When the table record number reaches the limitation, new logs replace the oldest logs.
Following Table 3 describes the database file size capacity:
Table 3: Database File Size Capacity Devices
Session
Screen
IDP
Content Security
IPsec-VPN
SKY
SRX300, SRX320, SRX340, SRX345, and SRX550M
1.8G
0.18G
0.18G
0.18G
0.06G
0.18G
SRX1500
12G
2.25G
2.25G
2.25G
0.75G
2.25G
SRX4100 and SRX4200
15G
2.25G
2.25G
2.25G
0.75G
2.25G
SRX4600
22.5G
6G
6G
6G
0.75G
2.25G
vSRX Virtual Firewall
1.8G
0.18G
0.18G
0.18G
0.06G
0.18G
-
-
Calculating and displaying the reports that are triggered by CLI—The reports from the database are received from the CLI as the interface. Using the CLI, you can calculate and display the reporting details.
Table Selection
When you want to generate a report from multiple tables, llmd sorts tables based on timestamp and selects tables as per the requested start-time and stop-time.
For example, there are three tables that is table 1 (1 to 3), table 2 (3 to 5) and table 3 (6 to 8). 1 to 3, 3 to 6, and 6 to 8 denotes time stamp of latest and oldest logs. If you request a report from 4 to 6, Junos OS generates report from table 2 and table 3.
Table Lifetime
You can decide table lifetime by configuring set security log report
table-lifetime
command. Junos OS removes the table after the table
identify time exceeds the table lifetime. For example, if you configure table
lifetime as 2, and the current date is 26-July-2019, then it means on 24-July-2019
00:00:00 logs are removed.
If you change the date and time manually on a device, the table lifetime changes. For example, if a table identify time is 19-July-2019, and you configure table lifetime as 10, Junos OS should remove the table on 29-July-2019. If you change the device date as 18-July-2019, then the table real lifetime becomes 30-July-2019.
Table Dense Mode
In Junos OS Release 19.4R1, we've upgraded the default storage and search mechanism in the on-box logging database to manage logs. You can now customize log storage and search mechanism results. For example, if you expect fewer traffic logs, you can use the default configuration with a start time and a stop time.
However, if you expect a large number of traffic logs and greater time intervals for
which the logs will be generated, then enable dense mode. To enable dense mode, use
the set security log report table-mode dense
configuration command.
Chassis Cluster Scenario
For on-box reporting in a chassis cluster, the logs are stored in the local disk on which the device is processing active traffic. These logs are not synchronized to the chassis cluster peer.
Each node is responsible to store logs when each node is processing active traffic. In case of active/passive mode, only the active node processes the traffic and logs are also stored only in the active node. In case of failover, the new active node is processes the traffic and stores logs in its local disk. In case of active/active mode, each node processes its own traffic and logs are stored in the respective nodes.
See Also
Monitor Reports
On-box reporting offers a comprehensive reporting facility where your security management team can spot a security event when it occurs, immediately access and review pertinent details about the event, and quickly decide appropriate remedial action. The J-Web reporting feature provides one- or two-page reports that are equivalent to a compilation of numerous log entries.
This section contains the following topics:
Threats Monitoring Report
Purpose
Use the Threats Report to monitor general statistics and activity reports of current threats to the network. You can analyze logging data for threat type, source and destination details, and threat frequency information. The report calculates, displays, and refreshes the statistics, providing graphic presentations of the current state of the network.
Action
To view the Threats Report:
Click Threats Report in the bottom right of the Dashboard, or select Monitor>Reports>Threats in the J-Web user interface. The Threats Report appears.
Select one of the following tabs:
Field |
Description |
---|---|
General Statistics Pane | |
Threat Category |
One of the following categories of threats:
|
Severity |
Severity level of the threat:
|
Hits in past 24 hours |
Number of threats encountered per category in the past 24 hours. |
Hits in current hour |
Number of threats encountered per category in the last hour. |
Threat Counts in the Past 24 Hours | |
By Severity |
Graph representing the number of threats received each hour for the past 24 hours sorted by severity level. |
By Category |
Graph representing the number of threats received each hour for the past 24 hours sorted by category. |
X Axis |
Twenty-four hour span with the current hour occupying the right-most column of the display. The graph shifts to the left every hour. |
Y Axis |
Number of threats encountered. The axis automatically scales based on the number of threats encountered. |
Most Recent Threats | |
Threat Name |
Names of the most recent threats. Depending on the threat category, you can click the threat name to go to a scan engine site for a threat description. |
Category |
Category of each threat:
|
Source IP/Port |
Source IP address (and port number, if applicable) of the threat. |
Destination IP/Port |
Destination IP address (and port number, if applicable) of the threat. |
Protocol |
Protocol name of the threat. |
Description |
Threat identification based on the category type:
|
Action |
Action taken in response to the threat. |
Hit Time |
Time the threat occurred. |
Threat Trend in past 24 hours | |
Category |
Pie chart graphic representing comparative threat counts by category:
|
Web Filter Counters Summary |
|
Category |
Web filter count broken down by up to 39 subcategories. Clicking on the Web filter listing in the General Statistics pane opens the Web Filter Counters Summary pane. |
Hits in past 24 hours |
Number of threats per subcategory in the last 24 hours. |
Hits in current hour |
Number of threats per subcategory in the last hour. |
Field |
Function |
---|---|
Most Recent Virus Hits | |
Threat Name |
Name of the virus threat. Viruses can be based on services, like Web, FTP, or e-mail, or based on severity level. |
Severity |
Severity level of each threat:
|
Source IP/Port |
IP address (and port number, if applicable) of the source of the threat. |
Destination IP/Port |
IP address (and port number, if applicable) of the destination of the threat. |
Protocol |
Protocol name of the threat. |
Description |
Threat identification based on the category type:
|
Action |
Action taken in response to the threat. |
Last Hit Time |
Last time the threat occurred. |
Most Recent Spam E-Mail Senders | |
From e-mail |
E-mail address that was the source of the spam. |
Severity |
Severity level of the threat:
|
Source IP |
IP address of the source of the threat. |
Action |
Action taken in response to the threat. |
Last Send Time |
Last time that the spam e-mail was sent. |
Recently Blocked URL Requests | |
URL |
URL request that was blocked. |
Source IP/Port |
IP address (and port number, if applicable) of the source. |
Destination IP/Port |
IP address (and port number, if applicable) of the destination. |
Hits in current hour |
Number of threats encountered in the last hour. |
Most Recent IDP Attacks | |
Attack |
|
Severity |
Severity of each threat:
|
Source IP/Port |
IP address (and port number, if applicable) of the source. |
Destination IP/Port |
IP address (and port number, if applicable) of the destination. |
Protocol |
Protocol name of the threat. |
Action |
Action taken in response to the threat. |
Last Send Time |
Last time the IDP threat was sent. |
Traffic Monitoring Report
Purpose
Monitor network traffic by reviewing reports of flow sessions over the past 24 hours. You can analyze logging data for connection statistics and session usage by a transport protocol.
Action
To view network traffic in the past 24 hours, select Monitor>Reports>Traffic in the J-Web user interface. See Table 6 for a description of the report.
Field |
Description |
---|---|
Sessions in Past 24 Hours per Protocol | |
Protocol Name |
Name of the protocol. To see hourly activity by protocol, click the protocol name and review the “Protocol activities chart” in the lower pane.
|
Total Session |
Total number of sessions for the protocol in the past 24 hours. |
Bytes In (KB) |
Total number of incoming bytes in KB. |
Bytes Out (KB) |
Total number of outgoing bytes in KB. |
Packets In |
Total number of incoming packets. |
Packets Out |
Total number of outgoing packets. |
Most Recently Closed Sessions | |
Source IP/Port |
Source IP address (and port number, if applicable) of the closed session. |
Destination IP/Port |
Destination IP address (and port number, if applicable) of the closed session. |
Protocol |
Protocol of the closed session.
|
Bytes In (KB) |
Total number of incoming bytes in KB. |
Bytes Out (KB) |
Total number of outgoing bytes in KB. |
Packets In |
Total number of incoming packets. |
Packets Out |
Total number of outgoing packets. |
Timestamp |
The time the session was closed. |
Protocol Activities Chart | |
Bytes In/Out |
Graphic representation of traffic as incoming and outgoing bytes per hour. The byte count is for the protocol selected in the Sessions in Past 24 Hours per Protocol pane. Changing the selection causes this chart to refresh immediately. |
Packets In/Out |
Graphic representation of traffic as incoming and outgoing packets per hour. The packet count is for the protocol selected in the Sessions in Past 24 Hours per Protocol pane. Changing the selection causes this chart to refresh immediately. |
Sessions |
Graphic representation of traffic as the number of sessions per hour. The session count is for the protocol selected in the Sessions in Past 24 Hours per Protocol pane. Changing the selection causes this chart to refresh immediately. |
X Axis |
One hour per column for 24 hours. |
Y Axis |
Byte, packet, or session count. |
Protocol Session Chart | |
Sessions by Protocol |
Graphic representation of the traffic as the current session count per protocol. The protocols displayed are TCP, UDP, and ICMP. |
Configure On-Box Binary Security Log Files
SRX Series Firewalls use two types of logs—system logs and security logs—to record system events. System logs record control plane events—for example, when an admin user logs in. Security logs, also known as traffic logs, record data plane events regarding specific traffic handling. For example, Junos OS generates a security log if a security policy denies certain traffic because of a policy violation. For more about system logs, see Junos OS System Log Overview. For more information about security logs, see Understanding System Logging for Security Devices.
You can collect and save both system and security logs in binary format either on-box (that is, stored locally on the SRX Series Firewall) or off-box (streamed to a remote device). Using binary format ensures that log files are efficiently stored, which in turn improves CPU utilization.
You can configure security files in binary format using
the log
statement at the [security]
hierarchy
level.
On-box logging is also known as event-mode logging. For stream-mode, off-box security logging, see Configuring Off-Box Binary Security Log Files. When you configure security logs in binary format for event-mode logging, you can optionally define the log filename, file path, and other characteristics, as detailed in the following procedure:
View the content of the event-mode log file stored on the device
using show security log file
command and use clear
security log file
command to clear the content of the binary
event-mode security log file.
The show security log
command displays event-mode
security log messages if they are in a text-based format and the show security log file
command displays event-mode security
log messages if they are in binary format (on-box). Off-box binary
logging is read by Juniper Secure Analytics (JSA).
Configure Off-Box Binary Security Log Files
SRX Series Firewalls have two types of log: system logs and security logs. System logs record control plane events, for example admin login to the device. For more about system logs, please see Junos OS System Log Overview. Security logs, also known as traffic logs, record data plane events regarding specific traffic handling, for example when a security policy denies certain traffic due to some violation of the policy. For more information about security logs, please see Understanding System Logging for Security Devices.
The two types of log can be collected and saved either on-box or off-box. The procedure below explains how to configure security logs in binary format for off-box (stream-mode) logging.
You can configure security files in binary format using
the log
statement at the [security]
hierarchy
level.
The following procedure specifies binary format for stream-mode security logging, and defines the log filename, path, and log file characteristics. For event-mode, on-box security logging, please see Configuring On-Box Binary Security Log Files.
Configure On-Box Protobuf Security Log Files in Event Mode
View the content of the protobuf log file stored on
the device using the show security log file file1.pb
command.
user@host> show security log file
file1.pb
<14>1 2023-03-17T00:06:55 10.53.78.91 RT_LOG_SELF_TEST - SECINTEL_ACTION_LOG [junos@2636.1.1.1.2.129 category="secintel" sub-category="CC" action="block" action-detail="test" http-host="test" threat-severity="5" source-address="1.16.16.16" source-port="16384" destination-address="2.16.16.16" destination-port="32768" protocol-id="17" application="test" nested-application="test" feed-name="test" policy-name="test" profile-name="test" username="Fake username" roles="test" session-id="1" source-zone-name="Fake src zone" destination-zone-name="Fake dst zone" occur-count="3"] <14>1 2023-03-17T00:06:55 10.53.78.91 RT_LOG_SELF_TEST - AAMW_ACTION_LOG [junos@2636.1.1.1.2.129 hostname="test" file-category="virus" verdict-number="5" malware-info="Test-File" action="block" list-hit="test" file-hash-lookup="test" source-address="1.16.16.16" source-port="16384" destination-address="2.16.16.16" destination-port="32768" protocol-id="17" application="test" nested-application="test" policy-name="test" username="Fake username" roles="test" session-id="1" source-zone-name="Fake src zone" destination-zone-name="Fake dst zone" sample-sha256="da26ba1e13ce4702bd5154789ce1a699ba206c12021d9823380febd795f5b002" file-name="test_name" url="www.test.com"] ...
Configure On-Box Protobuf Security Log Files in Stream Mode
llmd
process. The llmd
process saves the log file
based on the device configuration. By default, the log files are stored in
/var/traffic-log/filename.pb directory.
You can decode the log file data using uspinfo
process.View the content of the protobuf log file stored on
the device using the show security log stream file file2.pb
command.
user@host> show security log file
file2.pb
<14>1 2023-03-15T22:27:34 10.53.78.91 RT_FLOW - RT_FLOW_SESSION_CREATE [junos@2636.1.1.1.2.129 source-address="1.0.0.3" source-port="38800" destination-address="4.0.0.3" destination-port="80" connection-tag="0" service-name="junos-http" nat-source-address="1.0.0.3" nat-source-port="38800" nat-destination-address="4.0.0.3" nat-destination-port="80" nat-connection-tag="0" src-nat-rule-type="N/A" src-nat-rule-name="N/A" dst-nat-rule-type="N/A" dst-nat-rule-name="N/A" protocol-id="6" policy-name="policy1" source-zone-name="trust" destination-zone-name="untrust" session-id="69" username="N/A" roles="N/A" packet-incoming-interface="ge-0/0/0.0" application="HTTP" nested-application="BING" encrypted="No" application-category="Web" application-sub-category="miscellaneous" application-risk="2" application-characteristics="N/A" src-vrf-grp="N/A" dst-vrf-grp="N/A" tunnel-inspection="Off" tunnel-inspection-policy-set="root" source-tenant="N/A" destination-service="N/A"] <14>1 2023-03-15T22:27:57 10.53.78.91 RT_FLOW - RT_FLOW_SESSION_CLOSE [junos@2636.1.1.1.2.129 reason="TCP FIN" source-address="1.0.0.3" source-port="38800" destination-address="4.0.0.3" destination-port="80" connection-tag="0" service-name="junos-http" nat-source-address="1.0.0.3" nat-source-port="38800" nat-destination-address="4.0.0.3" nat-destination-port="80" nat-connection-tag="0" src-nat-rule-type="N/A" src-nat-rule-name="N/A" dst-nat-rule-type="N/A" dst-nat-rule-name="N/A" protocol-id="6" policy-name="policy1" source-zone-name="trust" destination-zone-name="untrust" session-id="69" packets-from-client="11129" bytes-from-client="583566" packets-from-server="154153" bytes-from-server="218074629" elapsed-time="23" application="HTTP" nested-application="BING" username="N/A" roles="N/A" packet-incoming-interface="ge-0/0/0.0" encrypted="No" application-category="Web" application-sub-category="miscellaneous" application-risk="2" application-characteristics="N/A" secure-web-proxy-session-type="NA" peer-session-id="0" peer-source-address="0.0.0.0" peer-source-port="0" peer-destination-address="0.0.0.0" peer-destination-port="0" hostname="NA NA" src-vrf-grp="N/A" dst-vrf-grp="N/A" tunnel-inspection="Off" tunnel-inspection-policy-set="root" session-flag="0" source-tenant="N/A" destination-service="N/A" user-type="N/A"] ...
Configure Off-box Protobuf Security Log Files
Data plane use Protobuf format in stream
and
stream-event
mode to encode the log and send the log to host.
The security log data is sent to host using different transport protocol and port
number. The host receives the protobuf log and save it to a file. Copy
hplc_collect.py
, hplc_view.py
,
security_log.xml
and protobuflog.proto
files
to the host. The hplc_collect.py
is used to collect and save the
log files on the host. The protobuflog.proto
is used to decode the
file data on the host and you can view the data using hplc_view.py
.
The files are published to /share/juniper and copied to host.
The hplc_collect.py
and hplc_view.py
files support
latest python version 3.
Send System Log Messages to a File
You can direct system log messages to a file on the CompactFlash
(CF) card. The default directory for log files is /var/log
. To specify a different directory on the CF card, include the complete
pathname.
Create a file named security
, and send log messages
of the authorization
class at the severity level info
to the file.
To set the filename, the facility, and severity level:
{primary:node0}
user@host# set system syslog file security authorization info
Configure the System to Send All Log Messages Through eventd
The eventd
process of logging configuration is most
commonly used for Junos OS. In this configuration, control plane logs
and data plane, or security, logs are forwarded from the data plane
to the Routing Engine control plane rtlogd
process. The rtlogd
process then either forwards syslog or sd-syslog-formatted
logs to the eventd
process or the WELF-formatted logs to
the external or remote WELF log collector.
To send all log messages through eventd
:
To send duplicate logs to a second remote server, repeat the command with a new fully qualified hostname or IP address of a second server.
If your deployment is an active/active chassis cluster, you can also configure security logging on the active node to be sent to separate remote servers to achieve logging redundancy.
To rename or redirect one of the logging configurations, you need to delete and recreate it. To delete a configuration:
{primary:node0}
user@host# delete security log mode event
Change History Table
Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.