nixpkgs/pkgs/development/tools/analysis/checkov/default.nix

137 lines
3.2 KiB
Nix
Raw Normal View History

2021-10-19 23:12:09 +01:00
{ lib
, fetchFromGitHub
, python3
}:
2020-12-16 13:39:57 +00:00
let
2021-10-19 23:12:09 +01:00
py = python3.override {
packageOverrides = self: super: {
2020-12-16 13:39:57 +00:00
2021-10-19 23:12:09 +01:00
boto3 = super.boto3.overridePythonAttrs (oldAttrs: rec {
version = "1.17.112";
src = oldAttrs.src.override {
inherit version;
sha256 = "1byqrffbgpp1mq62gnn3w3hnm54dfar0cwgvmkl7mrgbwz5xmdh8";
};
});
2020-12-16 13:39:57 +00:00
2021-10-19 23:12:09 +01:00
botocore = super.botocore.overridePythonAttrs (oldAttrs: rec {
version = "1.20.112";
src = oldAttrs.src.override {
inherit version;
sha256 = "1ksdjh3mwbzgqgfj58vyrhann23b9gqam8id2svmpdmmdq5vgffh";
};
});
2020-12-16 13:39:57 +00:00
2021-10-19 23:12:09 +01: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;
});
2020-12-16 13:39:57 +00:00
2021-10-30 22:46:16 +01:00
cyclonedx-python-lib = super.cyclonedx-python-lib.overridePythonAttrs (oldAttrs: rec {
version = "0.6.2";
src = fetchFromGitHub {
owner = "CycloneDX";
repo = "cyclonedx-python-lib";
rev = "v${version}";
sha256 = "10cmp2aqbnbiyrsq5r9p7ppghqj3zyg612d2dldk6m85li3jr500";
};
});
2021-10-19 23:12:09 +01:00
};
2020-12-16 13:39:57 +00:00
};
in
2021-10-19 23:12:09 +01:00
with py.pkgs;
buildPythonApplication rec {
pname = "checkov";
2021-11-14 10:42:21 +00:00
version = "2.0.571";
2020-12-16 13:39:57 +00:00
2021-10-19 23:12:09 +01:00
src = fetchFromGitHub {
owner = "bridgecrewio";
repo = pname;
rev = version;
2021-11-14 10:42:21 +00:00
sha256 = "sha256-cmSZHqR1BfVWXoUSJ3Et5TTdeUWklNA4egKLP4xKjw8=";
2021-10-19 23:12:09 +01:00
};
nativeBuildInputs = with py.pkgs; [
setuptools-scm
];
propagatedBuildInputs = with py.pkgs; [
2020-12-16 13:39:57 +00:00
bc-python-hcl2
2021-10-19 23:12:09 +01:00
boto3
cachetools
cloudsplaining
2020-12-16 13:39:57 +00:00
colorama
2021-10-19 23:12:09 +01:00
configargparse
cyclonedx-python-lib
deep_merge
detect-secrets
docker
dockerfile-parse
2020-12-16 13:39:57 +00:00
dpath
GitPython
jmespath
2021-10-19 23:12:09 +01:00
junit-xml
networkx
packaging
policyuniverse
pyyaml
semantic-version
tabulate
termcolor
2020-12-16 13:39:57 +00:00
tqdm
2021-10-19 23:12:09 +01:00
typing-extensions
2020-12-16 13:39:57 +00:00
update_checker
];
2021-10-19 23:12:09 +01:00
checkInputs = with py.pkgs; [
jsonschema
pytest-xdist
pytestCheckHook
];
2020-12-16 13:39:57 +00:00
2021-10-19 23:12:09 +01: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-11-14 10:42:21 +00:00
# Performance tests have no value for us
"performance_tests/test_checkov_performance.py"
2021-10-19 23:12:09 +01:00
];
pythonImportsCheck = [
"checkov"
];
2020-12-16 13:39:57 +00:00
meta = with lib; {
description = "Static code analysis tool for infrastructure-as-code";
2021-10-19 23:12:09 +01:00
homepage = "https://github.com/bridgecrewio/checkov";
2020-12-16 13:39:57 +00:00
longDescription = ''
2021-10-19 23:12:09 +01:00
Prevent cloud misconfigurations during build-time for Terraform, Cloudformation,
Kubernetes, Serverless framework and other infrastructure-as-code-languages.
2020-12-16 13:39:57 +00:00
'';
license = licenses.asl20;
2021-11-14 10:42:21 +00:00
maintainers = with maintainers; [ anhdle14 fab ];
2020-12-16 13:39:57 +00:00
};
}