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

Open-source, document and explain the S3 plugin/integration #327

Merged
merged 6 commits into from
Feb 14, 2023

Conversation

msm-code
Copy link
Contributor

Your checklist for this pull request

  • I've read the contributing guideline.
  • I've tested my changes by building and running mquery, and testing changed functionality (if applicable)
  • I've added automated tests for my change (if applicable, optional)
  • I've updated documentation to reflect my change (if applicable)

What is the current behaviour?

No public documentation about s3 support

What is the new behaviour?

S3 support is documented. S3 plugin is open-sourced. Documentation is better.

Test plan

Literally half of the PR is a test plan guide.

Closing issues

fixes #326

@msm-code
Copy link
Contributor Author

Wow, that was a lot of words. I don't like the current s3index script, but I had to choose between "leave the user on their own and don't explain how to actually index samples" or "write a shitty script that is still better than nothing or doing it manually"

But I'm happy to announce that this PR is almost ready! Just need to re-read the code when it's not 3 AM, fix the style issues (and bugs, if any), fix alll my grammar issues, and get nazywam to review it.

@msm-code msm-code changed the title WIP on plugin refresh and s3 documentation Open-source, document and explain the S3 plugin/integration Jan 12, 2023
@msm-code msm-code marked this pull request as ready for review January 12, 2023 17:17
@msm-code msm-code mentioned this pull request Feb 9, 2023
@msm-code msm-code requested a review from nazywam February 10, 2023 14:12
docs/how-to/install-native.md Outdated Show resolved Hide resolved
docs/how-to/install-native.md Outdated Show resolved Hide resolved
docs/how-to/install-native.md Outdated Show resolved Hide resolved
docs/how-to/install-native.md Outdated Show resolved Hide resolved
docs/how-to/install-native.md Outdated Show resolved Hide resolved
@@ -0,0 +1,56 @@
# s3index.py

Can be used to index files from s3.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Can be used to index files from s3.
Can be used to index files from S3.


Can be used to index files from s3.

This script was created to accompany the [S3 integration guide](../how-to/integrate-with-s3.md). It will download files from s3 temporarily and index
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This script was created to accompany the [S3 integration guide](../how-to/integrate-with-s3.md). It will download files from s3 temporarily and index
This script was created to accompany the [S3 integration guide](../how-to/integrate-with-s3.md). It will download files from S3 temporarily and index


Only --workdir and s3-related parameters are required:

```
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
```
```shell


## Example

Only --workdir and s3-related parameters are required:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Only --workdir and s3-related parameters are required:
Only --workdir and S3-related parameters are required:

response.release_conn()
return tmp.name

def clean(self):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def clean(self):
def clean(self) -> None:

docs/how-to/integrate-with-s3.md Outdated Show resolved Hide resolved
looks at `9535be65f6d2f315971e53440e4e1` and completely ignores the path.
* Next, the plugin downloads that filename from a configured S3 bucket - in our
example, the plugin will get a file called `9535be65f6d2f315971e53440e4e1`.
* This file is used for the requested operation, like scanning with Yara,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* This file is used for the requested operation, like scanning with Yara,
* This file is used for the requested operation, like scanning with YARA,

@msm-code
Copy link
Contributor Author

Thanks for a thorough review!

@msm-code msm-code merged commit f17a874 into master Feb 14, 2023
@msm-code msm-code deleted the feature/plugin-refresh branch February 14, 2023 21:48
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.

Open-source and document the S3 plugin.
2 participants