2021-10-28 06:52:43 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
}:
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
let
|
2021-10-28 06:52:43 +00:00
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
2023-04-12 12:48:02 +00:00
|
|
|
cyclonedx-python-lib = super.cyclonedx-python-lib.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "2.7.1";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CycloneDX";
|
|
|
|
repo = "cyclonedx-python-lib";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-c/KhoJOa121/h0n0GUazjUFChnUo05ThD+fuZXc5/Pk=";
|
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";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "2.5.14";
|
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;
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-4F8cGcQJy8cbCE0wxM6B4qGjuc+SjeL7DMr6RdSkXBM=";
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
patches = [
|
|
|
|
./flake8-compat-5.x.patch
|
|
|
|
];
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
pythonRelaxDeps = [
|
2023-04-12 12:48:02 +00:00
|
|
|
"bc-detect-secrets"
|
2023-03-15 16:39:30 +00:00
|
|
|
"bc-python-hcl2"
|
2023-07-15 17:15:38 +00:00
|
|
|
"dpath"
|
|
|
|
"license-expression"
|
2023-03-15 16:39:30 +00:00
|
|
|
"networkx"
|
2023-07-15 17:15:38 +00:00
|
|
|
"pycep-parser"
|
2023-03-15 16:39:30 +00:00
|
|
|
];
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
nativeBuildInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
pythonRelaxDepsHook
|
2021-10-28 06:52:43 +00:00
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
aiodns
|
|
|
|
aiohttp
|
|
|
|
aiomultiprocess
|
2021-12-30 13:39:12 +00:00
|
|
|
argcomplete
|
2023-03-15 16:39:30 +00:00
|
|
|
bc-detect-secrets
|
|
|
|
bc-jsonpath-ng
|
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
|
|
|
|
docker
|
|
|
|
dockerfile-parse
|
2021-01-17 00:15:33 +00:00
|
|
|
dpath
|
2022-06-16 17:23:12 +00:00
|
|
|
flake8
|
2022-12-17 10:02:37 +00:00
|
|
|
gitpython
|
2023-03-15 16:39:30 +00:00
|
|
|
igraph
|
2021-01-17 00:15:33 +00:00
|
|
|
jmespath
|
2022-01-13 20:06:32 +00:00
|
|
|
jsonschema
|
2021-10-28 06:52:43 +00:00
|
|
|
junit-xml
|
2023-05-24 13:37:59 +00:00
|
|
|
license-expression
|
2021-10-28 06:52:43 +00:00
|
|
|
networkx
|
2023-04-12 12:48:02 +00:00
|
|
|
openai
|
2021-10-28 06:52:43 +00:00
|
|
|
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
|
2023-10-09 19:29:22 +00:00
|
|
|
rustworkx
|
2021-10-28 06:52:43 +00:00
|
|
|
semantic-version
|
2023-05-24 13:37:59 +00:00
|
|
|
spdx-tools
|
2021-10-28 06:52:43 +00:00
|
|
|
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
|
|
|
|
];
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
nativeCheckInputs = [
|
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-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-03-05 16:20:37 +00:00
|
|
|
"test_skip_mapping_default"
|
2023-03-15 16:39:30 +00:00
|
|
|
# Flake8 test
|
|
|
|
"test_file_with_class"
|
|
|
|
"test_dataclass_skip"
|
|
|
|
"test_typing_class_skip"
|
|
|
|
# Tests are comparing console output
|
|
|
|
"cli"
|
|
|
|
"console"
|
2023-04-29 16:46:19 +00:00
|
|
|
# Starting to fail after 2.3.205
|
|
|
|
"test_non_multiline_pair"
|
2023-05-24 13:37:59 +00:00
|
|
|
"test_secret_value_in_keyword"
|
|
|
|
"test_runner_verify_secrets_skip_invalid_suppressed"
|
|
|
|
"test_runner_verify_secrets_skip_all_no_effect"
|
|
|
|
"test_runner"
|
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/"
|
2023-03-15 16:39:30 +00:00
|
|
|
"tests/ansible/"
|
|
|
|
"tests/arm/"
|
|
|
|
"tests/bicep/"
|
|
|
|
"tests/cloudformation/"
|
|
|
|
"tests/common/"
|
|
|
|
"tests/dockerfile/"
|
|
|
|
"tests/generic_json/"
|
|
|
|
"tests/generic_yaml/"
|
|
|
|
"tests/github_actions/"
|
|
|
|
"tests/github/"
|
|
|
|
"tests/kubernetes/"
|
|
|
|
"tests/sca_package_2"
|
2021-10-28 06:52:43 +00:00
|
|
|
"tests/terraform/"
|
2021-12-06 16:07:01 +00:00
|
|
|
# Performance tests have no value for us
|
|
|
|
"performance_tests/test_checkov_performance.py"
|
2023-03-15 16:39:30 +00:00
|
|
|
# No Helm
|
|
|
|
"dogfood_tests/test_checkov_dogfood.py"
|
2021-10-28 06:52:43 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"checkov"
|
|
|
|
];
|
2021-01-17 00:15:33 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
postInstall = ''
|
|
|
|
chmod +x $out/bin/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";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/bridgecrewio/checkov/releases/tag/${version}";
|
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
|
|
|
};
|
|
|
|
}
|