Repository navigation
Warn when bundle run_as may lack file/resource access - #7313
lennartkats-db wants to merge 4 commits into
Conversation
|
Commit: Regression test reportSelected 12 changed tests (limit=20, 0 not selected) 21 tests: regression=19 unreleased=0 coverage=2 failing=0
TestAccept/bundle/migrate/command/runas/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/run_as/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/run_as/DMS=true: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): TestAccept/bundle/run_as/allowed/regular_user/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/run_as/allowed/regular_user/DMS=true: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/run_as/allowed/service_principal/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/run_as/allowed/service_principal/DMS=true: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/run_as/dashboard_embed/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/run_as/dashboard_embed/DMS=true: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/run_as/empty_override/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/run_as/empty_override/DMS=true: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/run_as/pipelines/regular_user/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) TestAccept/bundle/run_as/pipelines/regular_user/DMS=true: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): TestAccept/bundle/run_as/pipelines/service_principal/DMS=: branch ✅ | main (21db1be) ❌ | latest (v1.24.0) ❌main (21db1be): latest (v1.24.0): same output as main (21db1be) 5 more failure details omitted, see the full report in the run. |
✅ Integration test reportCommit: 7f060af
Top 3 slowest tests (at least 2 minutes):
|
|
|
||
| func (m *permissionDiagnostics) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnostics { | ||
| diags := runAsAccessDiagnostics(b) | ||
| // Only recommend deployment-identity access when top-level permissions are explicit. |
There was a problem hiding this comment.
This comment and the conditional below disagree; it recommends deployment identity access without top-level permissions being set. I agree this should only show up when users are using the top-level permissions block. I think this is also why this shows up in the acc test output so much.
There was a problem hiding this comment.
Ah, yes, the comment is inaccurate, but the behavior should be correct. I fixed the comment.
The goal is that we show the warning for any bundle with run_as and no permission for that run_as. Even for the case where there was no prior permissions section.
cc74d5f to
b1f07f6
Compare
b1f07f6 to
7f060af
Compare
Changes
Warn when a bundle's top-level
run_asidentity may lack access to deployed files or resources, including before a job is added. Suggest top-levelCAN_VIEW, or folder-levelCAN_READfor source-linked and Shared files. Top-level permissions also apply to bundle resources, including clusters (CAN_VIEWmaps toCAN_ATTACH_TO).Why
Access to a job or pipeline does not necessarily grant its
run_asidentity access to referenced files or resources such as clusters.Tests
go test ./bundle/phases ./bundle/permissions -count=1go test ./acceptance -run 'TestAccept/bundle/run_as' -count=1