module Hadolint.Rule.DL3011 (rule) where import Hadolint.Rule import Language.Docker.Syntax rule :: Rule args rule :: forall args. Rule args rule = forall args. RuleCode -> DLSeverity -> Text -> (Instruction args -> Bool) -> Rule args simpleRule RuleCode code DLSeverity severity Text message forall {args}. Instruction args -> Bool check where code :: RuleCode code = RuleCode "DL3011" severity :: DLSeverity severity = DLSeverity DLErrorC message :: Text message = Text "Valid UNIX ports range from 0 to 65535" check :: Instruction args -> Bool check (Expose (Ports [Port] ports)) = forall (t :: * -> *). Foldable t => t Bool -> Bool and [Int p forall a. Ord a => a -> a -> Bool <= Int 65535 | Port Int p Protocol _ <- [Port] ports] Bool -> Bool -> Bool && forall (t :: * -> *). Foldable t => t Bool -> Bool and [Int l forall a. Ord a => a -> a -> Bool <= Int 65535 Bool -> Bool -> Bool && Int m forall a. Ord a => a -> a -> Bool <= Int 65535 | PortRange Int l Int m Protocol _ <- [Port] ports] check Instruction args _ = Bool True {-# INLINEABLE rule #-}