2021-10-28 06:52:43 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
}:
|
2021-01-17 00:15:33 +00:00
|
|
|
let
|
2021-10-28 06:52:43 +00:00
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
boto3 = super.boto3.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "1.17.112";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "1byqrffbgpp1mq62gnn3w3hnm54dfar0cwgvmkl7mrgbwz5xmdh8";
|
|
|
|
};
|
|
|
|
});
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
botocore = super.botocore.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "1.20.112";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "1ksdjh3mwbzgqgfj58vyrhann23b9gqam8id2svmpdmmdq5vgffh";
|
|
|
|
};
|
|
|
|
});
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
s3transfer = super.s3transfer.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.4.2";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "1cp169vz9rvng7dwbn33fgdbl3b014zpsdqsnfxxw7jm2r5jy0nb";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
dpath = super.dpath.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "1.5.0";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "06rn91n2izw7czncgql71w7acsa8wwni51njw0c6s8w4xas1arj9";
|
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
});
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
2021-01-17 00:15:33 +00:00
|
|
|
};
|
|
|
|
in
|
2021-10-28 06:52:43 +00:00
|
|
|
with py.pkgs;
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "checkov";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "2.0.672";
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bridgecrewio";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "sha256-bxJQYCAQnSOaXXczvLxdpMzlBAehgctwMNvItR6FsgM=";
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with py.pkgs; [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with py.pkgs; [
|
2021-12-06 16:07:01 +00:00
|
|
|
aiodns
|
|
|
|
aiohttp
|
|
|
|
aiomultiprocess
|
2021-01-17 00:15:33 +00:00
|
|
|
bc-python-hcl2
|
2021-10-28 06:52:43 +00:00
|
|
|
boto3
|
|
|
|
cachetools
|
|
|
|
cloudsplaining
|
2021-01-17 00:15:33 +00:00
|
|
|
colorama
|
2021-10-28 06:52:43 +00:00
|
|
|
configargparse
|
|
|
|
cyclonedx-python-lib
|
|
|
|
deep_merge
|
|
|
|
detect-secrets
|
|
|
|
docker
|
|
|
|
dockerfile-parse
|
2021-01-17 00:15:33 +00:00
|
|
|
dpath
|
|
|
|
GitPython
|
|
|
|
jmespath
|
2021-10-28 06:52:43 +00:00
|
|
|
junit-xml
|
|
|
|
networkx
|
|
|
|
packaging
|
|
|
|
policyuniverse
|
|
|
|
pyyaml
|
|
|
|
semantic-version
|
|
|
|
tabulate
|
|
|
|
termcolor
|
2021-01-17 00:15:33 +00:00
|
|
|
tqdm
|
2021-10-28 06:52:43 +00:00
|
|
|
typing-extensions
|
2021-01-17 00:15:33 +00:00
|
|
|
update_checker
|
|
|
|
];
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
checkInputs = with py.pkgs; [
|
2021-12-06 16:07:01 +00:00
|
|
|
aioresponses
|
2021-10-28 06:52:43 +00:00
|
|
|
jsonschema
|
2021-12-06 16:07:01 +00:00
|
|
|
mock
|
|
|
|
pytest-asyncio
|
|
|
|
pytest-mock
|
2021-10-28 06:52:43 +00:00
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
disabledTests = [
|
|
|
|
# No API key available
|
|
|
|
"api_key"
|
|
|
|
# Requires network access
|
|
|
|
"TestSarifReport"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Tests are pulling from external sources
|
|
|
|
# https://github.com/bridgecrewio/checkov/blob/f03a4204d291cf47e3753a02a9b8c8d805bbd1be/.github/workflows/build.yml
|
|
|
|
"integration_tests/"
|
|
|
|
"tests/terraform/"
|
2021-12-06 16:07:01 +00:00
|
|
|
# Performance tests have no value for us
|
|
|
|
"performance_tests/test_checkov_performance.py"
|
2021-10-28 06:52:43 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"checkov"
|
|
|
|
];
|
2021-01-17 00:15:33 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Static code analysis tool for infrastructure-as-code";
|
2021-10-28 06:52:43 +00:00
|
|
|
homepage = "https://github.com/bridgecrewio/checkov";
|
2021-01-17 00:15:33 +00:00
|
|
|
longDescription = ''
|
2021-10-28 06:52:43 +00:00
|
|
|
Prevent cloud misconfigurations during build-time for Terraform, Cloudformation,
|
|
|
|
Kubernetes, Serverless framework and other infrastructure-as-code-languages.
|
2021-01-17 00:15:33 +00:00
|
|
|
'';
|
|
|
|
license = licenses.asl20;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ anhdle14 fab ];
|
2021-01-17 00:15:33 +00:00
|
|
|
};
|
|
|
|
}
|