{"id":18896177,"url":"https://github.com/tenable/asm-python-examples","last_synced_at":"2026-01-08T00:49:43.916Z","repository":{"id":43463384,"uuid":"344207285","full_name":"tenable/asm-python-examples","owner":"tenable","description":"Bit Discovery REST API scripts","archived":false,"fork":false,"pushed_at":"2024-04-01T14:45:24.000Z","size":754,"stargazers_count":2,"open_issues_count":14,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-01T16:01:16.243Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tenable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-03-03T17:25:41.000Z","updated_at":"2024-04-14T17:48:00.937Z","dependencies_parsed_at":"2023-09-27T02:42:02.136Z","dependency_job_id":"a2682d3b-1720-4e73-a82d-7b03775d1162","html_url":"https://github.com/tenable/asm-python-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenable%2Fasm-python-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenable%2Fasm-python-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenable%2Fasm-python-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenable%2Fasm-python-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tenable","download_url":"https://codeload.github.com/tenable/asm-python-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246308048,"owners_count":20756482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T08:32:49.860Z","updated_at":"2026-01-08T00:49:43.867Z","avatar_url":"https://github.com/tenable.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bit Discovery Python scripts\n\nThese scripts demonstrate how you can integrate your work with the Bit Discovery API.\n\nTo run these scripts, you have to have [Python 3.6+](https://www.python.org/downloads/) installed on your computer and\nyour Bit Discovery API keys for an inventory. (You can get this on\nyour [Bit Discovery profile page](https://dev.bitdiscovery.com/user/profile).) The best way is to save your API key to a\nvariable and reuse it for every script.\n\n```shell\nAPIKEY=eyJh...hUFs\npython pdf-report.py $APIKEY\n```\n\nIf you need more information about the options of any script, just see the help message:\n\n```shell\npython pdf-report.py --help\n```\n\n## PDF Report\n\nThe `pdf-report.py` script exports the assets from one or all of your inventories (`--multiple` flag), and creates a PDF\nfile analysis based on the inventory data.\n\n### Usage\n\nInstall the dependencies:\n\n```shell\npip install argparse datetime fpdf2 matplotlib pypdf2 requests\n```\n\nCreate a pdf report by passing the inventory api key:\n\n```shell\npython3 pdf-report.py $APIKEY\n```\n\nIf you want to create a pdf report for every inventory you own, you can pass the `--multiple` flag:\n\n```shell\npython3 pdf-report.py $APIKEY --multiple\n```\n\n## Auto add assets\n\nThe `auto-add-assets.py` script can search your cloud provider, AWS, Google Cloud or Azure (using their respective\ncommand-line tools), and add your running instances to the provided inventory.\n\n### Usage\n\nFor this script you need to have and be signed in to the command-line interfaces of your cloud provider of choice. For\nAWS, install the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html), for GCP Cloud\nthe [gcloud CLI](https://cloud.google.com/sdk/docs/install) and for\nAzure [az](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli).\n\nAfter that, install the Python dependencies:\n\n```shell\npip install argparse datetime requests sh\n```\n\nRead your running EC2 instances and buckets from your AWS account:\n\n```shell\npython3 auto-add-assets.py amazon-ec2 $APIKEY\n```\n\nSimilarly for Google Cloud and Azure:\n\n```shell\n# GCP\npython3 auto-add-assets.py google-cloud $APIKEY\n# Azure\npython3 auto-add-assets.py azure $APIKEY\n```\n\n## Delete ip or source\n\nThe `delete-ip.py` script deletes one specific IP or source from your inventory.\n\n### Usage\n\nFirst, install the Python dependencies:\n\n```shell\npip install argparse requests sh\n```\n\nDelete an IP or a source (with its id) from the given inventory:\n\n```shell\npython3 delete-ip.py ip 1.1.1.1 $APIKEY\npython3 delete-ip.py source 13 $APIKEY\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenable%2Fasm-python-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftenable%2Fasm-python-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenable%2Fasm-python-examples/lists"}