{"id":18319813,"url":"https://github.com/mpb10/security-center-update-asset","last_synced_at":"2026-05-05T21:33:26.489Z","repository":{"id":222159894,"uuid":"148390205","full_name":"mpb10/security-center-update-asset","owner":"mpb10","description":"Bash script that updates a Tenable Security Center asset list with AWS IP addresses via a REST API call.","archived":false,"fork":false,"pushed_at":"2018-09-12T00:28:55.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T14:22:55.944Z","etag":null,"topics":["aws","aws-kms","bash","script","security-center","tenable"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpb10.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-09-11T22:54:23.000Z","updated_at":"2018-09-12T00:31:33.000Z","dependencies_parsed_at":"2024-02-12T18:09:51.856Z","dependency_job_id":null,"html_url":"https://github.com/mpb10/security-center-update-asset","commit_stats":null,"previous_names":["mpb10/security-center-update-asset"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mpb10/security-center-update-asset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpb10%2Fsecurity-center-update-asset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpb10%2Fsecurity-center-update-asset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpb10%2Fsecurity-center-update-asset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpb10%2Fsecurity-center-update-asset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpb10","download_url":"https://codeload.github.com/mpb10/security-center-update-asset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpb10%2Fsecurity-center-update-asset/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32669431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aws","aws-kms","bash","script","security-center","tenable"],"created_at":"2024-11-05T18:14:20.857Z","updated_at":"2026-05-05T21:33:26.475Z","avatar_url":"https://github.com/mpb10.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# security-center-update-asset\nBash script that updates a Tenable Security Center asset list with AWS IP addresses via a REST API call.\n\n\n**Author: mpb10**\n\n**September 11th, 2018**\n\n**v1.0.0**\n\n#\n\n - [INSTALLATION](#installation)\n - [USAGE](#usage)\n - [CHANGE LOG](#change-log)\n - [ADDITIONAL NOTES](#additional-notes)\n \n#\n\n# INSTALLATION\n\n**ATTENTION:** Never run unverified scripts or code in any production environment. Always be sure to thoroughly read through the contents of the files and understand them before using them in your environment.\n\nTo set this script up, copy the `update_asset.sh` file onto the AWS instance that hosts your installation of Tenable Security Center. A good place to put the script would be in a directory named 'scripts' in the root install directory of Security Center. Make sure to change the script's permissions so that it is executable. Then, the script can be ran as a one-off command using the script options, or the script's default variables can be modified so that a cron job can be set up.\n\nAn example cron entry would be:\n\t59 * * * * /opt/sc/scripts/update_asset.sh\n\nMake sure that when the script is ran, you either provide the necessary options or modify the default variables in the script.\n\n# USAGE\n\nThis script is primarily used to get a list of your running AWS instances' IP addresses and then upload that to an asset list in Tenable Security Center via a REST API call. This ensures that your scans have an up-to-date asset list of IP addresses to scan.\n\nThe script logs to the syslog using the 'logger' command to help in troubleshooting. The file that it will most likely log to is `/var/log/messages`. This can varry depending on which distribution of Linux you are using.\n\nTo maintain security, the REST API login token is created every time the script is ran and subsequently deleted before the script exits. Also, it is a good idea to utilize AWS KMS to encrypt your Security Center password in a file instead of having the password be passed to the script in plaintext every time it is ran. Details can be found [here](https://aws.amazon.com/blogs/security/how-to-help-protect-sensitive-data-with-aws-kms/) and [here](https://aws.amazon.com/blogs/security/how-to-encrypt-and-decrypt-your-data-with-the-aws-encryption-cli/).\n\n#\n\n**Using the Script Options:**\nIf the default variables in the script are not modified, then those variables must be provided to the script as options. The following options are required:\n\n\t-u (Security Center username)\n\t-p (Security Center password) OR -P (Credential file to have AWS KMS decrypt)\n\t-c (Cookie file for Security Center login)\n\t-i (Security Center asset ID) OR -I (Security Center asset name)\n\t-l (Security Center address)\n\nExample: `/opt/sc/scripts/update_asset.sh -u svc_sc -p P@ssw0rd -c /opt/sc/scripts/sc_cookiefile -i 123 -l securitycenter.local`\n\nExample: `/opt/sc/scripts/update_asset.sh -u svc_sc -P /opt/sc/scripts/sc_credfile -c /opt/sc/scripts/sc_cookiefile -I 'Running AWS Addresses' -l securitycenter.local`\n\nThe following option is not required:\n\n\t-k (Don't have curl verify the SSL certificates (NOT RECOMMENDED))\n\n#\n\n**Modifying the Script Variables:**\nInstead of passing options to the script, default values can be saved in the script itself. This is useful when the script is to be used with cron, Chef, or some other form of automation. Simply set each variable to it's corresponding option's value. These are the variables' corresponding options:\n\n\tUSERNAME (-u) (Ex: 'svc_sc')\n\tPASSWORD (-p) (Ex: 'P@ssw0rd')\n\tCREDFILE (-P) (Ex: '/opt/sc/scripts/sc_credfile')\n\tASSETNUM (-i) (Ex: '123')\n\tASSETNAME (-I) (Ex: 'Running AWS Addresses')\n\tCOOKIEFILE (-c) (Ex: '/opt/sc/scripts/sc_cookiefile')\n\tSSLVERIFY (-k) (Ex: '-k')\n\tSECURITYCENTERURI (-l) (Ex: 'securitycenter.local')\n\tCERTPATH (none) (Ex: '--capath /etc/ssl/certs/')\n\tCERTFILE (none) (Ex: '--cacert /etc/ssl/certs/ca-bundle.crt')\n\n# CHANGE LOG\n\n\t1.0.0\tSeptember 11th, 2018\n\t\tUploaded script and Chef recipe to Github.\n\t\tCreated readme.\n\n# ADDITIONAL NOTES\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\t\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpb10%2Fsecurity-center-update-asset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpb10%2Fsecurity-center-update-asset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpb10%2Fsecurity-center-update-asset/lists"}