{"id":24164543,"url":"https://github.com/farzadmf/termask","last_synced_at":"2025-09-20T09:31:01.232Z","repository":{"id":57528875,"uuid":"251336326","full_name":"farzadmf/termask","owner":"farzadmf","description":"A utility to mask property values in the terminal","archived":false,"fork":false,"pushed_at":"2020-08-07T02:55:26.000Z","size":59,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-13T11:28:14.764Z","etag":null,"topics":["json","mask","passwords","secrets","terraform"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/farzadmf.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}},"created_at":"2020-03-30T14:49:29.000Z","updated_at":"2025-01-09T12:06:16.000Z","dependencies_parsed_at":"2022-09-10T17:10:54.812Z","dependency_job_id":null,"html_url":"https://github.com/farzadmf/termask","commit_stats":null,"previous_names":["farzadmf/terramask"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/farzadmf/termask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farzadmf%2Ftermask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farzadmf%2Ftermask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farzadmf%2Ftermask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farzadmf%2Ftermask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farzadmf","download_url":"https://codeload.github.com/farzadmf/termask/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farzadmf%2Ftermask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276076973,"owners_count":25581287,"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","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["json","mask","passwords","secrets","terraform"],"created_at":"2025-01-12T19:17:38.324Z","updated_at":"2025-09-20T09:31:01.021Z","avatar_url":"https://github.com/farzadmf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e ***VERY IMPORTANT NOTE***:\n\u003e Something that may be concerning is that this tool would have access to your secret information and somehow steal them (store them somewhere, etc.)\n\u003e I GUARANTEE that's NEVER going to happen, and this tool will only mask the secrets and WILL NOT use them in any way possible without your knowledge\n\n# termask\n\nA utility to mask property values in the terminal\n\nIt supports different inputs:\n\n- Terraform (v0.12)\n- JSON\n\n## Introduction\n\n### Terraform\n\n\u003e DISCLAIMER: I created this tool while only using Azure provider, so it is, in theory, possible that there would be bugs\n\u003e when using other providers; I'll do my best to solve any issues opened for other scenarios\n\nAlthough Terraform allows marking `output` variables as `sensitive`, at the time of this writing, it doesn't provide a way to mark arbitrary values as \"secret\"\n\nInspired by [tfmask](https://github.com/cloudposse/tfmask), this program allows masking property values (the ones in the form of\n`\"property\" = \"value\"`) in the output of `terraform plan` and `terraform apply`\n\n***NOTE***: it's worth noting that, for the moment, it only supports the `-no-color` option of Terraform\n\n## Installation\n\nYou can use `go get` to download the tool (a proper executable will be available soon)\n\n```bash\ngo get github.com/farzadmf/termask\n```\n\n## Usage\n\n### Terraform\n\nYou can get help by running `termask --help`:\n\n```text\nNAME:\n   termask - Mask values in the terminal\n\nUSAGE:\n   termask [global options] command [command options] [arguments...]\n\nCOMMANDS:\n   help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --mode value, -m value      (tf|json) mode determines the type of the input\n   --property value, -p value  property whose value we want to mask (can be specified multiple times)\n   --ignore-case, -i           case insensitive match (default: false)\n   --partial-match, -l         match if property partially contains the specified string (default: false)\n   --help, -h                  show help (default: false)\n```\n\n**NOTE**: by default, any property that contains the word `password` will be masked (case insensitive), and the options\nbelow don't change this; they just add to this.\n\nAs mentioned in the help, you can use `--property` (or `-p`) to specify properties whose values you want to mask\n(this flag can be specified multiple times).\n\nBy default, matching is done case sensitive, you can disable that by specifying the `--ignore-case` (or `-i`) flag.\n\nAlso, by default, a property should match the specified string as a whole word, `--partial-match` (or `-l`) allows overriding that.\n\n### Examples\n\nLet's say you have the following line in your `terraform plan` output:\n\n```text\n+ resource \"azurerm_resource_group\" \"rg\" {\n    + \"name\" = \"my-secret-resource-group\"\n    ...\n}\n```\n\nIf you want to mask the `name` property, you can do this:\n\n```bash\n# Don't forget the '-no-color' switch\nterraform plan -no-color | termask -m tf -p name\n```\n\nAnd the output will be:\n\n```text\n+ resource \"azurerm_resource_group\" \"rg\" {\n  + \"name\" = \"***\"\n  ...\n}\n```\n\nYou can also mask multiple properties; let's say you have the following output:\n\n```text\n+ resource \"azurerm_resource_group\" \"rg\" {\n    + location = \"eastus\"\n    + name     = \"mysecretrgname\"\n    ...\n}\n```\n\nAnd you want to mask `name` and `location`:\n\n```bash\nterraform plan -no-color | termask -m tf -p name -p location\n```\n\nWhich will result in the following output:\n\n```text\n+ resource \"azurerm_resource_group\" \"rg\" {\n    + location = \"***\"\n    + name     = \"***\"\n    ...\n}\n```\n\nAn example combining multiple options, given the following Terraform output:\n\n```text\n+ resource \"azurerm_app_service\" \"main\" {\n    ...\n    app_settings = {\n      ~ \"MyConnectionString\" = \"secret-connection-string\" -\u003e \"new-secret\"\n    }\n    ...\n}\n```\n\nWe use the following command:\n\n```bash\nterraform plan -no-color | termask -m tf -p connectionstring -i -l\n```\n\nAnd we get:\n\n```text\n+ resource \"azurerm_app_service\" \"main\" {\n    ...\n    app_settings = {\n      ~ \"MyConnectionString\" = \"***\" -\u003e \"***\"\n    }\n    ...\n}\n```\n\n### JSON\n\nWe have a simialr concept for JSON input. Let's say you a file named `my.json` with the following content:\n\n```json\n{\n  \"password\": \"secret\",\n  \"property\": \"value\",\n  \"name\": \"John\"\n}\n```\n\nSince, by default, `password` is masked, if you run this:\n\n```bash\ncat my.json | termask -m json\n```\n\nyou would see the following output:\n\n```json\n{\n  \"password\": \"***\",\n  \"property\": \"value\",\n  \"name\": \"John\"\n}\n```\n\nAnd, you can choose to mask other properties:\n\n```bash\ncat my.json | termask -m json -p name\n```\n\nGives you:\n\n```json\n{\n  \"password\": \"***\",\n  \"property\": \"value\",\n  \"name\": \"***\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarzadmf%2Ftermask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarzadmf%2Ftermask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarzadmf%2Ftermask/lists"}