{"id":21878288,"url":"https://github.com/pepabo/locksmith","last_synced_at":"2025-04-15T03:04:33.061Z","repository":{"id":101376135,"uuid":"602832409","full_name":"pepabo/locksmith","owner":"pepabo","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-03T13:00:41.000Z","size":2052,"stargazers_count":9,"open_issues_count":6,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-15T03:04:25.900Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pepabo.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,"publiccode":null,"codemeta":null}},"created_at":"2023-02-17T03:01:48.000Z","updated_at":"2024-06-03T13:00:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"04889cf4-42dc-43a6-adc3-d43f118a4209","html_url":"https://github.com/pepabo/locksmith","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/pepabo%2Flocksmith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Flocksmith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Flocksmith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Flocksmith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pepabo","download_url":"https://codeload.github.com/pepabo/locksmith/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997083,"owners_count":21195798,"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-28T08:12:11.352Z","updated_at":"2025-04-15T03:04:33.021Z","avatar_url":"https://github.com/pepabo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# locksmith\nOpen source software that provides AWS temporary credentials with k8s clusters running outside AWS\n\n### Setup\n\n#### (Optional) Create your own root CA certificate and private key\n- Your new root CA certificate is stored in locksmith/build/secrets/ca_crt.pem\n- Your new root CA private key is stored in locksmith/build/secrets/ca_key.pem\n\n```\ncd locksmith/build\nchmod +x ./create_secret_ca.sh\n./create_secret_ca.sh\n```\n#### (Optional) Create your own server certificate and private key\n- Your new server certificate is stored in locksmith/build/secrets/server_crt.pem\n- Your new server private key is stored in locksmith/build/secrets/server_key.pem\n\n```\ncd locksmith/build\nchmod +x ./create_secret_server.sh\n./create_secret_server.sh\n```\n\n### Create a trustanchor on AWS\n\n#### 1. Click \"Create a trust anchor\"\n![trust-anchor](/images/trust-anchor.png)\n\n#### 2. Paste your Root CA key to External certificate bundle\n![create-trust-anchor](/images/create-trust-anchor.png)\n\n\n#### 3. Create a special IAM role for IAM Roles Anywhere\n`rolesanywhere-trust-policy.json`\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Principal\": {\n                \"Service\": \"rolesanywhere.amazonaws.com\"\n            },\n            \"Action\": [\n                \"sts:AssumeRole\",\n                \"sts:SetSourceIdentity\",\n                \"sts:TagSession\"\n            ]\n        }\n    ]\n}\n```\n\n#### 4. Create an AWS role that you are planning to assume\n\n#### 5. Create an AWS profile on AWS\n![profile](/images/profile.png)\n\n#### 6. Create a docker image for locksmith\n\n##### 6.1 Execute commands reuired for building the docker image \n```\ncd locksmith\nexport AWS_TRUST_ANCHOR_ARN=(ARN for your trust anchor)\nexport AWS_PROFILE_ARN=(ARN for your AWS profile)\nexport AWS_ROLE_ARN=(ARN for the AWS role that you are going to assume)\nexport AWS_REGION=(your AWS region)\n```\n\n##### 6.2 Build your docker image\n```\ndocker compose up -d\n```\n\n#### 7. Create k8s secret for server certificate and private key\n```\nkubectl create secret tls tls-secret \\\n  --cert=(path to your server certificate) \\\n  --key=(path to your private key)\n```\n\n#### 6. Create k8s secret for AWS ARNS\n```\nkubectl create secret generic aws-config \\\n        --from-literal=\"aws-trust-anchor-arn=$AWS_TRUST_ANCHOR_ARN\" \\\n        --from-literal=\"aws-profile-arn=$AWS_PROFILE_ARN\" \\\n        --from-literal=\"aws-role-arn=$AWS_ROLE_ARN\" \\\n        --from-literal=\"aws-region=$AWS_REGION\"\n```\n\n#### 8. Add locksmith to your manifest file\nSee an [example](k8s/deployment.yaml) \n\n#### 9. Run your deployment on your k8s cluster\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepabo%2Flocksmith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpepabo%2Flocksmith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepabo%2Flocksmith/lists"}