Create an Agent Based Log Source - Apache
Topics Discussed
You can use this document to send Apache logs to Armor's Security Information & Event Management (SIEM).
Configure Your Apache Service
Configuring Apache services uses the Command Line Interface (CLI) feature. For more information, see Security Service CLI Commands.
The following arguments are possible parameters for the Logging CLI feature. This allows customers to manage filebeat modules on Virtual Machines.
Command | Arguments | Result |
---|---|---|
| Â | Enables filebeat IIS/apache/nginx. When run, module yml file will change from disabled state to enable state. |
| Â | Disables Filebeat IIS/apache/nginx. When run the module yml file will change from enable state to disable mode. |
| path1, path2, path3 | Includes the argument paths in module yml file under the 'access_paths' section. |
| path1, path2, path3 | Removes the argument paths in module yml file under the 'access_paths' section. |
| path1, path2, path3 | Includes the argument paths in module yml file under the 'error_paths' section. |
| path1, path2, path3 | Removes the argument paths in module yml file under the 'error_paths' section. Removes the argument paths in module yml file under the 'error_paths' section. |
| Â | The command sync the module yml file on vm with latest changes which are required. |
| Â | The command displays current access & error paths which are configured in module yml file. |
Â
Command Usage:
armor logging apache-enable
armor logging apache-disable
armor logging apache-add-access-paths <required paths needs to add here>
armor logging apache-remove-access-paths <required paths needs to add here>
armor logging apache-add-error-paths <required paths needs to add here>
armor logging apache-remove-error-paths <required paths needs to add here>
armor logging apache-sync-config
armor logging apache-describe-config
Additional Information
Apache will need configuration for a specific log format. This is normally done in the httpd.conf file. Documentation for the log_config_module can be found at http://httpd.apache.org/docs/current/mod/mod_log_config.html
Configure Log Format Directive Apache Docs
Without Reverse Proxy
LogFormat "httpd: %h %A %l %u %t \"%r\" %>s %p %b \"%{Referer}i\" \"%{User-agent}i\"" armor_noproxy_202004
With Reverse Proxy
LogFormat "httpd: %a %A %l %u %t \"%r\" %>s %p %b \"%{Referer}i\" \"%{User-agent}i\"" armor_proxy_202004
Configure Custom Log Directive Apache Docs
The filename supplied to CustomLog will need to be added as a file path with the Security Service CLI Commands.
Configure Custom Log Directive will create a filename that is then used with the command:
Â
Full Example
Troubleshooting
Verify that logs are formatted correctly, similar to the following example:
Â
Missing Logs
If Apache logs locally do not match what's in Armor Log Search, verify the file size of the logs ingested. Filebeat has a maximum file size of 10MB. Anything over 10MB will require updates to the Filebeat Apache configuration, with the max-bytes property set to the desired value.
Note: Running #armor logging apache-sync-config
will overwrite the custom setting already in the configuration file.