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

Protect against command jailbreaking the executor container #353

Merged
merged 2 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TesApi.Web/BatchScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ private async Task<CloudTask> ConvertTesTaskToBatchTaskAsync(string taskId, TesT
sb.AppendLinuxLine($"chmod -R o+rwx $AZ_BATCH_TASK_WORKING_DIR/wd && \\");
sb.AppendLinuxLine($"export TES_TASK_WD=$AZ_BATCH_TASK_WORKING_DIR/wd && \\");
sb.AppendLinuxLine($"write_ts ExecutorStart && \\");
sb.AppendLinuxLine($"docker run --rm {volumeMountsOption} --entrypoint= {workdirOption}{executor.Image} {executor.Command[0]} {string.Join(" ", executor.Command.Skip(1).Select(BashWrapShellArgument))} && \\");
sb.AppendLinuxLine($"docker run --rm {volumeMountsOption} --entrypoint= {workdirOption}{executor.Image} {string.Join(" ", executor.Command.Select(BashWrapShellArgument))} && \\");
sb.AppendLinuxLine($"write_ts ExecutorEnd && \\");
sb.AppendLinuxLine($"write_ts UploadStart && \\");
sb.AppendLinuxLine($"./{NodeTaskRunnerFilename} upload && \\");
Expand Down
2 changes: 1 addition & 1 deletion src/deploy-tes-on-azure/Deployer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ private static async Task<int> TestTaskAsync(string tesEndpoint, bool preemptibl
new TesExecutor()
{
Image = "ubuntu:22.04",
Command = new List<string>{"echo 'hello world'" },
Command = new List<string>{ "echo", "hello world" },
}
},
Resources = new TesResources()
Expand Down
2 changes: 0 additions & 2 deletions src/deploy-tes-on-azure/deploy-tes-on-azure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
<EmbeddedResource Include="scripts\env-01-account-names.txt" />
<EmbeddedResource Include="scripts\env-02-internal-images.txt" />
<EmbeddedResource Include="scripts\env-04-settings.txt" />
<EmbeddedResource Include="test.wdl" />
<EmbeddedResource Include="testInputs.json" />
<Content Update="samples\config.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
21 changes: 0 additions & 21 deletions src/deploy-tes-on-azure/test.wdl

This file was deleted.

4 changes: 0 additions & 4 deletions src/deploy-tes-on-azure/testInputs.json

This file was deleted.