Skip to content

Commit

Permalink
Restrict Docker image regex
Browse files Browse the repository at this point in the history
Fixes Azure#5259.
  • Loading branch information
onalante-msft committed Sep 3, 2021
1 parent 5288a27 commit d29bd07
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.Azure.Devices.Edge.Agent.Docker
public class DockerConfig : IEquatable<DockerConfig>
{
// This is not the actual docker image regex, but a less strict version.
const string ImageRegexPattern = @"^(?<repo>([^/]*/)*)(?<image>[^/:]+)(?<tag>:[^/:]+)?$";
const string ImageRegexPattern = @"^(?<repo>([^/]*/)*)(?<image>[^@/:]+)(?<tag>(:[^@/:]+)|(@sha256:[^@/:]+))?$";
static readonly Regex ImageRegex = new Regex(ImageRegexPattern);
readonly CreateContainerParameters createOptions;

Expand Down

0 comments on commit d29bd07

Please sign in to comment.