Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d3dc3ce
feat(github): add bounded keyless service integration candidate
pallakatos Sep 8, 2026
cd020a1
Checkpoint governed credential integration before privacy ancestry
pallakatos Sep 8, 2026
76db8e1
Merge qualified privacy ancestry into credential candidate
pallakatos Sep 8, 2026
b3f6ca8
Checkpoint private credential issuers before GitHub integration
pallakatos Sep 8, 2026
4e2e107
Merge qualified GitHub consumer into private credential candidate
pallakatos Sep 8, 2026
35411cf
Fence GitHub projection reuse by source revision
pallakatos Sep 8, 2026
b3d0446
Merge current qualified privacy closure into credential candidate
pallakatos Sep 8, 2026
93690ba
Gate Task readiness on live credential authority
pallakatos Sep 8, 2026
45939f6
Checkpoint governed credential continuity and core qualification
pallakatos Sep 9, 2026
330113a
Merge current SRE privacy closure and patched runtime dependencies
pallakatos Sep 9, 2026
fdf07f9
Record forward-qualified credential candidate handoff
pallakatos Sep 9, 2026
ec1ecf5
Implement target-bound controller observation privacy RPC
pallakatos Sep 9, 2026
24646e1
Checkpoint reviewed credential authority and lifecycle repairs
pallakatos Sep 9, 2026
71a42f6
Correct credential repair module and import wiring
pallakatos Sep 9, 2026
cdb8ba7
Correct nested credential suspension test path
pallakatos Sep 9, 2026
45ccc89
Make credential rebind test scoping explicit for Clippy
pallakatos Sep 9, 2026
ba491a9
Record guarded credential repair qualification
pallakatos Sep 9, 2026
94dbcb3
fix(credentials): route identity digests through approved providers
pallakatos Sep 9, 2026
80cffb6
fix(credentials): make production config paths immutable and close so…
pallakatos Sep 9, 2026
f8d641f
fix(credentials): align native UID admission and generated schemas
pallakatos Sep 9, 2026
ce6d263
fix(credentials): keep observer body reads independent of stream feat…
pallakatos Sep 9, 2026
4b24d9c
fix(credentials): preserve native admission semantics across CEL types
pallakatos Sep 9, 2026
9caf91e
test(credentials): exercise native store, rebind and exposure predicates
pallakatos Sep 9, 2026
9893783
fix(admission): handle primary requests without a subresource field
pallakatos Sep 9, 2026
f8ec6d0
test: isolate fresh SRE namespace rendering from unrelated chart work
pallakatos Sep 9, 2026
08d2794
fix(credentials): forward proven namespace collection cleanup guards
pallakatos Sep 10, 2026
7269a80
fix(sre): negotiate Kubernetes log streams with supported media
pallakatos Sep 9, 2026
2582ead
fix(sre): retain native SecretList compatibility in credential compos…
pallakatos Sep 10, 2026
9897986
fix(credentials): bound authority refresh and stabilize rebind acknow…
pallakatos Sep 10, 2026
2d5dba1
fix(credentials): evaluate observation policies against actual runtim…
pallakatos Sep 10, 2026
5ba25c4
fix(sre): preserve the native ReplicaSet controller handoff in compos…
pallakatos Sep 10, 2026
8da5115
fix(credentials): grant controller read access for observer ReplicaSe…
pallakatos Sep 10, 2026
a0992ad
fix(observations): identify private readiness failures without sensit…
pallakatos Sep 10, 2026
6211590
test(observations): use the workspace boxed Kubernetes API status
pallakatos Sep 10, 2026
cb38649
merge: qualify observer readiness diagnostics on the current services…
pallakatos Sep 10, 2026
17f53b6
fix(credentials): reject template workload authority in every live wr…
pallakatos Sep 10, 2026
05807e5
fix(credentials): stage and enforce generic private consumption autho…
pallakatos Sep 10, 2026
463a3e4
Merge public ac9f1b96 foundations into private activation candidate
pallakatos Sep 10, 2026
a3cb81c
refactor(credentials): split private activation phases within LOC limits
pallakatos Sep 10, 2026
69e715c
fix(credentials): retain test module declarations on activation facade
pallakatos Sep 10, 2026
cfcc410
fix(credentials): fence namespace subresources and retire old root au…
pallakatos Sep 10, 2026
9e6965e
Merge qualified public fe29941f evaluator compatibility
pallakatos Sep 10, 2026
5fabfca
fix(credentials): retire root authority before TLS rotation
pallakatos Sep 10, 2026
69654ca
fix(credentials): reject previously exposed rotation keys
pallakatos Sep 10, 2026
2af65a7
Remove duplicate TLS dependencies after foundation composition
pallakatos Sep 11, 2026
847dab5
Use declared credential activation module in regression tests
pallakatos Sep 11, 2026
cc6fc3c
fix(credentials): collapse budget TLS verification guard
pallakatos Sep 11, 2026
63ef643
test(bootstrap): attribute private policy errors without raw bodies
pallakatos Sep 11, 2026
c55cc39
Evaluate private namespace activation in the namespace-aware phase
pallakatos Sep 11, 2026
9f5485a
Compose credential activation with current receipt-log foundation
pallakatos Sep 11, 2026
51c2a77
Scope native connection admission transport to absent fixture Pods
pallakatos Sep 11, 2026
2a18945
Model actual Team-owned principal lineage in credential rebind fixtures
pallakatos Sep 11, 2026
ef7b2d8
Attest ownership-only source version transitions without granting wri…
pallakatos Sep 11, 2026
8989299
Keep connection proxy tests importable by native suite discovery
pallakatos Sep 11, 2026
affa124
Use merge-patch media type for native namespace fences
pallakatos Sep 11, 2026
13440b6
Match native projector fixture to shipped capability scope
pallakatos Sep 11, 2026
c73506b
Wait safely for nullable CRD establishment status
pallakatos Sep 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ jobs:
version: v1.30.5
- uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
- name: Check public-schema diagnostic privacy
run: PYTHONPATH=tests/e2e python3 -m unittest sre_authority.registration_schema_test sre_authority.bootstrap_probe_test sre_authority.binding_probe_test sre_authority.legacy_crds_test eval_pod_admission_test receipt_log_rotation_test
run: PYTHONPATH=tests/e2e python3 -m unittest sre_authority.registration_schema_test sre_authority.bootstrap_probe_test sre_authority.binding_probe_test sre_authority.legacy_crds_test sre_authority.connection_proxy_test credential_schema_test credential_policy_schema_test eval_pod_admission_test private_consumption_test receipt_log_rotation_test
- name: Create the same disposable API server as the real harness
run: kind create cluster --name kars-e2e --config tests/e2e/kind-config.yaml --kubeconfig "$KUBECONFIG"
- name: Prove native historical Helm wait orders CRDs before hooks and permits schema upgrades
Expand All @@ -428,7 +428,14 @@ jobs:
- name: Validate the SRE CRD against the actual API server
id: sre_schema
run: python3 tests/e2e/sre_authority/registration_schema.py --exercise
- name: Prove shipped credential CEL with matching and mismatched native namespace UIDs
id: credential_schema
run: PYTHONPATH=tests/e2e python3 -m credential_schema
- name: Prove shipped credential store, rebind and exposure policies against native types
id: credential_policy_schema
run: PYTHONPATH=tests/e2e python3 -m credential_policy_schema
- name: Prove controller Pod admission with all chart policies and no image execution
if: ${{ !cancelled() && steps.sre_schema.outcome == 'success' }}
id: sre_bootstrap
run: PYTHONPATH=tests/e2e python3 -m sre_authority.bootstrap_probe --retirement-bind-proof
- name: Collect nil-schema adapter candidate evidence without weakening production gates
Expand All @@ -447,6 +454,8 @@ jobs:
e2e-sre-schema-diag/legacy-helm-readiness.json
e2e-sre-schema-diag/validation.json
e2e-sre-schema-diag/validation-instances.json
e2e-sre-schema-diag/credential-namespace-uid.json
e2e-sre-schema-diag/credential-policy-typechecking.json
e2e-sre-schema-diag/namespace-accessor-candidate.json
e2e-sre-schema-diag/namespace-accessor-candidate-instances.json
e2e-sre-schema-diag/bootstrap-*.json
Expand All @@ -464,6 +473,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
- run: helm lint deploy/helm/kars
- run: python3 tools/private-consumption-bundle.py --check
- name: Preserve task admission defaults with reused legacy values
run: python3 ci/helm-task-floor-compat.py
- name: Render installation profiles
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ serde_yaml = "0.9"

# Azure identity (via REST — no SDK dependency)
jsonwebtoken = { version = "10", features = ["rust_crypto"] }
rsa = "0.9.10"

# Observability
tracing = "0.1"
Expand Down
99 changes: 99 additions & 0 deletions cli/src/commands/credential-grants.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { describe, expect, it, vi } from "vitest";
import { agentCredentialKey, validateGrantDocument } from "./credential-grants.js";
import { createHash } from "node:crypto";
import { bundleDefinition, previewPrivateActivation } from "../lib/private-activation.js";

async function fixture() {
const objects:Record<string,any>={
"namespace//work":{metadata:{name:"work",uid:"work-uid",resourceVersion:"1"}},
"namespace//bridge":{metadata:{name:"bridge",uid:"bridge-uid",resourceVersion:"1"}},
"namespace//core":{metadata:{name:"core",uid:"core-uid",resourceVersion:"1"}},
"serviceaccount/core/kars-controller":{metadata:{name:"kars-controller",namespace:"core",uid:"controller-sa",resourceVersion:"1"}},
"deployment/core/kars-controller":{kind:"Deployment",metadata:{name:"kars-controller",namespace:"core",uid:"controller",resourceVersion:"1"},
spec:{template:{metadata:{},spec:{serviceAccountName:"kars-controller",containers:[{name:"controller",image:"fixture"}]}}}},
"serviceaccount/bridge/bff":{metadata:{name:"bff",namespace:"bridge",uid:"writer-uid",resourceVersion:"1"}},
"secret/work/kars-inference-providers":{type:"Opaque",metadata:{name:"kars-inference-providers",namespace:"work",uid:"store-uid",resourceVersion:"2"},
data:{COPILOT_GITHUB_TOKEN:"PRIVATE_VALUE_SENTINEL"}},
};
objects["deployments.apps/core/kars-controller"]=objects["deployment/core/kars-controller"];
for(const [index,definition] of (bundleDefinition().objects as any[]).entries()){
const object=structuredClone(definition);
object.metadata={...object.metadata,uid:`policy-${index}`,resourceVersion:"1",generation:1};
if(object.kind==="ValidatingAdmissionPolicy")object.status={observedGeneration:1,typeChecking:{}};
objects[`${object.kind.toLowerCase()}//${object.metadata.name}`]=object;
}
const execute=vi.fn(async(args:string[])=>{
if(args[0]==="auth")return "yes";
const namespace=args.includes("-n")?args[args.indexOf("-n")+1]:"";
return JSON.stringify(objects[`${args[1]}/${namespace}/${args[2]}`]??null);
});
const document={apiVersion:"kars.azure.com/v1alpha1",kind:"KarsCredentialGrant",
metadata:{name:"workspace",namespace:"work"},
spec:{workspaceUid:"work-uid",writers:[{namespace:"bridge",name:"bff",uid:"writer-uid"}],
agentKeys:["GITHUB_TOKEN"],integrationStores:[{secret:{name:"kars-inference-providers",uid:"store-uid"},purpose:"providers"}],
legacyImports:[],enabled:true}};
const privateActivation=await previewPrivateActivation(execute,"work",document.spec.writers,[],"core","kcm-certificate",[]);
execute.mockClear();
return {objects,execute,document:{...document,spec:{...document.spec,privateActivation}}};
}

describe("operator credential grant preflight",()=>{
it("accepts reviewed identities without mutation or echoing credential values",async()=>{
const f=await fixture();
await validateGrantDocument(f.execute,f.document);
expect(f.execute.mock.calls.every(([args])=>["get","auth"].includes(args[0]!))).toBe(true);
expect(JSON.stringify(f.document)).not.toContain("PRIVATE_VALUE_SENTINEL");
});
it("allows explicit writer retirement without disabling existing delivery authority",async()=>{
const f=await fixture();
f.document.spec.writers=[];
await validateGrantDocument(f.execute,f.document);
expect(f.document.spec.enabled).toBe(true);
expect(f.execute.mock.calls.some(([args])=>args[1]==="serviceaccount")).toBe(false);
expect(f.execute.mock.calls.every(([args])=>["get","auth"].includes(args[0]!))).toBe(true);
});
it.each(["workspace","writer","store"])("rejects replaced %s identities before any mutation",async changed=>{
const f=await fixture();
if(changed==="workspace")f.document.spec.workspaceUid="other";
if(changed==="writer")f.document.spec.writers[0]!.uid="other";
if(changed==="store")f.document.spec.integrationStores[0]!.secret.uid="other";
await expect(validateGrantDocument(f.execute,f.document)).rejects.toThrow(/UID.*changed/);
expect(f.execute.mock.calls.every(([args])=>["get","auth"].includes(args[0]!))).toBe(true);
});
it("rejects grants without operator permission",async()=>{
const f=await fixture();
f.execute.mockResolvedValue("no");
await expect(validateGrantDocument(f.execute,f.document)).rejects.toThrow("operator permission");
expect(f.execute).toHaveBeenCalledTimes(1);
});
it("rejects raw credential fields and bootstrap-variable grants",async()=>{
const f=await fixture();
await expect(validateGrantDocument(f.execute,{...f.document,spec:{...f.document.spec,data:{TOKEN:"secret"}}}))
.rejects.toThrow("metadata-only");
for(const key of ["NODE_OPTIONS","PATH","LD_PRELOAD","AZURE_CLIENT_SECRET","KARS_ADMIN_TOKEN","OPENAI_API_KEY","JAVA_TOOL_OPTIONS"]){
expect(agentCredentialKey(key),key).toBe(false);
}
expect(agentCredentialKey("GITHUB_TOKEN")).toBe(true);
expect(agentCredentialKey("INTERNAL_SERVICE_SECRET")).toBe(true);
});
it("preflights immutable GitHub source identities and canonical reviewed scope without writes",async()=>{
const f=await fixture();
const name=`kars-github-connection-${createHash("sha256").update("owner").digest("hex").slice(0,16)}`;
f.objects[`configmap/work/${name}`]={metadata:{name,uid:"connection",resourceVersion:"1"},
data:{installation_id:"456",repos:'["owner/repo"]'}};
f.objects["secret/work/kars-github-app"]={type:"Opaque",metadata:{name:"kars-github-app",uid:"app",resourceVersion:"1"},
data:{GITHUB_APP_ID:Buffer.from("123").toString("base64"),GITHUB_APP_PRIVATE_KEY:"PRIVATE_VALUE_SENTINEL"}};
f.document.spec.integrationStores.push({secret:{name:"kars-github-app",uid:"app"},purpose:"github-app"});
const connection={connection:{name,uid:"connection"},appSecret:{name:"kars-github-app",uid:"app"},
appId:"123",ownerSubject:"owner",installationId:456,repositories:["owner/repo"],write:false};
const document={...f.document,spec:{...f.document.spec,githubConnections:[connection]}};
await validateGrantDocument(f.execute,document);
connection.connection.uid="replacement";
await expect(validateGrantDocument(f.execute,document)).rejects.toThrow("review changed");
expect(f.execute.mock.calls.every(([args])=>["get","auth"].includes(args[0]!))).toBe(true);
expect(JSON.stringify(document)).not.toContain("PRIVATE_VALUE_SENTINEL");
});
});
Loading
Loading