{"id":19773176,"url":"https://github.com/ibm-cloud-security/vault-plugin-auth-ibmcloud","last_synced_at":"2025-10-13T20:32:29.983Z","repository":{"id":40426588,"uuid":"311401339","full_name":"ibm-cloud-security/vault-plugin-auth-ibmcloud","owner":"ibm-cloud-security","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-02T20:09:23.000Z","size":115,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-13T00:39:05.130Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibm-cloud-security.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-11-09T16:38:51.000Z","updated_at":"2022-04-28T17:04:27.000Z","dependencies_parsed_at":"2022-08-09T20:10:33.367Z","dependency_job_id":null,"html_url":"https://github.com/ibm-cloud-security/vault-plugin-auth-ibmcloud","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ibm-cloud-security/vault-plugin-auth-ibmcloud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-cloud-security%2Fvault-plugin-auth-ibmcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-cloud-security%2Fvault-plugin-auth-ibmcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-cloud-security%2Fvault-plugin-auth-ibmcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-cloud-security%2Fvault-plugin-auth-ibmcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibm-cloud-security","download_url":"https://codeload.github.com/ibm-cloud-security/vault-plugin-auth-ibmcloud/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-cloud-security%2Fvault-plugin-auth-ibmcloud/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267179481,"owners_count":24048353,"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-07-26T02:00:08.937Z","response_time":62,"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":[],"created_at":"2024-11-12T05:08:53.380Z","updated_at":"2025-10-13T20:32:24.925Z","avatar_url":"https://github.com/ibm-cloud-security.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IBM Cloud Auth Method\n\nThis is a standalone backend plugin for use with [HashiCorp Vault](https://www.github.com/hashicorp/vault).\nThis plugin allows for various IBM Cloud entities to authenticate with Vault.\n\nUser accounts or service IDs can sign in using an IBM Cloud IAM access token or API key.\n\n## Installation\n\nThe plugin must be built before it is installed. Follow the steps in [Developing](#Developing) to build\nthe plugin executable.\n\nCopy the executable into Vault's configured plugin folder:\n`cp bin/vault-plugin-auth-ibmcloud $VAULT_INSTALL/plugins`\n\nRegister the plugin:\n```\nexport SHA256=$(shasum -a 256 \"bin/vault-plugin-auth-ibmcloud\" | cut -d' ' -f1)\nvault plugin register -sha256=${SHA256} auth vault-plugin-auth-ibmcloud\n```\n\nEnable (mount) the plugin: `vault auth enable -plugin-name=\"vault-plugin-auth-ibmcloud\" -path=\"ibmcloud\" plugin`\n\n## Usage\nThe general usage pattern is for the administrator to create one or more roles which\nmap Vault policies to IBM Cloud Access Groups and/or a list of IBM Cloud user (subject) IDs.\n\nUsers or service IDs can then log into Vault using by specifying a role name and either their an IBM Cloud IAM access token or API key.\n\nThe auth method must be configured in advance before authentication.\n\n# API documentation\nThis documentation assumes the plugin method is mounted at the `/auth/ibmcloud` path in Vault. Since it is possible to\nenable auth methods at any location, please update your API calls accordingly.\n\n\n## Configure\n\nConfigures the credentials and parameters required for the plugin to perform API calls to IBM Cloud IAM and User Management. These\ncredentials will be used to verify user account and service ID account access and access group membership. The user account or\nservice ID providing the API key needs to have the following permissions:\n\n* `Viewer` on `Access Groups Service`\n* `Viewer` on `IAM Identity Service`\n* `Operator` on `IAM Identity Service` if root credential rotation will be used\n* `Viewer` on `User Management Service` \n\nConfigures the auth method and must be done before authentication can succeed.\n\n| Method   | Path |\n|----------|-------------------------------------------------|\n| `POST`   |  `/auth/ibmcloud/config`                             |\n\n\n### Parameters\n* `api_key (string: \u003crequired\u003e)` - An API key for a service ID or user with sufficient permissions to verify IBM Cloud access group\nmembership for the all the access groups bound to the plugin's roles.\n* `account_id (string: \u003crequired\u003e)` - An IBM Cloud account ID. The auth method will only authenticate users or service IDs that\nhave access to this account.\n* `iam_endpoint (string: \u003coptional\u003e)` - The custom or private IAM endpoint. For example `https://private.iam.cloud.ibm.com`.\nIf unspecified the public endpoint, `https://iam.cloud.ibm.com`, is used.\n* `user_management_endpoint (string: \u003coptional\u003e)` - The custom or private user management endpoint. For example `https://private.user-management.cloud.ibm.com`.\nIf unspecified the public endpoint, `https://user-management.cloud.ibm.com`, is used.\n\n### Sample Payload\n\n```json\n{\n  \"api_key\":    \"Yl5OBiNlgpx...\",\n  \"account_id\": \"abd85726cbd...\"\n}\n```\n\n### Sample Request\n```shell script\n$ curl \\\n    --header \"X-Vault-Token: ...\" \\\n    --request POST \\\n    --data @payload.json \\\n    https://127.0.0.1:8200/v1/auth/ibmcloud/config\n```\n\n## Read Config\nReturns the configuration, if any. Credentials are redacted in the output.\n\n| Method   | Path |\n|----------|--------------------------------------------------|\n| `GET`    |  `/auth/ibmcloud/config`                              |\n\n\n### Sample Request\n```shell script\n$ curl \\\n    --header \"X-Vault-Token: ...\" \\\n    https://127.0.0.1:8200/v1/auth/ibmcloud/config\n```\n\n### Sample Response\n```json\n{\n  \"data\": {\n    \"api_key\": \"\u003credacted\u003e\",\n    \"account_id\": \"abd85726cbd...\",\n    \"iam_endpoint\": \"https://iam.cloud.ibm.com\",\n    \"user_management_endpoint\": \"https://user-management.cloud.ibm.com\",\n  },\n  \"...\": \"...\"\n\n}\n```\n\n## Rotate Root Credentials\n\nRotates the IBM Cloud API key used by Vault for this mount. A new key will be generated\nfor same user or service ID and account as the existing API key. The configuration is updated\nand then the old API key is deleted.\n\nThe ID of the new API key is returned in the response.\n\n\n| Method   | Path |\n|----------|-------------------------------------------------|\n| `POST`   |  `/auth/ibmcloud/config/rotate-root`            |\n\n\n### Sample Request\n```shell script\n$ curl \\\n    --header \"X-Vault-Token: ...\" \\\n    --request POST \\\n    https://127.0.0.1:8200/v1/auth/ibmcloud/config/rotate-root\n```\n\n### Sample Response\n```json\n{\n  \"data\": {\n    \"api_key_id\": \"ApiKey-0abbbbbb-21cc-4dcc-a9cc-b59bc15c7aa1\"\n  },\n  \"...\": \"...\"\n}\n```\n\n## Delete Config\nDeletes the previously configured configuration and clears the credentials in the plugin.\n\n| Method     | Path |\n|----------- |--------------------------------------------------|\n| `DELETE`   |  `/auth/ibmcloud/config`                              |\n\n### Sample Request\n```shell script\n$ curl \\\n    --header \"X-Vault-Token: ...\" \\\n    --request DELETE \\\n    https://127.0.0.1:8200/v1/auth/ibmcloud/config\n```\n\n## Create Role\nRegisters a role in the method. Role types have specific entities that can perform login operations against\nthis endpoint. Constraints specific to the role type must be set on the role. These are applied to the\nauthenticated entities attempting to login.\n\n| Method     | Path                                             |\n|----------- |--------------------------------------------------|\n| `POST`     |  `/auth/ibmcloud/role/:name`                          |\n\n\n### Parameters\n\n* `name (string: \u003crequired\u003e)` - Name of the role.\n\nOne or more the following must be specified:\n* `bound_subjects (array: [])` - The list of subject ids that login is restricted to.\n* `bound_access_group_ids (array: [])` - `The list of IBM Cloud IAM access group ids that login is restricted to.\n\nStandard token parameters:\n* `token_policies (array: [] or comma-delimited string: \"\")` - List of policies to encode onto generated tokens.\n* `token_ttl (integer: 0 or string: \"\") `- The incremental lifetime for generated tokens. This current value of this will be referenced at renewal time.\n* `token_max_ttl (integer: 0 or string: \"\")` - The maximum lifetime for generated tokens. This current value of this will be referenced at renewal time.\n* `token_bound_cidrs (array: [] or comma-delimited string: \"\")` - List of CIDR blocks; if set, specifies blocks of IP addresses which can authenticate successfully, and ties the resulting token to these blocks as well.\n* `token_explicit_max_ttl (integer: 0 or string: \"\")` - If set, will encode an explicit max TTL onto the token. This is a hard cap even if token_ttl and token_max_ttl would otherwise allow a renewal.\n* `token_no_default_policy (bool: false)` - If set, the default policy will not be set on generated tokens; otherwise it will be added to the policies set in token_policies.\n* `token_num_uses (integer: 0)` - The maximum number of times a generated token may be used (within its lifetime); 0 means unlimited. If you require the token to have the ability to create child tokens, you will need to set this value to 0.\n* `token_period (integer: 0 or string: \"\")` - The period, if any, to set on the token.\n* `token_type (string: \"\")` - The type of token that should be generated. Can be service, batch, or default to use the mount's tuned default (which unless changed will be service tokens). For token store roles, there are two additional possibilities: default-service and default-batch which specify the type to return unless the client requests a different type at generation time.\n\n### Sample Payload\n```json\n{\n  \"token_policies\": [\"dev\", \"prod\"],\n  \"bound_access_group_ids\": [\"AccessGroupId-43f12338-fc2c-41cd-b4f9-14eff0cbeb47\", \"AccessGroupId-43f12111-fc2c-41cd-b4f9-14eff0cbeb21\"],\n  \"bound_subjects\": [\"ServiceId-068bda08-c891-4a7f-82cf-3b2111ae3c43\", \"myuser@mycomany.com\"]\n}\n```\n\n### Sample Request\n```shell script\n$ curl \\\n    --header \"X-Vault-Token: ...\" \\\n    --request POST \\\n    --data @payload.json \\\n    https://127.0.0.1:8200/v1/auth/ibmcloud/role/dev-role\n```\n## Read Role\nReturns the previously registered role configuration.\n\n| Method     | Path                                             |\n|----------- |--------------------------------------------------|\n| `GET`      |  `/auth/ibmcloud/role/:name`                          |\n \n### Parameters\n\n* `name (string: \u003crequired\u003e)` - Name of the role.\n\n\n### Sample Request\n```shell script\n$ curl \\\n    --header \"X-Vault-Token: ...\" \\\n    https://127.0.0.1:8200/v1/auth/ibmcloud/role/dev-role\n```\n\n### Sample Response\n```json\n{\n  \"data\": {\n    \"bound_access_group_ids\": [\n      \"AccessGroupId-43f12338-fc2c-41cd-b4f9-14eff0cbeb47\",\n      \"AccessGroupId-43f12111-fc2c-41cd-b4f9-14eff0cbeb21\"\n    ],\n    \"bound_subjects\": [\n      \"ServiceId-068bda08-c891-4a7f-82cf-3b2111ae3c43\",\n      \"myuser@mycomany.com\"\n    ],\n    \"token_policies\": [\n      \"prod\",\n      \"dev\"\n    ],\n    \"token_bound_cidrs\": [],\n    \"token_explicit_max_ttl\": 0,\n    \"token_max_ttl\": 0,\n    \"token_no_default_policy\": false,\n    \"token_num_uses\": 0,\n    \"token_period\": 0,\n    \"token_ttl\": 0,\n    \"token_type\": \"default\"\n  },\n  \"...\": \"...\"\n\n}\n```\n\n## List Roles\nLists all the roles that are registered with the plugin.\n\n| Method     | Path                                             |\n|----------- |--------------------------------------------------|\n| `LIST`     |  `/auth/ibmcloud/role`                                |\n \n### Sample Request\n ```shell script\ncurl \\\n    --header \"X-Vault-Token: ...\" \\\n    --request LIST \\\n    https://127.0.0.1:8200/v1/auth/ibmcloud/role\n```\n\n### Sample Response\n\n```json\n{\n  \"data\": {\n    \"keys\": [\"dev-role\", \"prod-role\"]\n  },\n  \"...\": \"...\"\n\n}\n```\n\n## Delete Role\nDeletes the previously registered role.\n\n| Method     | Path                                             |\n|----------- |--------------------------------------------------|\n| `DELETE`   |  `/auth/ibmcloud/role/:name`                          |\n \n### Parameters\n* `name (string: \u003crequired\u003e)` - Name of the role.\n\n### Sample Request\n```shell script\n curl \\\n    --header \"X-Vault-Token: ...\" \\\n    --request DELETE \\\n    https://127.0.0.1:8200/v1/auth/ibmcloud/role/dev-role\n```\n\n## Login\n\nFetch a token. This endpoint takes a role name and either an IBM Cloud IAM API key or access token.\nIf an API key is provided, it is used to fetch an access token from IBM Cloud IAM. The access token, either\nprovided or fetched, is then verified to authenticate the entity. The entity is then checked against the bound\nentities of the given role.\n\n| Method     | Path                                             |\n|----------- |--------------------------------------------------|\n| `POST`     |  `/auth/ibmcloud/login`                               |\n\n### Parameters\n* `role (string: \u003crequired\u003e)` - Name of the role against which the login is being attempted.\n\nOne of the following is required:\n* `token (string: \"\")` - An IBM Cloud IAM access token.\n* `api_key (string: \"\")` - An IBM Cloud IAM API key.\n\n### Sample Payload\n\nToken form:\n```json\n{\n  \"role\": \"dev-role\",\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"\n}\n```\n\nAPI key form:\n```json\n{\n  \"role\": \"dev-role\",\n  \"api_key\": \"Yl5OBiNlgpx...\"\n}\n```\n\n### Sample Request\n```shell script\n$ curl \\\n    --request POST \\\n    --data @payload.json \\\n    https://127.0.0.1:8200/v1/auth/ibmcloud/login\n```\n\n### Sample Response\n```json\n{\n  \"auth\": {\n    \"client_token\": \"s.SaizjrPeDs5rVvsmsTQPVmpW\",\n    \"accessor\": \"Gibi4QfcsFLufAMN8havO9LH\",\n    \"policies\": [\n      \"default\",\n      \"dev\",\n      \"prod\"\n    ],\n    \"token_policies\": [\n      \"default\",\n      \"dev\",\n      \"prod\"\n    ],\n    \"metadata\": {\n      \"IAM_ID\": \"iam-ServiceId-068bda08-c891-4a7f-82cf-3b2111ae3c43\",\n      \"role\": \"dev-role\",\n      \"subject\": \"ServiceId-068bda08-c891-4a7f-82cf-3b2111ae3c43\"\n    },\n    \"lease_duration\": 2764800,\n    \"renewable\": true,\n    \"entity_id\": \"\",\n    \"token_type\": \"service\",\n    \"orphan\": true\n  },\n  \"...\": \"...\"\n}\n```\n\n## Developing\n\nFor local dev first make sure Go is properly installed, including\nsetting up a [GOPATH](https://golang.org/doc/code.html#GOPATH). The version\nof Go that is installed should match the level required by the version of Vault\nthat will be used. See [Vault's requirements](https://github.com/hashicorp/vault#developing-vault)\nfor more information.\n\n\nNext, clone this repository:\n\n```sh\n$ git clone https://github.com/ibm-cloud-security/vault-plugin-auth-ibmcloud\n$ cd vault-plugin-auth-ibmcloud\n```\n\nYou can then download any required build tools by bootstrapping your\nenvironment:\n\n```sh\n$ make bootstrap\n```\n\nTo compile a development version of this plugin, run `make` or `make dev`.\nThis will put the plugin binary in the `bin` and `$GOPATH/bin` folders. `dev`\nmode will only generate the binary for your platform and is faster:\n\n```sh\n$ make\n$ make dev\n```\n\nFor local development, use Vault's \"dev\" mode for fast setup:\n\n```sh\n$ vault server -dev -config vault.hcl\n```\n\nWhere vault.hcl configures the plugin directory like this:\n```\nplugin_directory = \"./plugins\"\n```\n\nFollow the setup instructions to copy, register, and enable the plugin.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibm-cloud-security%2Fvault-plugin-auth-ibmcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibm-cloud-security%2Fvault-plugin-auth-ibmcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibm-cloud-security%2Fvault-plugin-auth-ibmcloud/lists"}