Malshare ingestor#2804
Conversation
|
Please review. |
| response = requests.get(download_url) | ||
| response.raise_for_status() | ||
| if not isinstance(response.content, bytes): | ||
| raise ValueError("VT downloaded file is not instance of bytes") |
There was a problem hiding this comment.
Sorry, misstype. Updated.
| try: | ||
| logger.info(f"Downloading sample {h}") | ||
| download_url = f"{self.url}/api.php?api_key={self._api_key_name}&action=getfile&hash={h}" | ||
| response = requests.get(download_url) |
There was a problem hiding this comment.
Can you please use the requests.get params parameter for each of the request parameter ? This avoid longer f-string and I think it's more readable
|
|
||
| def run(self) -> Iterable[Any]: | ||
| req_url = f"{self.url}/api.php?api_key={self._api_key_name}&action=getlist" | ||
| result = requests.get(req_url) |
There was a problem hiding this comment.
Can you please use the requests.get params parameter for each of the request parameter ? This avoid longer f-string and I think it's more readable
|
Please pull the latest changes from |
497fb79 to
3a60807
Compare
|
I have pulled the latest changes, but the test is still failing. |
|
I don't think you did it correctly. You need to have this commit in your branch |
|
Should I push a commit to fix the Spamhaus error? |
|
Can you please try pulling again ? Should be solved now hopefully |
Signed-off-by: pranjalg1331 <[email protected]>
Signed-off-by: pranjalg1331 <[email protected]>
Signed-off-by: pranjalg1331 <[email protected]>
Signed-off-by: pranjalg1331 <[email protected]>
Signed-off-by: pranjalg1331 <[email protected]>
Signed-off-by: pranjalg1331 <[email protected]>
Signed-off-by: pranjalg1331 <[email protected]>
Signed-off-by: pranjalg1331 <[email protected]>
Signed-off-by: pranjalg1331 <[email protected]>
Signed-off-by: pranjalg1331 <[email protected]>
3a60807 to
43e1dd7
Compare
| def download_sample(self, h): | ||
| try: | ||
| logger.info(f"Downloading sample {h}") | ||
| download_url = f"{self.url}/api.php" |
There was a problem hiding this comment.
This is duplicated, I think we can set it as class attribute
There was a problem hiding this comment.
created base_url class attribute.
There was a problem hiding this comment.
I was thinking about having a class attribute called endpoint that has it's value to api.php.
Then, when making the request you combine self.url and self.endpoint
There was a problem hiding this comment.
Got it..Updated
Signed-off-by: pranjalg1331 <[email protected]>
|
|
||
| def download_sample(self, sample_hash: str) -> bytes: | ||
| try: | ||
| logger.info(f"Downloading sample {sample_hash}") |
There was a problem hiding this comment.
Please also write a more meaningful log here (different from run), so we can follow the execution flow during debugging.
Signed-off-by: pranjalg1331 <[email protected]>




Closes #1399
Description
Please include a summary of the change and link to the related issue.
Type of change
Please delete options that are not relevant.
Checklist
developdumpplugincommand and added it in the project as a data migration. ("How to share a plugin with the community")test_files.zipand you added the default tests for that mimetype in test_classes.py.FREE_TO_USE_ANALYZERSplaybook by following this guide.urlthat contains this information. This is required for Health Checks._monkeypatch()was used in its class to apply the necessary decorators.MockUpResponseof the_monkeypatch()method. This serves us to provide a valid sample for testing.# This file is a part of IntelOwl https://github.com/intelowlproject/IntelOwl # See the file 'LICENSE' for copying permission.Black,Flake,Isort) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.testsfolder). All the tests (new and old ones) gave 0 errors.DeepSource,Django Doctorsor other third-party linters have triggered any alerts during the CI checks, I have solved those alerts.Important Rules