Class: Ftpd::SessionConfig
- Inherits:
-
Object
- Object
- Ftpd::SessionConfig
- Defined in:
- lib/ftpd/session_config.rb
Overview
All of the configuration needed by a session
Instance Attribute Summary collapse
-
#allow_low_data_ports ⇒ Boolean
If true, allow the PORT command to specify privileged data ports (those below 1024).
-
#auth_level ⇒ Integer
The authentication level.
-
#driver ⇒ Object
The driver should expose these public methods: * authenticate * file_system.
-
#exception_handler ⇒ Proc
The exception handler.
-
#failed_login_delay ⇒ Object
The delay (in seconds) after a failed login.
-
#list_formatter ⇒ class that quacks like Ftpd::ListFormat::Ls
The class for formatting for LIST output.
-
#log ⇒ Logger
The logger.
-
#max_failed_logins ⇒ Integer
The maximum number of failed login attempts before disconnecting the user.
-
#response_delay ⇒ Numeric
The number of seconds to delay before replying.
-
#server_name ⇒ String
The server’s name, sent in a STAT reply.
-
#server_version ⇒ String
The server’s version, sent in a STAT reply.
-
#session_timeout ⇒ Numeric
The session timeout.
-
#tls ⇒ Symbol
Whether or not to do TLS, and which flavor.
Instance Attribute Details
#allow_low_data_ports ⇒ Boolean
If true, allow the PORT command to specify privileged data ports (those below 1024). Defaults to false. Setting this to true makes it easier for an attacker to use the server to attack another server. See RFC 2577 section 3.
14 15 16 |
# File 'lib/ftpd/session_config.rb', line 14 def allow_low_data_ports @allow_low_data_ports end |
#auth_level ⇒ Integer
The authentication level. One of:
-
Ftpd::AUTH_USER
-
Ftpd::AUTH_PASSWORD (default)
-
Ftpd::AUTH_ACCOUNT
24 25 26 |
# File 'lib/ftpd/session_config.rb', line 24 def auth_level @auth_level end |
#driver ⇒ Object
The driver should expose these public methods:
33 34 35 |
# File 'lib/ftpd/session_config.rb', line 33 def driver @driver end |
#exception_handler ⇒ Proc
The exception handler. When there is an unknown exception, server replies 451 and calls exception_handler. If nil, then it’s ignored.
107 108 109 |
# File 'lib/ftpd/session_config.rb', line 107 def exception_handler @exception_handler end |
#failed_login_delay ⇒ Object
The delay (in seconds) after a failed login. Defaults to 0. Setting this makes brute force password guessing less efficient for the attacker. RFC-2477 suggests a delay of 5 seconds.
39 40 41 |
# File 'lib/ftpd/session_config.rb', line 39 def failed_login_delay @failed_login_delay end |
#list_formatter ⇒ class that quacks like Ftpd::ListFormat::Ls
The class for formatting for LIST output.
45 46 47 |
# File 'lib/ftpd/session_config.rb', line 45 def list_formatter @list_formatter end |
#log ⇒ Logger
The logger.
51 52 53 |
# File 'lib/ftpd/session_config.rb', line 51 def log @log end |
#max_failed_logins ⇒ Integer
The maximum number of failed login attempts before disconnecting the user. Defaults to nil (no maximum). When set, this may makes brute-force password guessing attack less efficient.
59 60 61 |
# File 'lib/ftpd/session_config.rb', line 59 def max_failed_logins @max_failed_logins end |
#response_delay ⇒ Numeric
The number of seconds to delay before replying. This is for testing, when you need to test, for example, client timeouts. Defaults to 0 (no delay).
67 68 69 |
# File 'lib/ftpd/session_config.rb', line 67 def response_delay @response_delay end |
#server_name ⇒ String
The server’s name, sent in a STAT reply. Defaults to FtpServer::DEFAULT_SERVER_NAME.
74 75 76 |
# File 'lib/ftpd/session_config.rb', line 74 def server_name @server_name end |
#server_version ⇒ String
The server’s version, sent in a STAT reply.
80 81 82 |
# File 'lib/ftpd/session_config.rb', line 80 def server_version @server_version end |
#session_timeout ⇒ Numeric
The session timeout. When a session is awaiting a command, if one is not received in this many seconds, the session is disconnected. If nil, then timeout is disabled.
88 89 90 |
# File 'lib/ftpd/session_config.rb', line 88 def session_timeout @session_timeout end |
#tls ⇒ Symbol
Whether or not to do TLS, and which flavor.
One of:
-
:off
-
:explicit
-
:implicit
99 100 101 |
# File 'lib/ftpd/session_config.rb', line 99 def tls @tls end |