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

Initial implementation. #1

Merged
merged 25 commits into from
Nov 30, 2021
Merged

Initial implementation. #1

merged 25 commits into from
Nov 30, 2021

Conversation

ro-tex
Copy link
Collaborator

@ro-tex ro-tex commented Oct 28, 2021

PULL REQUEST

Overview

This PR introduces the initial implementation of the service.

What is supported so far is:

  • submit a new skylink for scanning: POST /scan/:skylink
    • the skylink will be stored in MongoDB
    • it will be automatically downloaded and streamed to ClamAV (without being stored on disk)
    • after being scanned, the skylink itself will be removed from MongoDB and only its hash will be kept

Planned follow-up features:

  • list all known malicious skylinks' hashes
  • scan skylinks for CSAM as well

Known limitations:

Example for Visual Changes

Checklist

Review and complete the checklist to ensure that the PR is complete before assigned to an approver.

  • All new methods or updated methods have clear docstrings
  • Testing added or updated for new methods
  • Verify if any changes impact the WebPortal Health Checks
  • Approriate documentation updated
  • Changelog file created

Issues Closed

@ro-tex ro-tex self-assigned this Oct 28, 2021
api/handlers.go Outdated Show resolved Hide resolved
api/handlers.go Outdated Show resolved Hide resolved
api/handlers.go Outdated Show resolved Hide resolved
api/api.go Outdated Show resolved Hide resolved
api/api.go Show resolved Hide resolved
database/db.go Show resolved Hide resolved
database/db.go Show resolved Hide resolved
api/handlers.go Outdated Show resolved Hide resolved
api/handlers.go Outdated Show resolved Hide resolved
Copy link
Contributor

@MSevey MSevey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly docstring updates but the one comment about updating the entries is the main thing to address.

@ro-tex ro-tex requested a review from MSevey November 3, 2021 14:41
Make the skylink string not unique (most of them will be "").
@ro-tex ro-tex changed the title Initial implementation. WIP: Initial implementation. Nov 9, 2021
@ro-tex ro-tex changed the title WIP: Initial implementation. Initial implementation. Nov 11, 2021
database/db.go Outdated Show resolved Hide resolved
database/db.go Outdated Show resolved Hide resolved
database/db.go Outdated Show resolved Hide resolved
database/db.go Outdated Show resolved Hide resolved
database/db.go Show resolved Hide resolved
database/db.go Show resolved Hide resolved
database/skylink.go Outdated Show resolved Hide resolved
api/api.go Outdated Show resolved Hide resolved
clamav/clamav.go Show resolved Hide resolved
@ro-tex ro-tex requested a review from peterjan November 16, 2021 12:30
Copy link

@ChrisSchinnerl ChrisSchinnerl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall but requires some testing.

MSevey
MSevey previously approved these changes Nov 23, 2021
Copy link
Contributor

@MSevey MSevey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with my comments being follow ups to be able to review the iterations in more detail. Overall structure is good.

.golangci.yml Outdated Show resolved Hide resolved
.golangci.yml Outdated Show resolved Hide resolved
.golangci.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
api/handlers.go Outdated Show resolved Hide resolved
scanner/scanner.go Show resolved Hide resolved
database/db.go Outdated Show resolved Hide resolved
scanner/scanner.go Outdated Show resolved Hide resolved
scanner/scanner.go Outdated Show resolved Hide resolved
scanner/scanner.go Show resolved Hide resolved
… subsequent errors from 100ms to 100s in 4 steps.
scanner/scanner.go Outdated Show resolved Hide resolved
scanner/scanner.go Show resolved Hide resolved
scanner/scanner.go Outdated Show resolved Hide resolved
scanner/scanner.go Outdated Show resolved Hide resolved
scanner/scanner.go Outdated Show resolved Hide resolved
scanner/scanner.go Outdated Show resolved Hide resolved
scanner/scanner.go Outdated Show resolved Hide resolved
scanner/scanner.go Show resolved Hide resolved
scanner/scanner.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
scanner/scanner.go Show resolved Hide resolved
scanner/scanner.go Show resolved Hide resolved
Copy link
Contributor

@MSevey MSevey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's handle all the comments as follow ups

ro-tex added a commit that referenced this pull request Nov 29, 2021
@ChrisSchinnerl ChrisSchinnerl merged commit cee102d into main Nov 30, 2021
@ro-tex ro-tex deleted the ivo/impl branch November 30, 2021 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants