File Transfer Protocol (FTP)
Controlling FTP Access
FTP Exit Points
We need to add our exit program to the exit point using the registration facility (WRKREGINF). TCP/IP application checks the registration facility to determine whether exit program is called for the particular exit point.
For security purposes, the TCP/IP application requires the exit program to return a specified operation. This operation tells the TCP/IP application whether or not to continue with the process.
The three exit points are:
These exit points are used to add security and validation for FTP. The FTP Client and Server request validation exit points are used to validate FTP subcommands. The Server logon exit point authenticates the user who is trying to logon to FTP server. You can also use this exit point to validate "anonymous" user logons to the FTP server.
FTP Server Logon Exit Program
The program also validates the Client IP address against all valid IP address found in the Host Table. You may access the Host table entries from the CFGTCP menu. Option 10, Work with TCP/IP host table entries, enables us to add host IP address and their associated host names to the host table. The host table is stored in member HOST of the file QATOCHOST in library QUSRSYS. The Host table must be identical throughout the network. The FTPLOGON program denies any client IP address not found in the host table.
The FTPLOGON program accepts 7 input parameters and returns 4 output parameters. Based on the input parameters, FTPLOGON determines what parameters to validate. FTPLOGON program enables the initial current library to be set by allowing the current library listed in the input parameter to be overriden. FTPLOGON sets the return code output parameter to indicate whether or not to allow the server is to continue logon operation. Different return codes are available to enable alternative ways of processing the logon and initializing the current library.
NOTE: The FTPLOGON program allows the FTP to continue from either an invalid IP address, or users not authorized to FTPLOGON authorization list. Change the program to reject (remove the *@@@@@ comment line) the logon to stop the FTP log on. A special user id ZFTP is used to bypass FTP security.
FTP Request Validation Exit Program
Requested operations are permitted or denied based on the returned "Allow operation" output parameter. For example, the FTP application calls FTPRQSVLD with a request to PUT (write/update) to this file? FTPRQSVLD determines whether the request is accepted and returns the "Allow operation" return code to the FTP application. If it is denied, the FTP application issues a message that state that the operation is rejected.
The exit program may also indicate that the FTP request will always be allowed or always denied for a particular user. When always allowed or always denied is returned, the FTP application will not call the exit program again for the same request during the user session.
The FTPRQSVLD program accepts 7 input parameters and returns 1 output parameter. Based on the input parameter, FTPRQSVLD can determine what type of FTP operation is being requested, For operation containing name of library or file name, FTPRQSVLD allows the operation if the library requested is a "Test" type library. For "Production" type library, the FTP request is rejected. FTP request requiring execution of CL commands are all rejected.
This page hosted by Get your own Free Home Page