Skip to content
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

(Feat): Interacting with projects programmatically #1400

Merged
merged 157 commits into from
Feb 22, 2024
Merged

Conversation

DanielHougaard
Copy link
Collaborator

@DanielHougaard DanielHougaard commented Feb 13, 2024

Description 📣

This PR introduces a new concept called ghost users. Due to the nature of Infisical's end-to-end encryption structure, it was previously not possible to interact with projects programmatically through the API and other consuming applications. By introducing ghost user's, we're slowly moving to a more industry-standard way of storing secrets securely, while at the same time improving the user experience for everyone.
To sum it up. The main purpose of the PR is to make the API more user-friendly, and to introduce a better approach as to how we securely store secrets. Existing projects will get an option to upgrade to the new ghost user logic. All new projects will be created with the ghost logic by default.

Type ✨

  • Bug fix
  • New feature
  • Breaking change
  • Documentation

@DanielHougaard DanielHougaard self-assigned this Feb 13, 2024
Copy link

gitguardian bot commented Feb 13, 2024

⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
9387832 Triggered Generic Password 04c12d9 backend/src/db/seeds/1-user.ts View secret
9387832 Triggered Generic Password 0cecf05 backend/src/db/seeds/1-user.ts View secret
9387832 Triggered Generic Password f2c36c5 backend/src/db/seeds/1-user.ts View secret
9387832 Triggered Generic Password faa842c backend/src/db/seeds/1-user.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@DanielHougaard DanielHougaard force-pushed the daniel/ghost-users-full branch 3 times, most recently from b7278d0 to ae4fa7e Compare February 14, 2024 00:01
@DanielHougaard DanielHougaard marked this pull request as ready for review February 14, 2024 00:04
Copy link
Member

@akhilmhdh akhilmhdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more question. As we are polling the system. Are we blocking user interactions.

Because what will happen if user's does something while the indexing is happening behind the scene. Blind index didn't had this issue because those secrets were never accessible by end users. But this case is not

backend/src/db/migrations/20240216154123_ghost_users.ts Outdated Show resolved Hide resolved
backend/src/db/migrations/20240216154123_ghost_users.ts Outdated Show resolved Hide resolved
backend/src/lib/crypto/srp.ts Outdated Show resolved Hide resolved
backend/src/lib/project/index.ts Outdated Show resolved Hide resolved
backend/src/lib/secret/index.ts Outdated Show resolved Hide resolved
backend/src/services/secret/secret-dal.ts Outdated Show resolved Hide resolved
backend/src/services/secret/secret-version-dal.ts Outdated Show resolved Hide resolved
@DanielHougaard
Copy link
Collaborator Author

One more question. As we are polling the system. Are we blocking user interactions.

Because what will happen if user's does something while the indexing is happening behind the scene. Blind index didn't had this issue because those secrets were never accessible by end users. But this case is not

This is an interesting case yea. I agree, we should to some degree block secret mutations while an upgrade is happening. I've just pushed a change that blocks secret write operations if an upgrade is active. You can check it out here.

Copy link
Collaborator

@maidul98 maidul98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks real good! Just left some minor nits. Should be good to go after that

backend/src/services/project/project-queue.ts Outdated Show resolved Hide resolved
backend/src/lib/crypto/srp.ts Outdated Show resolved Hide resolved
backend/src/lib/crypto/srp.ts Outdated Show resolved Hide resolved
backend/src/lib/secret/index.ts Outdated Show resolved Hide resolved
backend/src/services/org/org-service.ts Outdated Show resolved Hide resolved
backend/src/services/project/project-queue.ts Show resolved Hide resolved
backend/src/services/project-bot/project-bot-service.ts Outdated Show resolved Hide resolved
backend/src/services/secret/secret-service.ts Outdated Show resolved Hide resolved
@DanielHougaard
Copy link
Collaborator Author

Note:

API breaking change checker will fail because we've removed POST /api/v1/workspace/{workspaceId}/invite-signup completely, as this is leftover code from the past, that isn't used anywhere.

@maidul98 maidul98 merged commit 1cf9aae into main Feb 22, 2024
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants