Skip to content
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

Socket support #7

Closed
nicolaspeixoto opened this issue Jun 24, 2015 · 11 comments
Closed

Socket support #7

nicolaspeixoto opened this issue Jun 24, 2015 · 11 comments
Milestone

Comments

@nicolaspeixoto
Copy link

What do you think about support scan using tcp socket?

@kylefarris
Copy link
Owner

I'm open to any ideas! Could you elaborate on exactly what you're looking for?

@kylefarris
Copy link
Owner

Ohhh... I think you mean supporting a remote clamscan server via TCP socket. I definitely think this could be possible but it would take a bit of work. Would you like to try and get this to work? If not, I can put this on the backburner as a really good idea that I don't exactly have time to work on at the moment.

@kylefarris
Copy link
Owner

I've made a new branch called sockets and committed some code to it. The idea was intriguing enough that I think I'll try and get this working sooner rather than later.

@kylefarris
Copy link
Owner

18 Commits in. Almost there. Just need to tweak a few things and write some tests.

@nicolaspeixoto
Copy link
Author

Nice job Kyle!
do you want help in anything?

@kylefarris
Copy link
Owner

Thanks! I've learned a lot—it's been fun. I think I've got it, though. I'll let you know when I I've lost completed it and you can clone it and test it in your environment to make sure it works as expected. I'll wait for your response before publishing to NPM.

@kylefarris
Copy link
Owner

I just wanted to say that I haven't given up on this, I've just been busy. They code is more or less done at this point, I'm just still working on the test cases and making sure it will work perfectly for everyone when it gets released.

Thanks for your patience--I'm doing this in between my job and other side projects.

@nicolaspeixoto
Copy link
Author

There is no problem about it Kyle. Where did you stop? Could i help you?

@kylefarris
Copy link
Owner

Hey @nicolaspeixoto. Well, you got me motivated tonight so I finished writing the tests. Everything seems to be working. I haven't run it through any kind of rigorous real-world examples, yet, but, I think it should work just fine.

What you can do to help is checkout the sockets branch of the repository and see if you can run it through some real examples of how you're planning on using it and get back to me with any issues you might come across. I really want to make sure this is working perfectly before I merge back to Master and push out version 0.9.0 on NPM.

If you could do that, I'd be incredibly grateful. Don't test it on live stuff! :D

@nicolaspeixoto
Copy link
Author

Hey @kylefarris, i started to test with a simple script:

var clam = require('./')({
    remove_infected: true, // Removes files if they are infected
    quarantine_infected: '~/infected/', // Move file here. remove_infected must be FALSE, though.
    scan_recursively: false, // Choosing false here will save some CPU cycles
    scan_log: '/var/log/node-clam', // You're a detail-oriented security professional.
    debug_mode: true, // This will put some debug info in your js console
    clamdscan: {
        host: '127.0.0.1', // If you want to connect locally but not through socket
        port: 3310, // Because, why not
    },
    preference: 'clamdscan' // If clamscan is found and active, it will be used by default
});

clam.scan_file('/home/nicolas/mytest.pdf', function(){
    console.log("callback");
});

But the scan_file function didn't call the callback function. I think it didn't send the file to the Clamav server too.

This is the log from execution:

node-clam: Initially testing socket/tcp connection to clamscan server.
1: node-clam: Socket connection created: test_availability
node-clam: using remote server: 127.0.0.1:3310
node-clam: Established connection to clamscan server for testing!
2: node-clam: Socket connection created: scan_stream
node-clam: using remote server: 127.0.0.1:3310
node-clam: PING-PONG!
3: node-clam: Socket connection closed: test_availability
4: node-clam: Socket connection closed: scan_stream

@kylefarris kylefarris added this to the v1.0 milestone Nov 30, 2018
@kylefarris
Copy link
Owner

Version 1.0.0 is out and supports this feature. Finally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants