From ebef87de60fa2407c63ef5ed0c304d831337867f Mon Sep 17 00:00:00 2001 From: its-a-feature Date: Mon, 29 Jan 2024 13:46:44 -0800 Subject: [PATCH] update mythic-cli to remove old volume when adding 3rd party services --- Mythic_CLI/Changelog.md | 6 ++++++ Mythic_CLI/src/cmd/config/vars.go | 2 +- Mythic_CLI/src/cmd/internal/serviceMetadata.go | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Mythic_CLI/Changelog.md b/Mythic_CLI/Changelog.md index 70ba7b2e9..5ccaab799 100644 --- a/Mythic_CLI/Changelog.md +++ b/Mythic_CLI/Changelog.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 0.2.8 - 2024-01-29 + +### Changed + +- Updated the addition of 3rd party containers to remove existing volumes if they exist + ## 0.2.7 - 2024-01-29 ### Changed diff --git a/Mythic_CLI/src/cmd/config/vars.go b/Mythic_CLI/src/cmd/config/vars.go index 51153f80f..c0b9aa447 100644 --- a/Mythic_CLI/src/cmd/config/vars.go +++ b/Mythic_CLI/src/cmd/config/vars.go @@ -4,5 +4,5 @@ package config var ( // Version Mythic CLI version - Version = "v0.2.7" + Version = "v0.2.8" ) diff --git a/Mythic_CLI/src/cmd/internal/serviceMetadata.go b/Mythic_CLI/src/cmd/internal/serviceMetadata.go index 826b81114..fec928347 100644 --- a/Mythic_CLI/src/cmd/internal/serviceMetadata.go +++ b/Mythic_CLI/src/cmd/internal/serviceMetadata.go @@ -580,6 +580,8 @@ func Add3rdPartyService(service string, additionalConfigs map[string]interface{} pStruct["volumes"] = []string{ volumeName + ":/Mythic/", } + // blow away the old volume just in case to make sure we don't carry over old data + manager.GetManager().RemoveVolume(volumeName) // add our new volume to the list of volumes if needed volumes, _ := manager.GetManager().GetVolumes() volumes[volumeName] = map[string]string{