2020-01-15 19:48:33 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, isPy37
|
|
|
|
, lib
|
|
|
|
|
|
|
|
# pythonPackages
|
|
|
|
, aiohttp
|
|
|
|
, androguard
|
|
|
|
, azure-identity
|
2020-02-22 20:45:16 +00:00
|
|
|
, azure-keyvault
|
2020-01-15 19:48:33 +00:00
|
|
|
, azure-mgmt-compute
|
|
|
|
, azure-mgmt-keyvault
|
|
|
|
, azure-mgmt-network
|
2020-01-24 03:09:41 +00:00
|
|
|
, azure-mgmt-resource
|
|
|
|
, azure-mgmt-security
|
2020-01-15 19:48:33 +00:00
|
|
|
, azure-mgmt-storage
|
2020-02-22 20:45:16 +00:00
|
|
|
, azure-mgmt-sql
|
2020-01-15 19:48:33 +00:00
|
|
|
, azure-mgmt-web
|
2020-02-22 20:45:16 +00:00
|
|
|
, azure-storage
|
2020-01-15 19:48:33 +00:00
|
|
|
, bandit
|
|
|
|
, bcrypt
|
|
|
|
, beautifulsoup4
|
|
|
|
, boto3
|
|
|
|
, cfn-flip
|
|
|
|
, cython
|
|
|
|
, dnspython
|
|
|
|
, colorama
|
|
|
|
, configobj
|
|
|
|
, defusedxml
|
|
|
|
, GitPython
|
|
|
|
, google_api_python_client
|
|
|
|
, kubernetes
|
|
|
|
, ldap3
|
|
|
|
, mixpanel
|
|
|
|
, mysql-connector
|
|
|
|
, names
|
|
|
|
, ntplib
|
|
|
|
, oyaml
|
|
|
|
, paramiko
|
|
|
|
, pillow
|
|
|
|
, psycopg2
|
|
|
|
, pycrypto
|
|
|
|
, pygments
|
2020-01-24 03:09:41 +00:00
|
|
|
, pyhcl
|
2020-01-15 19:48:33 +00:00
|
|
|
, pyjks
|
|
|
|
, pynacl
|
2020-02-22 20:45:16 +00:00
|
|
|
, pyodbc
|
2020-01-15 19:48:33 +00:00
|
|
|
, pyopenssl
|
|
|
|
, pypdf2
|
|
|
|
, pysmb
|
2020-02-22 20:45:16 +00:00
|
|
|
, pytesseract
|
2020-01-15 19:48:33 +00:00
|
|
|
, python_magic
|
|
|
|
, pytz
|
2020-02-22 20:45:16 +00:00
|
|
|
, pywinrm
|
2020-01-15 19:48:33 +00:00
|
|
|
, requirements-detector
|
|
|
|
, selenium
|
|
|
|
, tlslite-ng
|
|
|
|
, viewstate
|
|
|
|
|
|
|
|
# pythonPackages to test the derivation
|
|
|
|
, pytest
|
2020-02-22 20:45:16 +00:00
|
|
|
, flask
|
|
|
|
, flask-httpauth
|
|
|
|
, docker
|
2020-01-15 19:48:33 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "fluidasserts";
|
2020-02-22 20:45:16 +00:00
|
|
|
version = "20.2.30165";
|
2020-01-15 19:48:33 +00:00
|
|
|
disabled = !isPy37;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-02-22 20:45:16 +00:00
|
|
|
sha256 = "0wcplzfx89d3c6hvdgag860sl3infqmymy6ly6y6ah77pkc98x15";
|
2020-01-15 19:48:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
2020-02-22 20:45:16 +00:00
|
|
|
# Release packages from their hard pinned versions
|
|
|
|
sed -i -E "s/(.*)==.*/\1/g" requirements.txt
|
2020-01-15 19:48:33 +00:00
|
|
|
|
|
|
|
# Functionality that will be not present for the momment
|
|
|
|
# but that we'll work to add in the future
|
|
|
|
# Just a minimal portion of fluidasserts use this
|
2020-02-22 20:45:16 +00:00
|
|
|
substituteInPlace ./requirements.txt \
|
|
|
|
--replace "mitmproxy" "" \
|
2020-01-15 19:48:33 +00:00
|
|
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
# pythonPackages
|
|
|
|
aiohttp
|
|
|
|
androguard
|
|
|
|
azure-identity
|
2020-02-22 20:45:16 +00:00
|
|
|
azure-keyvault
|
2020-01-15 19:48:33 +00:00
|
|
|
azure-mgmt-compute
|
|
|
|
azure-mgmt-keyvault
|
|
|
|
azure-mgmt-network
|
2020-01-24 03:09:41 +00:00
|
|
|
azure-mgmt-resource
|
|
|
|
azure-mgmt-security
|
2020-01-15 19:48:33 +00:00
|
|
|
azure-mgmt-storage
|
2020-02-22 20:45:16 +00:00
|
|
|
azure-mgmt-sql
|
2020-01-15 19:48:33 +00:00
|
|
|
azure-mgmt-web
|
2020-02-22 20:45:16 +00:00
|
|
|
azure-storage
|
2020-01-15 19:48:33 +00:00
|
|
|
bandit
|
|
|
|
bcrypt
|
|
|
|
beautifulsoup4
|
|
|
|
boto3
|
|
|
|
cfn-flip
|
|
|
|
cython
|
|
|
|
dnspython
|
|
|
|
colorama
|
|
|
|
configobj
|
|
|
|
defusedxml
|
|
|
|
GitPython
|
|
|
|
google_api_python_client
|
|
|
|
kubernetes
|
|
|
|
ldap3
|
|
|
|
mixpanel
|
|
|
|
mysql-connector
|
|
|
|
names
|
|
|
|
ntplib
|
|
|
|
oyaml
|
|
|
|
paramiko
|
|
|
|
pillow
|
|
|
|
psycopg2
|
|
|
|
pycrypto
|
|
|
|
pygments
|
2020-01-24 03:09:41 +00:00
|
|
|
pyhcl
|
2020-01-15 19:48:33 +00:00
|
|
|
pyjks
|
|
|
|
pynacl
|
2020-02-22 20:45:16 +00:00
|
|
|
pyodbc
|
2020-01-15 19:48:33 +00:00
|
|
|
pyopenssl
|
|
|
|
pypdf2
|
|
|
|
pysmb
|
2020-02-22 20:45:16 +00:00
|
|
|
pytesseract
|
2020-01-15 19:48:33 +00:00
|
|
|
python_magic
|
|
|
|
pytz
|
2020-02-22 20:45:16 +00:00
|
|
|
pywinrm
|
2020-01-15 19:48:33 +00:00
|
|
|
requirements-detector
|
|
|
|
selenium
|
|
|
|
tlslite-ng
|
|
|
|
viewstate
|
|
|
|
];
|
|
|
|
|
2020-02-22 20:45:16 +00:00
|
|
|
configurePhase = ''
|
|
|
|
mkdir -p build/config
|
|
|
|
touch build/config/README.rst
|
|
|
|
'';
|
|
|
|
|
2020-01-15 19:48:33 +00:00
|
|
|
checkInputs = [
|
2020-02-22 20:45:16 +00:00
|
|
|
docker
|
|
|
|
flask
|
|
|
|
flask-httpauth
|
2020-01-15 19:48:33 +00:00
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
2020-02-22 20:45:16 +00:00
|
|
|
# This tests require BWAPP Docker Container
|
|
|
|
sed -ie 's/test_a[0-9]//g' ./test/test_proto_http_open.py
|
|
|
|
sed -ie 's/test_a[0-9]//g' ./test/test_proto_http_close.py
|
|
|
|
|
|
|
|
# This tests require network connectivity
|
|
|
|
sed -ie 's/test_is_date_unsyncd//g' ./test/test_proto_http_open.py
|
|
|
|
sed -ie 's/test_is_date_unsyncd//g' ./test/test_proto_http_close.py
|
|
|
|
|
|
|
|
# Remove impurities
|
|
|
|
substituteInPlace ./test/conftest.py \
|
|
|
|
--replace "import wait" "" \
|
|
|
|
--replace "if not os.path.exists(name):" "if os.path.exists(name):" \
|
|
|
|
--replace "from test.mock import graphql_server" "" \
|
|
|
|
--replace "(graphql_server.start, 'MockGraphQLServer', ['proto_graphql'])," "" \
|
|
|
|
|
|
|
|
pytest --asserts-module 'iot' \
|
|
|
|
test/test_iot_phone.py
|
|
|
|
|
|
|
|
pytest --asserts-module 'ot' \
|
|
|
|
test/test_ot_powerlogic.py
|
|
|
|
|
|
|
|
pytest --asserts-module 'proto_http' \
|
|
|
|
test/test_proto_{http_close,http_open}.py
|
|
|
|
|
|
|
|
pytest --asserts-module 'proto_rest' \
|
|
|
|
test/test_proto_rest.py
|
|
|
|
|
2020-01-15 19:48:33 +00:00
|
|
|
# This file launches mock docker containers and servers
|
|
|
|
# let's remove it to create a custom test environment
|
|
|
|
rm test/conftest.py
|
|
|
|
|
|
|
|
pytest \
|
2020-02-22 20:45:16 +00:00
|
|
|
test/test_cloud_aws_terraform_{cloudfront,dynamodb,ebs,ec2,elb}.py \
|
|
|
|
test/test_cloud_aws_terraform_{fsx,iam,kms,rds,s3}.py \
|
2020-01-20 15:46:33 +00:00
|
|
|
test/test_cloud_aws_cloudformation_{cloudfront,dynamodb,ec2,elb,elb2}.py \
|
|
|
|
test/test_cloud_aws_cloudformation_{fsx,iam,kms,rds,s3,secretsmanager}.py \
|
2020-01-24 03:09:41 +00:00
|
|
|
test/test_format_{apk,jks,jwt,pdf,pkcs12,string}.py \
|
2020-01-20 15:46:33 +00:00
|
|
|
test/test_helper_{asynchronous,crypto}.py \
|
|
|
|
test/test_lang_{javascript,java}.py \
|
|
|
|
test/test_lang_{core,csharp,docker,dotnetconfig,html,php,python,rpgle}.py \
|
|
|
|
test/test_utils_generic.py
|
2020-01-15 19:48:33 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Assertion Library for Security Assumptions";
|
|
|
|
homepage = "https://gitlab.com/fluidattacks/asserts";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [
|
|
|
|
kamadorueda
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|