Skip to content

Conversation

@tghastings
Copy link

Summary

Adds warning messages to alert users that the default RBAC mode "admin" grants cluster-admin level permissions and is not recommended for production deployments.

Closes #2879

Changes

pepr init

After creating a new module, users now see a warning:

WARN: This module uses the default RBAC mode "admin" which grants cluster-admin
level permissions. This is suitable for development and learning, but NOT
recommended for production. For production deployments, use
"npx pepr build --rbac-mode=scoped" to generate least-privilege RBAC.
See https://docs.pepr.dev/user-guide/rbac/ for more details.

pepr build

When building with admin RBAC mode (default or explicit), users now see a warning:

WARN: Building with RBAC mode "admin" which grants cluster-admin level permissions.
This is NOT recommended for production deployments. Consider using
"--rbac-mode=scoped" for least-privilege RBAC.
See https://docs.pepr.dev/user-guide/rbac/ for more details.

No warning is shown when using --rbac-mode=scoped.

Files Changed

File Change
src/cli/init/index.ts Added RBAC warning after module creation
src/cli/build/index.ts Added RBAC warning when using admin mode
src/cli/init/index.test.ts Added test for init warning
src/cli/build/index.test.ts Added tests for build warnings

Testing

npm run test:unit -- --run -t "RBAC" src/cli/init/index.test.ts src/cli/build/index.test.ts

All 4 new tests pass.

Checklist

  • Warning shown during npx pepr init
  • Warning shown during npx pepr build with admin mode
  • No warning when using --rbac-mode=scoped
  • Unit tests added
  • Links to RBAC documentation included

@tghastings
Copy link
Author

Will reopen with signed commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Overly Permissive RBAC ClusterRole in Admin Mode - Need to warn users

1 participant