ai-saas-guard 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/README.zh-CN.md +5 -3
- package/dist/hosted/github-app.d.ts +69 -0
- package/dist/hosted/github-app.js +135 -0
- package/docs/github-action.md +1 -1
- package/docs/github-app-deployment.md +79 -0
- package/docs/github-app-design.md +2 -0
- package/docs/npm-publishing.md +3 -3
- package/docs/project-handoff.md +3 -2
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -73,8 +73,8 @@ The CLI is published on npm as `ai-saas-guard`, and the GitHub Action is availab
|
|
|
73
73
|
| JSON and SARIF output | Available |
|
|
74
74
|
| Composite GitHub Action | Available |
|
|
75
75
|
| Project config | `.ai-saas-guard.json` rule toggles, severity overrides, and fail thresholds |
|
|
76
|
-
| Versioned Action tags | `v0.
|
|
77
|
-
| npm package | `ai-saas-guard@0.
|
|
76
|
+
| Versioned Action tags | `v0.18.0`, `v0` |
|
|
77
|
+
| npm package | `ai-saas-guard@0.18.0` |
|
|
78
78
|
| npm publishing | Trusted Publisher/OIDC, no long-lived publish token |
|
|
79
79
|
|
|
80
80
|
## Quick Start
|
|
@@ -210,6 +210,8 @@ The hosted deployment model is documented in [docs/hosted-deployment-model.md](d
|
|
|
210
210
|
|
|
211
211
|
The hosted service runtime is documented in [docs/hosted-service-runtime.md](docs/hosted-service-runtime.md). It exports `createHostedServiceRuntime` from `ai-saas-guard/hosted/service` and implements the provider-independent service core for signed webhook intake, idempotent queue upsert, read-only worker orchestration, compact report storage, Check Run publication adapters, and worker cleanup planning. It does not deploy a public hosted environment by itself.
|
|
212
212
|
|
|
213
|
+
The hosted GitHub App deployment planner is documented in [docs/github-app-deployment.md](docs/github-app-deployment.md). It exports `planHostedGitHubAppDeployment` from `ai-saas-guard/hosted/github-app`, generates the least-privilege manifest for the first hosted slice, and blocks creation when the release gate, HTTPS URLs, container digest, secret references, permissions, or events are incomplete or unsafe.
|
|
214
|
+
|
|
213
215
|
The hosted operational release gate is documented in [docs/hosted-operational-release-gate.md](docs/hosted-operational-release-gate.md). It defines the hosted-specific CI, replay, queue, worker cleanup, privacy, monitoring, rollback, and incident-response evidence required before any hosted environment is exposed to users. The pure gate evaluator exported from `ai-saas-guard/hosted/contracts` blocks hosted exposure unless every P0 evidence item is fresh, a container digest is recorded, and release notes avoid pentest, certification, and full-audit claims.
|
|
214
216
|
|
|
215
217
|
Hosted uninstall and data deletion behavior is documented in [docs/hosted-uninstall-data-deletion.md](docs/hosted-uninstall-data-deletion.md). It defines repository removal, full app uninstall, compact report deletion, queue cancellation, audit record retention, repeated cleanup, and user-facing deletion wording.
|
|
@@ -222,7 +224,7 @@ A public hosted compact report schema fixture is available at [examples/hosted-c
|
|
|
222
224
|
|
|
223
225
|
The proposed hosted app permission boundary is intentionally narrow: repository contents read, pull requests read, checks write, and metadata read for the first version. Optional PR comments require repository policy opt-in, and broad permissions such as administration, deployments, Actions write, and repository secrets are out of scope.
|
|
224
226
|
|
|
225
|
-
The repository also includes hosted contract helpers and runtime tests for webhook intake order, webhook verification, installation token scoping, durable queue idempotency, compact reports, retention limits, uninstall cleanup, repeated cleanup idempotency, scoped deletion planning, operational release gate blocking,
|
|
227
|
+
The repository also includes hosted contract helpers and runtime tests for webhook intake order, webhook verification, installation token scoping, durable queue idempotency, compact reports, retention limits, uninstall cleanup, repeated cleanup idempotency, scoped deletion planning, operational release gate blocking, provider-independent hosted service orchestration, and GitHub App deployment planning. These helpers do not deploy a public hosted service.
|
|
226
228
|
|
|
227
229
|
Users should prefer the local CLI for private repositories, offline review, or no-account workflows where hosted code processing is not acceptable.
|
|
228
230
|
|
|
@@ -256,7 +258,7 @@ Use `suppressions` for narrower false-positive handling when one rule is noisy o
|
|
|
256
258
|
|
|
257
259
|
## GitHub Action
|
|
258
260
|
|
|
259
|
-
The repo includes a composite Action. Use `v0` for the latest compatible pre-1.0 Action, a specific release tag such as `v0.
|
|
261
|
+
The repo includes a composite Action. Use `v0` for the latest compatible pre-1.0 Action, a specific release tag such as `v0.18.0` for controlled upgrades, or pin a reviewed commit SHA for stricter supply-chain control:
|
|
260
262
|
|
|
261
263
|
```yaml
|
|
262
264
|
name: ai-saas-guard
|
package/README.zh-CN.md
CHANGED
|
@@ -55,7 +55,7 @@ AI 能很快把一个 SaaS 从想法做成可运行的产品。真正难的是
|
|
|
55
55
|
|
|
56
56
|
这个仓库是公开 GitHub 仓库。
|
|
57
57
|
|
|
58
|
-
CLI 已发布到 npm:`ai-saas-guard@0.
|
|
58
|
+
CLI 已发布到 npm:`ai-saas-guard@0.18.0`。GitHub Action 支持 `v0` 浮动标签,也支持固定版本标签,例如 `v0.18.0`。
|
|
59
59
|
|
|
60
60
|
| 模块 | 状态 |
|
|
61
61
|
| --- | --- |
|
|
@@ -66,8 +66,8 @@ CLI 已发布到 npm:`ai-saas-guard@0.17.0`。GitHub Action 支持 `v0` 浮动
|
|
|
66
66
|
| Markdown PR summary | 已可用 |
|
|
67
67
|
| GitHub Action | 已可用 |
|
|
68
68
|
| 项目配置 | `.ai-saas-guard.json` 支持规则开关、severity 覆盖和 fail threshold |
|
|
69
|
-
| 当前版本 | `0.
|
|
70
|
-
| Action 标签 | `v0.
|
|
69
|
+
| 当前版本 | `0.18.0` |
|
|
70
|
+
| Action 标签 | `v0.18.0`、`v0` |
|
|
71
71
|
| npm 发布 | GitHub Actions Trusted Publisher/OIDC,无需长期 npm token |
|
|
72
72
|
|
|
73
73
|
## 快速开始
|
|
@@ -243,6 +243,7 @@ jobs:
|
|
|
243
243
|
相关文档:
|
|
244
244
|
|
|
245
245
|
- [docs/github-app-design.md](docs/github-app-design.md)
|
|
246
|
+
- [docs/github-app-deployment.md](docs/github-app-deployment.md)
|
|
246
247
|
- [docs/hosted-first-service-slice.md](docs/hosted-first-service-slice.md)
|
|
247
248
|
- [docs/hosted-deployment-model.md](docs/hosted-deployment-model.md)
|
|
248
249
|
- [docs/hosted-service-runtime.md](docs/hosted-service-runtime.md)
|
|
@@ -257,6 +258,7 @@ jobs:
|
|
|
257
258
|
- durable scan queue planner:同一个 trusted scan key 的 queued/running/completed job 会复用,不重复排 worker,也不会把源码、diff、secret 或 PR 正文放进队列 payload
|
|
258
259
|
- worker read-only scan planner:只用 trusted identity 规划临时 worker checkout,要求 repository `contents: read`,固定运行 `ai-saas-guard pr-risk --json`,并忽略 PR 正文里的 repo 名、token scope 或命令
|
|
259
260
|
- hosted service runtime:`ai-saas-guard/hosted/service` 导出 `createHostedServiceRuntime`,把签名 webhook intake、幂等 queue upsert、read-only worker 编排、compact report 存储、Check Run 发布 adapter 和 worker cleanup 串成可测试的服务核心;它本身不部署公开 hosted 环境
|
|
261
|
+
- GitHub App deployment planner:`ai-saas-guard/hosted/github-app` 导出 `planHostedGitHubAppDeployment`,生成 first slice 最小权限 manifest,并在 release gate、HTTPS URL、container digest、secret 引用、permission 或 event 不安全时阻止创建
|
|
260
262
|
- webhook event parser
|
|
261
263
|
- check-run summary renderer
|
|
262
264
|
- Check Run publication planner:要求 repository `checks: write`,只从 compact report 生成有长度上限的 Check Run payload,包含 review categories、优先 review 文件、verification steps 和本地 CLI 复现命令;MVP 不发 PR comment
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare const HOSTED_GITHUB_APP_REQUIRED_PERMISSIONS: {
|
|
2
|
+
readonly contents: "read";
|
|
3
|
+
readonly pull_requests: "read";
|
|
4
|
+
readonly checks: "write";
|
|
5
|
+
readonly metadata: "read";
|
|
6
|
+
};
|
|
7
|
+
export declare const HOSTED_GITHUB_APP_EVENTS: readonly ["pull_request", "installation", "installation_repositories"];
|
|
8
|
+
export type HostedGitHubAppPermissionName = keyof typeof HOSTED_GITHUB_APP_REQUIRED_PERMISSIONS;
|
|
9
|
+
export type HostedGitHubAppPermissionValue = "read" | "write" | "none";
|
|
10
|
+
export type HostedGitHubAppEvent = (typeof HOSTED_GITHUB_APP_EVENTS)[number];
|
|
11
|
+
export interface HostedGitHubAppReleaseGateSummary {
|
|
12
|
+
shouldExposeHostedEnvironment: boolean;
|
|
13
|
+
blocked: boolean;
|
|
14
|
+
containerImageDigestRecorded: boolean;
|
|
15
|
+
missingEvidenceIds?: string[];
|
|
16
|
+
failedEvidenceIds?: string[];
|
|
17
|
+
staleEvidenceIds?: string[];
|
|
18
|
+
exceptionEvidenceIds?: string[];
|
|
19
|
+
releaseNotesCompliant?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface HostedGitHubAppSecretRefs {
|
|
22
|
+
appId: string;
|
|
23
|
+
privateKey: string;
|
|
24
|
+
webhookSecret: string;
|
|
25
|
+
}
|
|
26
|
+
export interface HostedGitHubAppDeploymentInput {
|
|
27
|
+
appName: string;
|
|
28
|
+
homepageUrl: string;
|
|
29
|
+
webhookUrl: string;
|
|
30
|
+
environment: string;
|
|
31
|
+
containerImageDigest: string;
|
|
32
|
+
secretRefs: HostedGitHubAppSecretRefs;
|
|
33
|
+
releaseGate: HostedGitHubAppReleaseGateSummary;
|
|
34
|
+
setupUrl?: string;
|
|
35
|
+
callbackUrl?: string;
|
|
36
|
+
requestedPermissions?: Record<string, HostedGitHubAppPermissionValue>;
|
|
37
|
+
requestedEvents?: string[];
|
|
38
|
+
rawPrivateKey?: string;
|
|
39
|
+
rawWebhookSecret?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface HostedGitHubAppManifest {
|
|
42
|
+
name: string;
|
|
43
|
+
url: string;
|
|
44
|
+
hook_attributes: {
|
|
45
|
+
url: string;
|
|
46
|
+
active: true;
|
|
47
|
+
};
|
|
48
|
+
redirect_url?: string;
|
|
49
|
+
setup_url?: string;
|
|
50
|
+
public: false;
|
|
51
|
+
default_permissions: typeof HOSTED_GITHUB_APP_REQUIRED_PERMISSIONS;
|
|
52
|
+
default_events: HostedGitHubAppEvent[];
|
|
53
|
+
}
|
|
54
|
+
export interface HostedGitHubAppDeploymentPlan {
|
|
55
|
+
readyToCreateGitHubApp: boolean;
|
|
56
|
+
blockedReasons: string[];
|
|
57
|
+
environment: string;
|
|
58
|
+
containerImageDigest: string;
|
|
59
|
+
manifest: HostedGitHubAppManifest;
|
|
60
|
+
requiredSecretRefs: string[];
|
|
61
|
+
deploymentSteps: string[];
|
|
62
|
+
privacy: {
|
|
63
|
+
includesPrivateKey: false;
|
|
64
|
+
includesWebhookSecret: false;
|
|
65
|
+
includesClientSecret: false;
|
|
66
|
+
includesCustomerPayloads: false;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export declare function planHostedGitHubAppDeployment(input: HostedGitHubAppDeploymentInput): HostedGitHubAppDeploymentPlan;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export const HOSTED_GITHUB_APP_REQUIRED_PERMISSIONS = {
|
|
2
|
+
contents: "read",
|
|
3
|
+
pull_requests: "read",
|
|
4
|
+
checks: "write",
|
|
5
|
+
metadata: "read"
|
|
6
|
+
};
|
|
7
|
+
export const HOSTED_GITHUB_APP_EVENTS = [
|
|
8
|
+
"pull_request",
|
|
9
|
+
"installation",
|
|
10
|
+
"installation_repositories"
|
|
11
|
+
];
|
|
12
|
+
export function planHostedGitHubAppDeployment(input) {
|
|
13
|
+
const blockedReasons = [
|
|
14
|
+
...releaseGateBlockedReasons(input.releaseGate),
|
|
15
|
+
...containerDigestBlockedReasons(input.containerImageDigest),
|
|
16
|
+
...urlBlockedReasons("homepage_url", input.homepageUrl),
|
|
17
|
+
...urlBlockedReasons("webhook_url", input.webhookUrl),
|
|
18
|
+
...optionalUrlBlockedReasons("setup_url", input.setupUrl),
|
|
19
|
+
...optionalUrlBlockedReasons("callback_url", input.callbackUrl),
|
|
20
|
+
...secretRefBlockedReasons(input.secretRefs),
|
|
21
|
+
...permissionBlockedReasons(input.requestedPermissions),
|
|
22
|
+
...eventBlockedReasons(input.requestedEvents)
|
|
23
|
+
];
|
|
24
|
+
const manifest = {
|
|
25
|
+
name: input.appName.trim() || "AI SaaS Guard Hosted",
|
|
26
|
+
url: input.homepageUrl,
|
|
27
|
+
hook_attributes: {
|
|
28
|
+
url: input.webhookUrl,
|
|
29
|
+
active: true
|
|
30
|
+
},
|
|
31
|
+
...(input.callbackUrl ? { redirect_url: input.callbackUrl } : {}),
|
|
32
|
+
...(input.setupUrl ? { setup_url: input.setupUrl } : {}),
|
|
33
|
+
public: false,
|
|
34
|
+
default_permissions: HOSTED_GITHUB_APP_REQUIRED_PERMISSIONS,
|
|
35
|
+
default_events: [...HOSTED_GITHUB_APP_EVENTS]
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
readyToCreateGitHubApp: blockedReasons.length === 0,
|
|
39
|
+
blockedReasons,
|
|
40
|
+
environment: input.environment,
|
|
41
|
+
containerImageDigest: input.containerImageDigest,
|
|
42
|
+
manifest,
|
|
43
|
+
requiredSecretRefs: safeSecretRefs(input.secretRefs),
|
|
44
|
+
deploymentSteps: [
|
|
45
|
+
"Create the GitHub App from the generated least-privilege manifest.",
|
|
46
|
+
"Store the App ID, private key, and webhook secret in the platform secret manager.",
|
|
47
|
+
"Deploy webhook ingress and scan worker containers with the recorded image digest.",
|
|
48
|
+
"Run the hosted operational release gate against the deployed artifact before exposure."
|
|
49
|
+
],
|
|
50
|
+
privacy: {
|
|
51
|
+
includesPrivateKey: false,
|
|
52
|
+
includesWebhookSecret: false,
|
|
53
|
+
includesClientSecret: false,
|
|
54
|
+
includesCustomerPayloads: false
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function releaseGateBlockedReasons(gate) {
|
|
59
|
+
return gate.shouldExposeHostedEnvironment &&
|
|
60
|
+
!gate.blocked &&
|
|
61
|
+
gate.containerImageDigestRecorded &&
|
|
62
|
+
gate.releaseNotesCompliant !== false
|
|
63
|
+
? []
|
|
64
|
+
: ["release_gate_blocked"];
|
|
65
|
+
}
|
|
66
|
+
function containerDigestBlockedReasons(containerImageDigest) {
|
|
67
|
+
return /^sha256:[a-f0-9]{64}$/i.test(containerImageDigest)
|
|
68
|
+
? []
|
|
69
|
+
: ["invalid_container_image_digest"];
|
|
70
|
+
}
|
|
71
|
+
function urlBlockedReasons(name, value) {
|
|
72
|
+
return isSafeHttpsUrl(value) ? [] : [`invalid_${name}`];
|
|
73
|
+
}
|
|
74
|
+
function optionalUrlBlockedReasons(name, value) {
|
|
75
|
+
if (!value) {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
return urlBlockedReasons(name, value);
|
|
79
|
+
}
|
|
80
|
+
function isSafeHttpsUrl(value) {
|
|
81
|
+
try {
|
|
82
|
+
const url = new URL(value);
|
|
83
|
+
return url.protocol === "https:" && url.hostname !== "localhost" && url.hostname !== "127.0.0.1";
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function secretRefBlockedReasons(secretRefs) {
|
|
90
|
+
const reasons = [];
|
|
91
|
+
for (const key of ["appId", "privateKey", "webhookSecret"]) {
|
|
92
|
+
const value = secretRefs[key];
|
|
93
|
+
if (!value.trim()) {
|
|
94
|
+
reasons.push(`missing_secret_ref:${key}`);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (looksLikeRawSecretMaterial(value)) {
|
|
98
|
+
reasons.push(`raw_secret_material:${key}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return reasons;
|
|
102
|
+
}
|
|
103
|
+
function looksLikeRawSecretMaterial(value) {
|
|
104
|
+
return /-----BEGIN [A-Z ]*PRIVATE KEY-----|whsec_|gh[opurs]_|github_pat_/i.test(value);
|
|
105
|
+
}
|
|
106
|
+
function permissionBlockedReasons(requestedPermissions) {
|
|
107
|
+
if (!requestedPermissions) {
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
const reasons = [];
|
|
111
|
+
for (const permission of Object.keys(requestedPermissions).sort()) {
|
|
112
|
+
if (!(permission in HOSTED_GITHUB_APP_REQUIRED_PERMISSIONS)) {
|
|
113
|
+
reasons.push(`permission_not_allowed:${permission}`);
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
const requiredValue = HOSTED_GITHUB_APP_REQUIRED_PERMISSIONS[permission];
|
|
117
|
+
if (requestedPermissions[permission] !== requiredValue) {
|
|
118
|
+
reasons.push(`permission_not_allowed:${permission}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return reasons;
|
|
122
|
+
}
|
|
123
|
+
function eventBlockedReasons(requestedEvents) {
|
|
124
|
+
if (!requestedEvents) {
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
const allowedEvents = new Set(HOSTED_GITHUB_APP_EVENTS);
|
|
128
|
+
return [...new Set(requestedEvents)]
|
|
129
|
+
.filter((event) => !allowedEvents.has(event))
|
|
130
|
+
.sort()
|
|
131
|
+
.map((event) => `event_not_allowed:${event}`);
|
|
132
|
+
}
|
|
133
|
+
function safeSecretRefs(secretRefs) {
|
|
134
|
+
return [secretRefs.appId, secretRefs.privateKey, secretRefs.webhookSecret].filter((value) => value.trim() && !looksLikeRawSecretMaterial(value));
|
|
135
|
+
}
|
package/docs/github-action.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`ai-saas-guard` ships as a composite GitHub Action for pull request and code scanning workflows.
|
|
4
4
|
|
|
5
|
-
Use `zr9959/ai-saas-guard@v0` for the latest compatible pre-1.0 Action. Use a specific tag such as `v0.
|
|
5
|
+
Use `zr9959/ai-saas-guard@v0` for the latest compatible pre-1.0 Action. Use a specific tag such as `v0.18.0` or a reviewed commit SHA when reproducibility is more important than automatic minor updates.
|
|
6
6
|
|
|
7
7
|
## PR Summary
|
|
8
8
|
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Hosted GitHub App Deployment
|
|
2
|
+
|
|
3
|
+
This document defines the GitHub App deployment planner now implemented in `src/hosted/github-app.ts`.
|
|
4
|
+
|
|
5
|
+
It does not create a GitHub App by itself. GitHub App creation still requires a real HTTPS webhook URL, a deployed hosted service artifact, platform secret storage, and a human owner or automation account with permission to create the app in GitHub. The planner makes those requirements explicit and blocks unsafe or incomplete deployment input.
|
|
6
|
+
|
|
7
|
+
## What Exists
|
|
8
|
+
|
|
9
|
+
The deployment planner exports `planHostedGitHubAppDeployment` from `ai-saas-guard/hosted/github-app`.
|
|
10
|
+
|
|
11
|
+
It creates a least-privilege GitHub App manifest for the first hosted slice:
|
|
12
|
+
|
|
13
|
+
- `contents: read`
|
|
14
|
+
- `pull_requests: read`
|
|
15
|
+
- `checks: write`
|
|
16
|
+
- `metadata: read`
|
|
17
|
+
|
|
18
|
+
Allowed events:
|
|
19
|
+
|
|
20
|
+
- `pull_request`
|
|
21
|
+
- `installation`
|
|
22
|
+
- `installation_repositories`
|
|
23
|
+
|
|
24
|
+
The manifest stays private by default and uses one active webhook URL.
|
|
25
|
+
|
|
26
|
+
## Required Inputs
|
|
27
|
+
|
|
28
|
+
A ready deployment plan requires:
|
|
29
|
+
|
|
30
|
+
- app name
|
|
31
|
+
- HTTPS homepage URL
|
|
32
|
+
- HTTPS webhook URL
|
|
33
|
+
- hosted environment name
|
|
34
|
+
- `sha256:<digest>` container image digest
|
|
35
|
+
- secret reference for GitHub App ID
|
|
36
|
+
- secret reference for GitHub App private key
|
|
37
|
+
- secret reference for webhook secret
|
|
38
|
+
- hosted operational release gate decision that allows hosted exposure
|
|
39
|
+
|
|
40
|
+
Secret references must be platform lookup names such as `platform-ref:github-app-key`, not raw secret values.
|
|
41
|
+
|
|
42
|
+
## Blockers
|
|
43
|
+
|
|
44
|
+
The planner blocks GitHub App creation when:
|
|
45
|
+
|
|
46
|
+
- the hosted release gate is blocked
|
|
47
|
+
- the container image digest is missing or malformed
|
|
48
|
+
- URLs are not HTTPS
|
|
49
|
+
- localhost URLs are used
|
|
50
|
+
- required secret references are missing
|
|
51
|
+
- raw private keys or webhook secrets are passed instead of secret references
|
|
52
|
+
- requested permissions exceed the first-slice permission contract
|
|
53
|
+
- requested events exceed the first-slice event contract
|
|
54
|
+
|
|
55
|
+
## Privacy
|
|
56
|
+
|
|
57
|
+
The deployment plan never returns:
|
|
58
|
+
|
|
59
|
+
- private key material
|
|
60
|
+
- webhook secret values
|
|
61
|
+
- client secret values
|
|
62
|
+
- customer payloads
|
|
63
|
+
|
|
64
|
+
It returns only safe manifest fields, blocker IDs, environment metadata, container digest, secret reference names, and deployment steps.
|
|
65
|
+
|
|
66
|
+
## Deployment Steps
|
|
67
|
+
|
|
68
|
+
When `readyToCreateGitHubApp` is true:
|
|
69
|
+
|
|
70
|
+
1. Create the GitHub App from the generated least-privilege manifest.
|
|
71
|
+
2. Store the App ID, private key, and webhook secret in the platform secret manager.
|
|
72
|
+
3. Deploy webhook ingress and scan worker containers with the recorded image digest.
|
|
73
|
+
4. Run the hosted operational release gate against the deployed artifact before exposure.
|
|
74
|
+
|
|
75
|
+
## Current Status
|
|
76
|
+
|
|
77
|
+
The repository can now produce and validate the deployment plan, but it cannot honestly create a live GitHub App until a public hosted webhook URL, container image digest, and secret manager references exist.
|
|
78
|
+
|
|
79
|
+
The next deployment stage should wire the hosted service runtime to a real platform queue, compact report store, GitHub installation authentication, and Checks API publisher.
|
|
@@ -52,6 +52,8 @@ The hosted deployment model is scoped in [docs/hosted-deployment-model.md](hoste
|
|
|
52
52
|
|
|
53
53
|
The hosted service runtime is scoped in [docs/hosted-service-runtime.md](hosted-service-runtime.md). It implements the provider-independent core for signed webhook intake, idempotent queue upsert, read-only worker orchestration, compact report storage, Check Run publication adapters, and worker cleanup planning. It does not deploy a public hosted environment by itself.
|
|
54
54
|
|
|
55
|
+
The hosted GitHub App deployment planner is scoped in [docs/github-app-deployment.md](github-app-deployment.md). It generates the least-privilege first-slice manifest and blocks creation when release-gate evidence, HTTPS URLs, container digest, secret references, permissions, or events are incomplete or unsafe.
|
|
56
|
+
|
|
55
57
|
The hosted operational release gate is scoped in [docs/hosted-operational-release-gate.md](hosted-operational-release-gate.md). It blocks hosted exposure unless CI, webhook replay, signature verification, token scoping, idempotency, privacy and retention, worker cleanup, monitoring, alerting, rollback, and incident response evidence are fresh for the release candidate.
|
|
56
58
|
|
|
57
59
|
Hosted uninstall and data deletion behavior is scoped in [docs/hosted-uninstall-data-deletion.md](hosted-uninstall-data-deletion.md). It defines repository removal, full app uninstall, compact report deletion, queue cancellation, limited audit record retention, repeated cleanup idempotency, and user-facing deletion wording.
|
package/docs/npm-publishing.md
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
## Current State
|
|
6
6
|
|
|
7
7
|
- Package name: `ai-saas-guard`
|
|
8
|
-
- Current version: `0.
|
|
8
|
+
- Current version: `0.18.0`
|
|
9
9
|
- npm registry state: published at <https://www.npmjs.com/package/ai-saas-guard>
|
|
10
10
|
- First npm-published version: `0.1.1`
|
|
11
|
-
- GitHub Release: `v0.
|
|
11
|
+
- GitHub Release: `v0.18.0`
|
|
12
12
|
- Publish workflow: `.github/workflows/npm-publish.yml`
|
|
13
13
|
- Trusted Publisher: GitHub Actions, `zr9959/ai-saas-guard`, workflow `npm-publish.yml`, allowed action `npm publish`
|
|
14
14
|
- Long-lived npm publish token: not required
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
Use GitHub Actions with npm Trusted Publisher/OIDC:
|
|
19
19
|
|
|
20
|
-
1. Create and review a release tag such as `v0.
|
|
20
|
+
1. Create and review a release tag such as `v0.18.0`.
|
|
21
21
|
2. Publish from the GitHub Release or run the `Publish npm` workflow manually with `ref` set to that tag.
|
|
22
22
|
3. Keep `permissions.id-token: write` in the workflow so npm can exchange the GitHub Actions OIDC identity for a short-lived publish credential.
|
|
23
23
|
4. Run `npm publish --access public` from the workflow. Trusted publishing automatically generates provenance for this public package from this public repository.
|
package/docs/project-handoff.md
CHANGED
|
@@ -58,9 +58,10 @@ Implemented surfaces:
|
|
|
58
58
|
- hosted uninstall and data deletion document defining repository removal, full app uninstall, compact report deletion, queue cancellation, audit record retention, repeated cleanup idempotency, and user-facing deletion wording
|
|
59
59
|
- hosted pricing and packaging document defining open-source CLI boundaries, free/public repo hosted behavior, private repo hosted behavior, PR comments, saved reports, team policy, optional Launch Review, and no pentest/certification/full-audit claims
|
|
60
60
|
- hosted service runtime document and provider-independent runtime core for signed webhook intake, idempotent queue upsert, read-only worker orchestration, compact report storage, Check Run publication adapters, and worker cleanup planning
|
|
61
|
+
- hosted GitHub App deployment planner document and least-privilege manifest planner for required permissions, events, HTTPS URLs, container digest, secret references, and release-gate checks
|
|
61
62
|
- hosted pre-implementation contracts document, hosted compact report fixture, and pure helpers for pull request webhook intake planning, durable scan queue upsert planning, worker read-only scan planning, Check Run publication planning, queue-safe pull request event parsing from trusted GitHub event fields, bounded check-run summary rendering, idempotent queue cleanup planning, worker checkout cleanup planning, retention/deletion cleanup planning, and operational release gate evaluation
|
|
62
63
|
- implementation-ready hosted GitHub App permission contract for required permissions, optional PR comment permissions, selected repository installation, and out-of-scope broad permissions
|
|
63
|
-
- hosted GitHub App contract helpers and tests for webhook intake order, webhook verification, installation token scoping, durable scan queue idempotency, compact reports, retention limits, uninstall cleanup, repeated cleanup idempotency, scoped deletion planning, operational release gate blocking,
|
|
64
|
+
- hosted GitHub App contract helpers and tests for webhook intake order, webhook verification, installation token scoping, durable scan queue idempotency, compact reports, retention limits, uninstall cleanup, repeated cleanup idempotency, scoped deletion planning, operational release gate blocking, provider-independent service runtime orchestration, and GitHub App deployment planning
|
|
64
65
|
- GitHub issue templates for bug reports, false positives, false negatives, rule requests, and public-safe security reports
|
|
65
66
|
- CODEOWNERS for source, tests, docs, workflows, Action, and package metadata
|
|
66
67
|
- JSON output
|
|
@@ -131,7 +132,7 @@ CI:
|
|
|
131
132
|
Publishing:
|
|
132
133
|
|
|
133
134
|
- npm package: `ai-saas-guard`
|
|
134
|
-
- Current release line: `v0.
|
|
135
|
+
- Current release line: `v0.18.0`
|
|
135
136
|
- Publish workflow: `.github/workflows/npm-publish.yml`
|
|
136
137
|
- Trusted Publisher: GitHub Actions for `zr9959/ai-saas-guard`, workflow `npm-publish.yml`
|
|
137
138
|
- Long-lived npm publish tokens should not be required.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-saas-guard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Repo-local launch-readiness scanner for AI-built SaaS apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://github.com/zr9959/ai-saas-guard#readme",
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
"./hosted/service": {
|
|
38
38
|
"types": "./dist/hosted/service.d.ts",
|
|
39
39
|
"default": "./dist/hosted/service.js"
|
|
40
|
+
},
|
|
41
|
+
"./hosted/github-app": {
|
|
42
|
+
"types": "./dist/hosted/github-app.d.ts",
|
|
43
|
+
"default": "./dist/hosted/github-app.js"
|
|
40
44
|
}
|
|
41
45
|
},
|
|
42
46
|
"bin": {
|