German-Immersive-Railroading-Community / BackupSystem

Detected calls to FTP-related functions BAN-B321
Security
Major
2 years ago2 years old
FTP-related functions are being called. FTP is considered insecure. Use SSH/SFTP/SCP or some other encrypted protocol.
168start_time = time.time()
169ftp = pk.Transport((config_variables["host"], int(config_variables["port"])))
170lg.debug('Set up FTP object')
171ftp.connect(username=config_variables["user"],172            password=config_variables["pass"])173sftp = pk.SFTPClient.from_transport(ftp)
174lg.info(f'Sending {zipname}...')
175sftp.put(f'./{zipname}', 'backups/' +
FTP-related functions are being called. FTP is considered insecure. Use SSH/SFTP/SCP or some other encrypted protocol.
176         dt.today().strftime('%Y-%m') + f'/{zipname}')
177lg.info(f'Done sending {zipname}')
178sftp.close()
179ftp.close()180runtime = time.time() - start_time
181lg.info(f'Done transfering; took {runtime} seconds.')
182os.remove(zipname)