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

draklib/draksh: refactored replacement for Drakvuf utilities and draksetup #824

Closed
wants to merge 42 commits into from

Conversation

psrok1
Copy link
Member

@psrok1 psrok1 commented Sep 22, 2023

During Drakvuf Sandbox debugging, I'm getting really frustrated by lack of utilities that will allow me to perform specific lower-level actions without copying long Drakvuf command line from my .bash_history.

Drakrun should help me in that process but I noticed that lots of things in this toolset has mixed responsibilities:

  • There is no common thing to run a VM and launch a sample exactly like drakrun does. In the same time drakplayground is just a bunch of duplicated code and doesn't really serve that purpose.
  • In some failure situations, draksetup leaves machine in a state that was not predicted by command creator (e.g. command is expecting machine to be running but because of failure it's actually paused/destroyed) and we need to help ourselves with drakplayground that wasn't created for that purpose. Good example is regenerating profiles with draksetup postinstall that needs drakplayground 0 to be run and then killed because VM is already destroyed.
  • Whole toolset cares about systemd services, Karton integration, importing/exporting snapshots to Minio and other things that are just bringing up more chaos to the maintenance process.

That's why I think that things need to be cleaned-up a bit. This PR introduces:

  • draklib that provides a common library and Python binding for interacting with whole machinery: networking, storage, Xen, Drakvuf toolset and configuration management. Draklib should be simple Python package that relies on native tools but doesn't install them.
  • drakshell/draksh as a CLI component that allows to both setup Drakvuf and make some lower-level actions needed during debugging or maintenance.
  • Finally drakrun would be higher-level component that integrates Drakvuf with Karton and runs analyses using draklib
  • I don't know yet what to do with all these regression testers, Debian packages and other things but I believe that they should be separate from the core thing.

As a part of this PR I would also like to experiment with "profiles" feature (I can't find better name for that right now, Request For Comments! 😄) that will allow to manage multiple VM snapshots like Win7x86, Win7x64, Win10 without moving files back and forth.

@psrok1 psrok1 mentioned this pull request Sep 22, 2023
@psrok1
Copy link
Member Author

psrok1 commented Mar 28, 2024

Well this was nice experiment, similar changes have been already included in existing codebase.

@psrok1 psrok1 closed this Mar 28, 2024
@psrok1 psrok1 deleted the refactor/draklib branch July 12, 2024 10:30
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.

1 participant