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

Registry plugins spread across directories. Needs standardization #1471

Open
atcuno opened this issue Dec 27, 2024 · 4 comments
Open

Registry plugins spread across directories. Needs standardization #1471

atcuno opened this issue Dec 27, 2024 · 4 comments
Assignees

Comments

@atcuno
Copy link
Contributor

atcuno commented Dec 27, 2024

We have a sub directory 'registry' under framework/plugins/windows that holds two registry related plugins.

We then have amcache (https://github.com/volatilityfoundation/volatility3/blob/develop/volatility3/framework/plugins/windows/amcache.py), cachedump (https://github.com/volatilityfoundation/volatility3/blob/develop/volatility3/framework/plugins/windows/cachedump.py), lsadump (https://github.com/volatilityfoundation/volatility3/blob/b1a42d9510046377a426d62f7cbde1ce1a4ad528/volatility3/framework/plugins/windows/lsadump.py), hashdump (

def get_hive_key(cls, hive: registry.RegistryHive, key: str):
), and maybe others which use the registry, outside the folder.

There are 20+ new and useful plugins that can be written that target the registry, and I was talking to some college students about them as an easy intro to learning the framework - but then I realized we have plugins in multiple places and need to standardize this before it gets worse and before parity.

@ikelos @superponible - I assume these should all be under registry? What needs to happen version wise when we move plugins? These plugins also triggered many bugs in mass testing so we need to get them moved rather quickly so the bugs can be then be patched also.

@atcuno atcuno changed the title Registry plugins spread across directories. Needs standarization Registry plugins spread across directories. Needs standardization Dec 27, 2024
@ikelos
Copy link
Member

ikelos commented Dec 30, 2024

Generally plugins that are specifically designed to act upon the registry, should live under the registry group (it was supposed to be an example of how we could categorize plugins, but then no one ever really did it with any of the other plugins). As to moving a plugin, I guess you leave a class that inherits under the old name, but with a deprecation warning? Then two or three releases later (after people are using the new one), we can ditch the old one. Since it's a new plugin, technically it can have its version bumped back to 1.0.0, but I might leave it at whatever it's at for simplicity? All core plugins should be updated to use the new one (not the deprecated one). Does that answer all the corner cases, or have I missed some?

@atcuno
Copy link
Contributor Author

atcuno commented Dec 30, 2024

That sounds good. I was make sure the test cases are valid for the new ones.

As for the deprecation -- if the current file inherits from the new file under registry/, where would the deprecation warning go.?I assume we want it in run(), so would the existing file override run to be the same except adding the warning?

@ikelos
Copy link
Member

ikelos commented Dec 30, 2024

Yeah, basically run would be:

def run(self, *args, **kwargs):
    warnings.warn(DeprecationWarning('This plugin is now called BLAH'))
    return super().run(*args, **kwargs)

@ikelos
Copy link
Member

ikelos commented Dec 30, 2024

Actually, thinking about it, we probably want it under __getattr__ or something, so that class methods would get caught? warning.warn would ensure the warning's only issued once, but just so we get visibility over dependencies. We'd probably need to leave out get_requirements but otherwise...

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

3 participants