{ "info": { "author": "Karik Isichei", "author_email": "karik.isichei@digital.justice.gov.uk", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# IAM Builder\n\n[![Actions Status](https://github.com/moj-analytical-services/iam_builder/workflows/IAM%20Builder/badge.svg)](https://github.com/moj-analytical-services/iam_builder/actions)\n\nA python script to generate an IAM policy based on an yaml or json configuration.\n\nTo install:\n\n```\n# Most stable\npip install iam-builder\n\n# OR directly from github\npip install git+git://github.com/moj-analytical-services/iam_builder.git#egg=iam_builder\n```\n\nTo use the command line interface:\n\n```\niam_builder -c examples/iam_config.yaml -o examples/iam_policy.json\n```\n\n- `-c` is the path to your iam configuration (either a yaml or json file).\n- `-o` is the path to your output iam policy (needs to be a json file).\n\nOr to do the same thing in python:\n\n```python\nimport yaml\nimport json\nfrom iam_builder.iam_builder import build_iam_policy\n\nwith open('examples/iam_config.yaml') as f:\n config = yaml.load(f, Loader=yaml.FullLoader)\n\niam_policy = build_iam_policy(config)\n\nwith open('examples/iam_policy.json', \"w+\") as f:\n json.dump(iam_policy, f, indent=4, separators=(',', ': '))\n```\n\nBoth scripts will create the output iam_policy seen in the [examples](examples/) folder. You can also see [more example configs](tests/test_config/) by looking in the unit tests.\n\nYour config file can be either a yaml or json file.\n\nThe example yaml (`iam_config.yaml`) looks this:\n\n```yaml\niam_role_name: iam_role_name\n\nathena:\n write: false\n\nglue_job: true\n\nsecrets: true\n\ns3: \n read_only:\n - test_bucket_read_only/*\n\n write_only:\n - test_bucket_write_only/*\n - test_bucket_read_only/write_only_folder/*\n\n read_write:\n - test_bucket_read_write/*\n - test_bucket_read_only/write_folder/*\n```\n\nWhilst the example json (`iam_config.json`) looks like this:\n\n```json\n{\n \"iam_role_name\": \"iam_role_name\",\n \"athena\": {\n \"write\": false\n },\n \"glue_job\": true,\n \"secrets\": true,\n \"s3\": {\n \"read_only\": [\n \"test_bucket_read_only/*\"\n ],\n \"write_only\": [\n \"test_bucket_write_only/*\",\n \"test_bucket_read_only/write_only_folder/*\"\n ],\n \"read_write\": [\n \"test_bucket_read_write/*\",\n \"test_bucket_read_only/write_folder/*\"\n ]\n }\n}\n```\n- **iam_role_name:** The role name of your airflow job; required if you want to run glue jobs or access secrets.\n\n- **athena:** Only has one key value pair. `write` which is either true or false. If `false` then only read access to Athena (cannot create, delete or alter tables, databases and partitions). If `true` then the role will also have the ability to do stuff like CTAS queries, `DROP TABLE`, `CREATE DATABASE`, etc.\n\n- **glue_job:** Boolean; must be set to `true` to allow role to run glue jobs. If `false` or absent role will not be able to run glue jobs.\n\n- **secrets:** Boolean; must be set to `true` to allow role to access secrets from AWS Parameter Store. If `false` or absent role will not be able to access secrets.\n\n- **s3:** Can have up to 3 keys: `read_only`, `write_only` and `read_write`. Each key describes the level of access you want your iam policy to have with each s3 path. More details below:\n \n - **read_only:** A list of s3 paths that the iam_role should be able to access (read only). Each item in the list should either be a path to a object or finish with `/*` to denote that it can access everything within that directory. _Note the S3 paths don't start with `s3://` in the config._\n\n - **write_only:** A list of s3 paths that the iam_role should be able to access (write only). Each item in the list should either be a path to a object or finish with `/*` to denote that it can access everything within that directory. _Note the S3 paths don't start with `s3://` in the config._\n\n - **read_write_s3_access:** A list of s3 paths that the iam_role should be able to access (read and write). Each item in the list should either be a path to a object or finish with `/*` to denote that it can access everything within that directory. _Note the S3 paths don't start with `s3://` in the config._\n \n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT", "maintainer": "Karik Isichei", "maintainer_email": "karik.isichei@digital.justice.gov.uk", "name": "iam-builder", "package_url": "https://pypi.org/project/iam-builder/", "platform": "", "project_url": "https://pypi.org/project/iam-builder/", "project_urls": null, "release_url": "https://pypi.org/project/iam-builder/3.2.0/", "requires_dist": [ "PyYAML (>=5.1,<6.0)", "parameterized (>=0.6,<0.7)" ], "requires_python": ">=3.5,<4.0", "summary": "A lil python package to generate iam policies", "version": "3.2.0" }, "last_serial": 5841617, "releases": { "1.2.1": [ { "comment_text": "", "digests": { "md5": "ff90c7217cd1f4843062826b524a091b", "sha256": "afe51ccf32b48914b5a017da5b1318df338a29701680a5cddfafcddcb6b9c1e6" }, "downloads": -1, "filename": "iam_builder-1.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ff90c7217cd1f4843062826b524a091b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 5327, "upload_time": "2019-06-06T15:41:19", "url": "https://files.pythonhosted.org/packages/44/a4/066e5927a5956a83fd51843c55af4cc603f54d100249d98198c8e478ab1a/iam_builder-1.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "802432e991f75802577adeab4ca31639", "sha256": "85b34e6a576df89360a7987cf1d5209e723b8712792241738eb3857c7bf777d8" }, "downloads": -1, "filename": "iam_builder-1.2.1.tar.gz", "has_sig": false, "md5_digest": "802432e991f75802577adeab4ca31639", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 4659, "upload_time": "2019-06-06T15:41:21", "url": "https://files.pythonhosted.org/packages/29/40/1d704ecfde90c8139b0a0d23b182c3a54da6e4d11d5c66a85eed3065f347/iam_builder-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "c6c07706a20b280a3a8d0df2182d9791", "sha256": "9c18f6be41704096c0012123e3fec546e4ea5d558701bf81dd357a28f7deda35" }, "downloads": -1, "filename": "iam_builder-1.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c6c07706a20b280a3a8d0df2182d9791", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 5328, "upload_time": "2019-06-06T15:48:35", "url": "https://files.pythonhosted.org/packages/69/fb/55f9e88f1ca8f05ae6fe4fd4d39d80c0847cc513147a595f60f60f76786d/iam_builder-1.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f9078470e9e2a95f8a5ee4487825e7b2", "sha256": "d213a90019b610f75d516453cbe0bc5761f7f871e29d0eec35b2fe42099c5629" }, "downloads": -1, "filename": "iam_builder-1.2.2.tar.gz", "has_sig": false, "md5_digest": "f9078470e9e2a95f8a5ee4487825e7b2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 4660, "upload_time": "2019-06-06T15:48:36", "url": "https://files.pythonhosted.org/packages/71/75/eb346814e8adf7ffb5b91e043657094edfb57a85873c3c97572ff391f848/iam_builder-1.2.2.tar.gz" } ], "1.2.3": [ { "comment_text": "", "digests": { "md5": "240aba6f0fd031c3ebe92a4649ac0e66", "sha256": "d9e220fabbd20efb321f9ee36db396f9f66b2fad71242e2bbc199a0fee1d1d99" }, "downloads": -1, "filename": "iam_builder-1.2.3-py3-none-any.whl", "has_sig": false, "md5_digest": "240aba6f0fd031c3ebe92a4649ac0e66", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 6280, "upload_time": "2019-06-21T14:26:01", "url": "https://files.pythonhosted.org/packages/13/cd/92661f7ef117b32669a78bd02e6430c6c722336a97c033908a8398b5f410/iam_builder-1.2.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c80df37f9aabedddb8d59e61859ae7c", "sha256": "e78385b7bce59f2742fc8040b87baf5656db8239bb007d1226c88b05589818f1" }, "downloads": -1, "filename": "iam_builder-1.2.3.tar.gz", "has_sig": false, "md5_digest": "8c80df37f9aabedddb8d59e61859ae7c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 5118, "upload_time": "2019-06-21T14:26:03", "url": "https://files.pythonhosted.org/packages/06/77/f272c37a25d3d21b5b2da1b43cbf03738136de5d139d52ddde2419b980ab/iam_builder-1.2.3.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "75ec3d746a454e9cce22dc3009f96ff6", "sha256": "16d1cd65e9886d20ba75bd865e8b5cf280c73fd765ea1d7a54acc15564237678" }, "downloads": -1, "filename": "iam_builder-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "75ec3d746a454e9cce22dc3009f96ff6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 6352, "upload_time": "2019-07-03T10:48:18", "url": "https://files.pythonhosted.org/packages/ee/e2/5f58c8470941b240bd6e505d467e11e8ea640d8d35dd5647bcf899e2cd6e/iam_builder-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e31f36ee2700e67c9d7ce9aca278263e", "sha256": "874ed6438a8ad3cb91143fb3d48b681302b4fc63e65ef6905b0582d6f3af116e" }, "downloads": -1, "filename": "iam_builder-2.0.0.tar.gz", "has_sig": false, "md5_digest": "e31f36ee2700e67c9d7ce9aca278263e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 5180, "upload_time": "2019-07-03T10:48:20", "url": "https://files.pythonhosted.org/packages/a8/12/e44c249856f761c2e83f10d00d5ab1931fd7f43f668256e1ae2f5d558e63/iam_builder-2.0.0.tar.gz" } ], "3.0.1": [ { "comment_text": "", "digests": { "md5": "2e94e90e4e713679b670ac9efa21ba26", "sha256": "65421289e60e2348aa5b427836a4997e4ebe867aa6fadab81915a6335601a359" }, "downloads": -1, "filename": "iam_builder-3.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2e94e90e4e713679b670ac9efa21ba26", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 6630, "upload_time": "2019-08-12T11:24:44", "url": "https://files.pythonhosted.org/packages/25/38/365ca85459a692b1605d9798b125cda1997c94d2e2909103bf93fef06db3/iam_builder-3.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8221eb14cfe9793952c2771f6f1bc42e", "sha256": "b9b5b37edea2396eda9106ec41460b3a8cf10ace86ed1519ef7af7023ec25197" }, "downloads": -1, "filename": "iam_builder-3.0.1.tar.gz", "has_sig": false, "md5_digest": "8221eb14cfe9793952c2771f6f1bc42e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 5553, "upload_time": "2019-08-12T11:24:46", "url": "https://files.pythonhosted.org/packages/6d/9e/138a2eb07b8f727df401cb3002d6df8186b6b4ed3efc433884051ca526ec/iam_builder-3.0.1.tar.gz" } ], "3.1.0": [ { "comment_text": "", "digests": { "md5": "2945a58f232797db5f10ede4e716b618", "sha256": "87fb347ab9c7f756450c45c340cb10aa66dea454eb1ea48b2785bc29cb9fc78c" }, "downloads": -1, "filename": "iam_builder-3.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "2945a58f232797db5f10ede4e716b618", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 6716, "upload_time": "2019-09-11T15:48:59", "url": "https://files.pythonhosted.org/packages/cc/ab/93cf1a1495f85390a1852013ca856de0210655d783e8b9cf1b1399f51f84/iam_builder-3.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bb54d7c931169d1ce913f74359ec9738", "sha256": "6577bab6ca032ca653db172a93af4b898a5c8c6037c90719505d4ba0e85088f2" }, "downloads": -1, "filename": "iam_builder-3.1.0.tar.gz", "has_sig": false, "md5_digest": "bb54d7c931169d1ce913f74359ec9738", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 5644, "upload_time": "2019-09-11T15:49:01", "url": "https://files.pythonhosted.org/packages/21/8e/57b43871a7243aece2b7db7f618581f20aa426580240a77c00c61d52993f/iam_builder-3.1.0.tar.gz" } ], "3.2.0": [ { "comment_text": "", "digests": { "md5": "766a0d8bf49cea99468fc9a2bebd19ba", "sha256": "77955c98a4d9a4c2ba5bbddb29d5fc93173be61c9be14fc82dc3f90b831c0d2d" }, "downloads": -1, "filename": "iam_builder-3.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "766a0d8bf49cea99468fc9a2bebd19ba", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 6780, "upload_time": "2019-09-17T13:04:08", "url": "https://files.pythonhosted.org/packages/8b/c9/32287c8ceeaefd7e8683e7b34d19c6afa910c5d0a00ad5a5ae44af2b9701/iam_builder-3.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3a5c456add4a97a2215b87f28b0f0f1c", "sha256": "214758d71f84b3c05a88b23118496b988da88d2ddb8acb4ca7b4c8f64e259aec" }, "downloads": -1, "filename": "iam_builder-3.2.0.tar.gz", "has_sig": false, "md5_digest": "3a5c456add4a97a2215b87f28b0f0f1c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 5706, "upload_time": "2019-09-17T13:04:10", "url": "https://files.pythonhosted.org/packages/7b/e7/e174dee4c4d68c51ae55d19cd5273be64ee4911150dd6ab87dd3e65f118e/iam_builder-3.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "766a0d8bf49cea99468fc9a2bebd19ba", "sha256": "77955c98a4d9a4c2ba5bbddb29d5fc93173be61c9be14fc82dc3f90b831c0d2d" }, "downloads": -1, "filename": "iam_builder-3.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "766a0d8bf49cea99468fc9a2bebd19ba", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 6780, "upload_time": "2019-09-17T13:04:08", "url": "https://files.pythonhosted.org/packages/8b/c9/32287c8ceeaefd7e8683e7b34d19c6afa910c5d0a00ad5a5ae44af2b9701/iam_builder-3.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3a5c456add4a97a2215b87f28b0f0f1c", "sha256": "214758d71f84b3c05a88b23118496b988da88d2ddb8acb4ca7b4c8f64e259aec" }, "downloads": -1, "filename": "iam_builder-3.2.0.tar.gz", "has_sig": false, "md5_digest": "3a5c456add4a97a2215b87f28b0f0f1c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 5706, "upload_time": "2019-09-17T13:04:10", "url": "https://files.pythonhosted.org/packages/7b/e7/e174dee4c4d68c51ae55d19cd5273be64ee4911150dd6ab87dd3e65f118e/iam_builder-3.2.0.tar.gz" } ] }