-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove ftp functionality https://eaflood.atlassian.net/browse/IWTF-4278 Remove ftp functionality as package we use in fulfilment and pocl jobs (ssh2-sftp-client) has critical vulnerability * remove ssh2 sftp client * remove ssh2 sftp client and fix lint * remove reference * fix tests * fix tests and lint * update tests * refactor * refactor * update tests * refactor tests * s3spec * undefined token * rename file and undo removal of stores3 * rename file and undo removal of stores3 * add missing mock * Remove ssh2 mock * remove functionality from config * remove ftp reference ---------
- Loading branch information
1 parent
621875e
commit 42f1d84
Showing
21 changed files
with
111 additions
and
1,363 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,6 @@ | ||
import { AWS } from '@defra-fish/connectors-lib' | ||
import db from 'debug' | ||
const { secretsManager } = AWS() | ||
|
||
/** | ||
* Key exchange algorithms for public key authentication - in descending order of priority | ||
* @type {string[]} | ||
*/ | ||
export const SFTP_KEY_EXCHANGE_ALGORITHMS = [ | ||
'[email protected]', | ||
'curve25519-sha256', | ||
'ecdh-sha2-nistp521', | ||
'ecdh-sha2-nistp384', | ||
'ecdh-sha2-nistp256', | ||
'diffie-hellman-group-exchange-sha256', | ||
'diffie-hellman-group14-sha256', | ||
'diffie-hellman-group16-sha512', | ||
'diffie-hellman-group18-sha512', | ||
'diffie-hellman-group14-sha1', | ||
'diffie-hellman-group-exchange-sha1', | ||
'diffie-hellman-group1-sha1' | ||
] | ||
/** | ||
* Ciphers for SFTP support - in descending order of priority | ||
* @type {string[]} | ||
*/ | ||
export const SFTP_CIPHERS = [ | ||
// http://tools.ietf.org/html/rfc4344#section-4 | ||
'aes256-ctr', | ||
'aes192-ctr', | ||
'aes128-ctr', | ||
'aes256-gcm', | ||
'[email protected]', | ||
'aes128-gcm', | ||
'[email protected]', | ||
'aes256-cbc', | ||
'aes192-cbc', | ||
'aes128-cbc', | ||
'blowfish-cbc', | ||
'3des-cbc', | ||
'cast128-cbc' | ||
] | ||
const { secretsManager } = AWS() | ||
const falseRegEx = /(false|0)/i | ||
const trueRegEx = /(true|1)/i | ||
const toBoolean = val => { | ||
|
@@ -54,7 +15,6 @@ const toBoolean = val => { | |
|
||
class Config { | ||
_file | ||
_ftp | ||
_s3 | ||
_pgp | ||
|
||
|
@@ -68,20 +28,6 @@ class Config { | |
*/ | ||
partFileSize: Math.min(Number.parseInt(process.env.FULFILMENT_FILE_SIZE), 999) | ||
} | ||
this.ftp = { | ||
host: process.env.FULFILMENT_FTP_HOST, | ||
port: process.env.FULFILMENT_FTP_PORT || '22', | ||
path: process.env.FULFILMENT_FTP_PATH, | ||
username: process.env.FULFILMENT_FTP_USERNAME, | ||
privateKey: (await secretsManager.getSecretValue({ SecretId: process.env.FULFILMENT_FTP_KEY_SECRET_ID }).promise()).SecretString, | ||
algorithms: { cipher: SFTP_CIPHERS, kex: SFTP_KEY_EXCHANGE_ALGORITHMS }, | ||
// Wait up to 60 seconds for the SSH handshake | ||
readyTimeout: 60000, | ||
// Retry 5 times over a minute | ||
retries: 5, | ||
retry_minTimeout: 12000, | ||
debug: db('fulfilment:ftp') | ||
} | ||
this.s3 = { | ||
bucket: process.env.FULFILMENT_S3_BUCKET | ||
} | ||
|
@@ -104,18 +50,6 @@ class Config { | |
this._file = cfg | ||
} | ||
|
||
/** | ||
* FTP configuration settings | ||
* @type {object} | ||
*/ | ||
get ftp () { | ||
return this._ftp | ||
} | ||
|
||
set ftp (cfg) { | ||
this._ftp = cfg | ||
} | ||
|
||
/** | ||
* S3 configuration settings | ||
* @type {object} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 0 additions & 63 deletions
63
packages/fulfilment-job/src/transport/__tests__/ftp.spec.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.