sftpagent stops working after upgrade to RSA NetWitness
Issue
After upgrading to a newer version, log collection (File) via sftp agent stops working.
Launching the sftp agent script from the command line returns the following error:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Couldn't read packet: Connection reset by peer
**** Transfer Errors processing /path/to/filename
**** Exiting Script
Please make sure that the sftp agent is configured correctly, with particular regards to keys, user and permissions.
Try to connect from one of the affected event sources using ftp:
In the command above please replace:
path-to-user-home with the correct path to the home directory of the user configured for the log collection on the event source
Check if the following error is returned:
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Couldn't read packet: Connection reset by peer
On the Log Decoder/Log Collector is possible to see the following errors in /var/log/secure:
Running the following command on the Log Decoder/Log Collector will show that selinux is mode is on "Enforcing":
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted
Cause
On the Log Decoder/Log Collector selinux cause the sftp agent to fail connecting.Workaround
-
Open the
/etc/selinux/configfile in a text editor of your choice, for example:# vi /etc/selinux/config -
Configure the
SELINUX=permissiveoption:# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted -
Restart the system:
# reboot
Resolution
Set the selinux mode to "Permissive" on the Log Decoder/Log Collector.
Product Details
NetWitness Product Set: NetWitness Platform
NetWitness Product/Service Type: Log Collector
NetWitness Version/Condition: 12.x
Platform: CentOS/Alma Linux
Approval Reviewer Queue
Technical approval queue