-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feature: add k8s for PAM #4981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: add k8s for PAM #4981
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
3e70fb6 to
65d5b7e
Compare
# Conflicts: # frontend/src/pages/pam/PamAccountsPage/components/PamAccessAccountModal.tsx
65d5b7e to
2afd765
Compare
Greptile OverviewGreptile SummaryThis PR adds Kubernetes resource support to the PAM system, enabling privileged access management for Kubernetes clusters via service account tokens. The implementation includes:
Key changes:
Issues found:
Non-breaking changes:
Documentation:
Confidence Score: 3/5
Important Files ChangedFile Analysis
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
28 files reviewed, 2 comments
Context
ref: https://linear.app/infisical/issue/PAM-12/add-support-for-kubernetes-resource-in-pam
Screenshots
Steps to verify the change
To test this PR, you need the cli PR 79 checked out locally first. Then, you need a local Kubernetes server. Using the one comes with Docker Desktop might be the easiest way to do it. Or you can use Kind if you want.
Step 1. You need to create the new Kubernetes resource
Before all the following, you need to have the gateway and relay with changes we made in the CLI PR 79 running and registered with your local infisical instance.
Next, visit the PAM resource page, click "Add Resource", select Kubernetes. Input the name and the URL to the k8s server, such as:
https://localhost:6443You may want to disable the SSL check if the IP / hostname you're trying to access the K8S API endpoint may have a certificate that comes with different IP / hostname in it.
Step 2. Create an SA account
Currently, the K8S PAM access only support SA account token. You can save the following file
sa.yaml:Then run
To create the needed SA account
Step 3. Create a PAM account
To create one, visit PAM account page, click "Add Account" button. Select the k8s resource we've just created. You will need the static service account token, run the following cmd to obtain it:
Copy and paste the SA account content to the add account form.
Step 4. Run access cmd in CLI
Go the PAM account page, click "Access" button for the newly created account and copy the cmd like this:
You may need to replace the
infisicalcmd withgo run .instead in the CLI project root folder if you don't have it installed in your system.Once you run it, you should be able to access the k8s instance with
kubectl. After that, shutdown the proxy, you should be able to see the session logs in the Sessions page.Type