Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
com.github.ramalapure:filesystem
Advanced tools
The file system library will help perform operations on AWS S3 or SFTP file system. The library will be useful for big data projects where they need to perform operations on files.
The library cab be used to perform file system operations, currently it support AWS S3 and SFTP related operations.
How you can use it:
Maven
<dependency>
<groupId>com.github.ramalapure</groupId>
<artifactId>filesystem</artifactId>
<version>1.1</version>
</dependency>
Gradle
implementation 'com.github.ramalapure:filesystem:1.1'
Let's see the configuration and how to get the instance of file system.
for AWS S3 file system:
Map<String, Object> properties = new HashMap<>();
properties.put(AppConstants.S3_ACCESS_KEY, "REPLACE_AWS_ACCESS_KEY");
properties.put(AppConstants.S3_SECRET_KEY, "REPLACE_AWS_SECRET_KEY");
properties.put(AppConstants.REGION, "REPLACE_REGION");
properties.put(AppConstants.S3_BUCKET_NAME, "REPLACE_BUCKET_NAME");
Configuration config = new Configuration(AppConstants.STR_S3, properties);
FileSystem fileSystem = FileSystemFactory.getFileSystem(config);
for SFTP file system:
Map<String, Object> properties = new HashMap<>();
properties.put(AppConstants.SFTP_USERNAME, "REPLACE_SFTP_USERNAME");
properties.put(AppConstants.SFTP_PASSWORD, "REPLACE_SFTP_PSWD");
properties.put(AppConstants.SFTP_HOSTNAME, "REPLACE_SFTP_HOST");
// port value must be integer
properties.put(AppConstants.SFTP_PORT, REPLACE_SFTP_PORT);
Configuration config = new Configuration(AppConstants.STR_SFTP, properties);
FileSystem fileSystem = FileSystemFactory.getFileSystem(config);
The AWS S3 file system supports following operations on bucket:
// As creating a bucket is not directly available in file system interface
// we need to get the actual instance of S3 client.
AwsS3Client client = (AwsS3Client) fileSystem;
client.createBucket("REPLACE_WITH_BUCKET_NAME");
// As list of buckets is not directly available in file system interface
// we need to get the actual instance of S3 client.
AwsS3Client client = (AwsS3Client) fileSystem;
List<String> listOfBuckets = client.getListOfBuckets();
// Empty string will return all the objects/files from buckets
List<String> files = fileSystem.getListOfFiles("");
//OR you can get files from only specific folder
List<String> files = fileSystem.getListOfFiles("/specific-folder");
File file = new File("THE_FILE_YOU_WANT_TO_UPLOAD");
fileSystem.uploadFile(new FileInputStream(file), "FILE_KEY");
InputStream inputStream = fileSystem.read("FILE_KEY");
fileSystem.downloadFile("FILE_KEY_TO_DOWNLOAD_FROM_BUCKET", "FILE_NAME_TO_SAVE_ON_LOCAL_SYSTEM");
fileSystem.createFolder("FOLDER_NAME");
fileSystem.deleteFile("FILE_KEY");
fileSystem.copyFile("SOURCE_FILE_KEY", "TARGET_FILE_KEY");
// As deleting a bucket is not directly available in file system interface
// we need to get the actual instance of S3 client.
AwsS3Client client = (AwsS3Client) fileSystem;
client.deleteBucket("BUCKET_NAME");
The SFTP file system supports following operations on directory/file:
// Empty string will return all the files
List<String> files = fileSystem.getListOfFiles("");
//OR you can get files from only specific folder
List<String> files = fileSystem.getListOfFiles("/specific-folder");
File file = new File("THE_FILE_YOU_WANT_TO_UPLOAD");
fileSystem.uploadFile(new FileInputStream(file), "FILE_KEY");
InputStream inputStream = fileSystem.read("FILE_NAME_WITH_PATH");
fileSystem.downloadFile("FILE_NAME_TO_DOWNLOAD_FROM_DIRECTORY", "FILE_NAME_TO_SAVE_ON_LOCAL_SYSTEM");
fileSystem.createFolder("FOLDER_NAME");
fileSystem.deleteFile("FILE_NAME_WITH_PATH");
fileSystem.copyFile("SOURCE_FILE_NAME_WITH_PATH", "TARGET_FILE_NAME_WITH_PATH");
FAQs
The file system library will help perform operations on AWS S3 or SFTP file system. The library will be useful for big data projects where they need to perform operations on files.
We found that com.github.ramalapure:filesystem demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.