Skip to content

feat(DM01-6092): add endpoint to get project secrets with decrypted values#630

Closed
Jiachen0715 wants to merge 1 commit into
masterfrom
feat/DM01-6092-list-project-secrets
Closed

feat(DM01-6092): add endpoint to get project secrets with decrypted values#630
Jiachen0715 wants to merge 1 commit into
masterfrom
feat/DM01-6092-list-project-secrets

Conversation

@Jiachen0715

Copy link
Copy Markdown
Contributor

Summary

Add GET /api/v1/projects/<project_id>/secrets/values which returns each
secret's name and decrypted plaintext value for a project.

Changes

  • New SecretValues resource in src/api/handlers/projects/secrets.py:
    • validates the project uuid (400 on malformed id)
    • returns 404 when the project does not exist
    • decrypts each secret value via decrypt_secret
  • New OPA rule in src/openpolicyagent/policies/projects_secrets.rego
    allowing GET on the .../secrets/values path, reusing the existing
    project-administrator gate (user token + role >= 20).

Impact

  • ⚠️ This endpoint exposes plaintext secret values. Access is
    restricted to project administrators by the OPA policy.
  • Requires the RSA private key mounted at INFRABOX_RSA_PRIVATE_KEY_PATH
    to decrypt values (already present in the API pod).

Testing

  • Python syntax validated locally.
  • Unit / integration tests: TODO (not yet added in this PR).

…alues

Add GET /api/v1/projects/<project_id>/secrets/values returning each
secret's name and decrypted plaintext value for a project.

- New SecretValues resource: validates project uuid (400), returns 404
  when the project does not exist, decrypts each secret value.
- New OPA rule allowing GET on the .../secrets/values path, reusing the
  existing project-administrator gate (user token + role >= 20).

WARNING: this endpoint exposes plaintext secret values; access is
restricted to project administrators by the OPA policy.
@Jiachen0715

Copy link
Copy Markdown
Contributor Author

Superseded by #631, which folds in this /secrets/values endpoint and adds the temporary read-token two-factor gate. Continuing there.

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.

1 participant