Copyright | (c) Colin Woodbury 2012 - 2020 |
---|---|
License | GPL3 |
Maintainer | Colin Woodbury <colin@fosskers.ca> |
Safe Haskell | None |
Language | Haskell2010 |
Analyse PKGBUILDs for potentially malicious bash code.
Synopsis
- data BannedTerm = BannedTerm !Text !BanCategory
- data BanCategory
- parsedPB :: Pkgbuild -> Maybe List
- bannedTerms :: List -> [(ShellCommand, BannedTerm)]
- reportExploit :: BannedTerm -> Language -> Doc AnsiStyle
Documentation
data BannedTerm Source #
A bash term which should never appear in a PKGBUILD. If one does, it's either a sign of maintainer negligence or malicious behaviour.
Instances
data BanCategory Source #
The reason why the bash term is black-listed.
Instances
Eq BanCategory Source # | |
Defined in Aura.Pkgbuild.Security (==) :: BanCategory -> BanCategory -> Bool # (/=) :: BanCategory -> BanCategory -> Bool # | |
Ord BanCategory Source # | |
Defined in Aura.Pkgbuild.Security compare :: BanCategory -> BanCategory -> Ordering # (<) :: BanCategory -> BanCategory -> Bool # (<=) :: BanCategory -> BanCategory -> Bool # (>) :: BanCategory -> BanCategory -> Bool # (>=) :: BanCategory -> BanCategory -> Bool # max :: BanCategory -> BanCategory -> BanCategory # min :: BanCategory -> BanCategory -> BanCategory # | |
Show BanCategory Source # | |
Defined in Aura.Pkgbuild.Security showsPrec :: Int -> BanCategory -> ShowS # show :: BanCategory -> String # showList :: [BanCategory] -> ShowS # |
parsedPB :: Pkgbuild -> Maybe List Source #
Attempt to parse a PKGBUILD. Should succeed for all reasonable PKGBUILDs.
bannedTerms :: List -> [(ShellCommand, BannedTerm)] Source #
Discover any banned terms lurking in a parsed PKGBUILD, paired with the surrounding context lines.
reportExploit :: BannedTerm -> Language -> Doc AnsiStyle Source #
Dispatch different error messages depending on the category of a BannedTerm
.