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
|
|
|
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
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
jsonschema = super.jsonschema.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "3.2.0";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "sha256-yKhbKNN3zHc35G4tnytPRO48Dh3qxr9G3e/HGH0weXo=";
|
|
|
|
};
|
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
doCheck = false;
|
|
|
|
});
|
|
|
|
|
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";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "2.1.5";
|
2022-06-16 17:23:12 +00:00
|
|
|
format = "setuptools";
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bridgecrewio";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-06-26 10:26:21 +00:00
|
|
|
hash = "sha256-bH7W+GZ4O32ty5YD4hfKz2R10v7zEJLU1kLzKvdx3E4=";
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with py.pkgs; [
|
2022-06-16 17:23:12 +00:00
|
|
|
pythonRelaxDepsHook
|
2021-10-28 06:52:43 +00:00
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with py.pkgs; [
|
2021-12-06 16:07:01 +00:00
|
|
|
aiodns
|
|
|
|
aiohttp
|
|
|
|
aiomultiprocess
|
2021-12-30 13:39:12 +00:00
|
|
|
argcomplete
|
2021-01-17 00:15:33 +00:00
|
|
|
bc-python-hcl2
|
2021-10-28 06:52:43 +00:00
|
|
|
boto3
|
|
|
|
cachetools
|
2022-03-30 09:31:56 +00:00
|
|
|
charset-normalizer
|
2021-10-28 06:52:43 +00:00
|
|
|
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
|
2022-06-16 17:23:12 +00:00
|
|
|
flake8
|
2021-01-17 00:15:33 +00:00
|
|
|
GitPython
|
|
|
|
jmespath
|
2022-01-13 20:06:32 +00:00
|
|
|
jsonpath-ng
|
|
|
|
jsonschema
|
2021-10-28 06:52:43 +00:00
|
|
|
junit-xml
|
|
|
|
networkx
|
|
|
|
packaging
|
|
|
|
policyuniverse
|
2022-01-26 04:04:25 +00:00
|
|
|
prettytable
|
2022-03-10 19:12:11 +00:00
|
|
|
pycep-parser
|
2021-10-28 06:52:43 +00:00
|
|
|
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
|
|
|
|
mock
|
|
|
|
pytest-asyncio
|
|
|
|
pytest-mock
|
2021-10-28 06:52:43 +00:00
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
2022-04-27 09:35:20 +00:00
|
|
|
responses
|
2021-10-28 06:52:43 +00:00
|
|
|
];
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"bc-python-hcl2"
|
|
|
|
"pycep-parser"
|
|
|
|
];
|
2022-01-26 04:04:25 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
2022-01-13 20:06:32 +00:00
|
|
|
'';
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
disabledTests = [
|
|
|
|
# No API key available
|
|
|
|
"api_key"
|
|
|
|
# Requires network access
|
|
|
|
"TestSarifReport"
|
2022-01-13 20:06:32 +00:00
|
|
|
# Will probably be fixed in one of the next releases
|
|
|
|
"test_valid_cyclonedx_bom"
|
2022-03-05 16:20:37 +00:00
|
|
|
"test_record_relative_path_with"
|
|
|
|
"test_record_relative_path_with_relative_dir"
|
2022-01-26 04:04:25 +00:00
|
|
|
# Requires prettytable release which is only available in staging
|
|
|
|
"test_skipped_check_exists"
|
2022-03-05 16:20:37 +00:00
|
|
|
# AssertionError: 0 not greater than 0
|
|
|
|
"test_skip_mapping_default"
|
2022-04-15 01:41:22 +00:00
|
|
|
# Test is failing
|
|
|
|
"test_SQLServerAuditingEnabled"
|
2021-10-28 06:52:43 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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"
|
2022-01-26 04:04:25 +00:00
|
|
|
# Requires prettytable release which is only available in staging
|
|
|
|
"tests/sca_package/"
|
|
|
|
"tests/test_runner_filter.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
|
|
|
};
|
|
|
|
}
|