diff --git a/src/renderer/lib/containers/docker.ts b/src/renderer/lib/containers/docker.ts index 991aba9c..670b2527 100644 --- a/src/renderer/lib/containers/docker.ts +++ b/src/renderer/lib/containers/docker.ts @@ -34,7 +34,15 @@ export class DockerContainer extends ContainerManager { fs.writeFileSync(this.composeFilePath, composeContent, { encoding: "utf-8" }); containerLogger.info(`Wrote to compose file at: ${this.composeFilePath}`); - containerLogger.info(`Compose file content: ${JSON.stringify(composeContent, null, 2)}`); + + // mask plain password + const composePassword = compose.services.windows.environment.PASSWORD ?? ""; + const maskedCompose = JSON.stringify(composeContent, null, 2).replaceAll( + composePassword, + "*****", + ); + + containerLogger.info(`Compose file content: ${maskedCompose}`); } async compose(direction: ComposeDirection): Promise { diff --git a/src/renderer/lib/containers/podman.ts b/src/renderer/lib/containers/podman.ts index a49da447..5d09dea6 100644 --- a/src/renderer/lib/containers/podman.ts +++ b/src/renderer/lib/containers/podman.ts @@ -58,7 +58,15 @@ export class PodmanContainer extends ContainerManager { fs.writeFileSync(this.composeFilePath, composeContent, { encoding: "utf-8" }); containerLogger.info(`Wrote to compose file at: ${this.composeFilePath}`); - containerLogger.info(`Compose file content: ${JSON.stringify(composeContent, null, 2)}`); + + // mask plain password + const composePassword = compose.services.windows.environment.PASSWORD ?? ""; + const maskedCompose = JSON.stringify(composeContent, null, 2).replaceAll( + composePassword, + "*****", + ); + + containerLogger.info(`Compose file content: ${maskedCompose}`); } async compose(direction: ComposeDirection): Promise { diff --git a/src/renderer/lib/winboat.ts b/src/renderer/lib/winboat.ts index 180ff78d..5a52c393 100644 --- a/src/renderer/lib/winboat.ts +++ b/src/renderer/lib/winboat.ts @@ -650,6 +650,8 @@ export class Winboat { } args = args.filter((v, _i, _a) => v.trim() !== ""); + // Remove plain password from logs + cmd = cmd.replaceAll(password, "*****"); this.appMgr?.incrementAppUsage(app); this.appMgr?.writeToDisk();