-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to Mina SSHD for the implementation of the SSH crawler #1225
Conversation
After digging into this one, I found that as soon you are adding this dependency: <dependency>
<groupId>org.apache.sshd</groupId>
<artifactId>sshd-sftp</artifactId>
<version>2.7.0</version>
</dependency> It generates 2 threads although you are not calling any kind of code from this dependency.
|
This was due to the fact we were using this line to decompress a zip file: ```java FileSystems.newFileSystem(zipFile, zipProperties) ``` This apparently loads and starts some classes behind the scene, which we don't want.
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { | ||
Files.copy(file, destination.resolve(rootPath.relativize(file).toString()), StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING); | ||
return FileVisitResult.CONTINUE; | ||
try (InputStream is = jar.getInputStream(file); FileOutputStream fos = new FileOutputStream(f)) { |
Check failure
Code scanning / SonarCloud
Extracting archives should not lead to zip slip vulnerabilities High
framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/FsCrawlerUtil.java
Fixed
Show fixed
Hide fixed
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
We switch to https://github.com/apache/mina-sshd for the implementation of the SSH crawler.
It also helps us to now run integration tests.