Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
eb7a64d
feat(app): add security vulnerability report module
claudfuen Feb 27, 2026
fa690f4
fix(app): stabilize shell tooltip and menu ids
claudfuen Feb 27, 2026
d2df06e
fix(app): wrap shell tooltips in provider for hydration
claudfuen Feb 27, 2026
3216d59
feat(security): add vulnerability reports checkout flow and report pages
claudfuen Feb 27, 2026
2f0546f
feat(security): add vulnerability reports module and checkout flow
claudfuen Feb 27, 2026
5e4c528
feat(security): gate security tab and routes behind feature flag
claudfuen Feb 27, 2026
6a1e273
feat(security): add vulnerability reports flow with mock checkout and…
claudfuen Feb 28, 2026
c26dfbf
fix(security): address review feedback for vulnerability reports
claudfuen Feb 28, 2026
e406e2d
Merge remote-tracking branch 'origin/main' into codex/security-vuln-r…
claudfuen Feb 28, 2026
fbaf81a
fix(app): correct vulnerability report api proxy imports
claudfuen Feb 28, 2026
03d1d6d
fix(app): guard temporal ui url before window.open
claudfuen Feb 28, 2026
e81bad9
fix(app): resolve remaining vulnerability reports build type errors
claudfuen Feb 28, 2026
b0504f8
fix(app): address latest vulnerability reports review feedback
claudfuen Feb 28, 2026
fd7d1df
fix(app): sync active organization before vulnerability report token
claudfuen Feb 28, 2026
a1e89d7
refactor(app): remove vuln-report proxy routes and call Nest directly
claudfuen Feb 28, 2026
7f2a034
fix(api): stop forwarding comp org header to Maced
claudfuen Feb 28, 2026
4e21328
fix(security): harden webhook handling and preserve checkout metadata
claudfuen Feb 28, 2026
7130a1a
feat(api): persist per-job webhook handshake for vuln reports
claudfuen Feb 28, 2026
a6286c2
feat(api): consume Maced-issued webhook tokens for vuln reports
claudfuen Feb 28, 2026
b1558f8
refactor(api): remove maced org mapping from vulnerability reports
claudfuen Mar 1, 2026
a8d3b27
fix(security-reports): address remaining review threads
claudfuen Mar 2, 2026
453c34f
Merge branch 'main' into codex/security-vuln-reports-module
claudfuen Mar 2, 2026
444fa9c
chore(security): rebrand vulnerability reports UI as penetration tests
claudfuen Mar 2, 2026
f7e5e8d
fix(security-reports): enforce org ownership and harden report UI
claudfuen Mar 2, 2026
32b5cbc
fix(api): satisfy build typing in vulnerability report parser
claudfuen Mar 2, 2026
de125b1
docs: add public penetration tests guide
claudfuen Mar 2, 2026
5783f51
chore(security): remove vulnerability report wording from shipped doc…
claudfuen Mar 2, 2026
d437e5d
fix(api): enforce ownership persistence and early list short-circuit
claudfuen Mar 2, 2026
e5225c6
feat(security): rename penetration test routes and add run ownership …
claudfuen Mar 2, 2026
be16674
fix(security): harden pentest create flow and extract Maced client
claudfuen Mar 2, 2026
789fb5e
feat(security): validate Maced client contracts and fix checkout URL …
claudfuen Mar 2, 2026
7273e28
refactor(security): finalize penetration-tests naming and strict prov…
claudfuen Mar 2, 2026
fa663be
chore(security): polish penetration-tests naming and config formatting
claudfuen Mar 2, 2026
77ab81e
fix(security): harden webhook handshake and reduce progress provider …
claudfuen Mar 2, 2026
4151251
feat(api): reconcile penetration webhook by runId and drop orgId query
claudfuen Mar 2, 2026
49f6031
Merge branch 'main' into codex/security-vuln-reports-module
claudfuen Mar 2, 2026
b91d508
fix(api): align webhook trust checks and run ownership migration
claudfuen Mar 2, 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
5 changes: 5 additions & 0 deletions apps/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

## Feature docs

- Security penetration tests integration:
- `src/security-penetration-tests/README.md`

## Project setup

```bash
Expand Down
2 changes: 2 additions & 0 deletions apps/api/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { AssistantChatModule } from './assistant-chat/assistant-chat.module';
import { OrgChartModule } from './org-chart/org-chart.module';
import { TrainingModule } from './training/training.module';
import { EvidenceFormsModule } from './evidence-forms/evidence-forms.module';
import { SecurityPenetrationTestsModule } from './security-penetration-tests/security-penetration-tests.module';

@Module({
imports: [
Expand Down Expand Up @@ -84,6 +85,7 @@ import { EvidenceFormsModule } from './evidence-forms/evidence-forms.module';
TrainingModule,
OrgChartModule,
EvidenceFormsModule,
SecurityPenetrationTestsModule,
],
controllers: [AppController],
providers: [
Expand Down
40 changes: 40 additions & 0 deletions apps/api/src/security-penetration-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Security Penetration Tests (Maced Integration)

This module exposes Comp API endpoints under `/v1/security-penetration-tests` and orchestrates report generation with Maced (`/v1/pentests`).

## Endpoints

- `GET /v1/security-penetration-tests`
- `POST /v1/security-penetration-tests`
- `GET /v1/security-penetration-tests/:id`
- `GET /v1/security-penetration-tests/:id/progress`
- `GET /v1/security-penetration-tests/:id/report`
- `GET /v1/security-penetration-tests/:id/pdf`
- `POST /v1/security-penetration-tests/webhook`

## Required environment variables

- `MACED_API_KEY`: Maced API key used by Nest API when calling provider endpoints.

## Optional environment variables

- `MACED_API_BASE_URL`: Defaults to `https://api.maced.ai`.
- `SECURITY_PENETRATION_TESTS_WEBHOOK_URL`: Base callback URL for Comp webhook endpoint.

## Webhook handshake model

1. On create (`POST /v1/security-penetration-tests`), Maced issues a per-job `webhookToken` and returns it in the create response.
2. Comp does not send a user-provided `webhookToken` upstream; the value is reserved for provider issuance.
3. If callback target resolves to Comp webhook route and Maced returns `webhookToken`, Comp persists a handshake record in `secrets` using name:
- `security_penetration_test_webhook_<reportId>`
4. On webhook receive, Comp:
- resolves org context (`X-Organization-Id` or `orgId`/`organizationId` query),
- resolves token (`webhookToken` query or `X-Webhook-Token` header),
- requires a persisted per-job handshake and verifies token hash match,
- tracks idempotency (`X-Webhook-Id`/`X-Request-Id`, plus payload hash fallback),
- returns `duplicate: true` for replayed webhook events.

## Notes

- Frontend should call Nest API only (no Next.js proxy routes for this feature).
- Provider callbacks to non-Comp webhook URLs are passed through and are not forced to include Comp-specific webhook tokens.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import { IsBoolean, IsOptional, IsString, IsUrl } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class CreatePenetrationTestDto {
@ApiProperty({
description: 'Target URL for the penetration test scan',
example: 'https://app.example.com',
})
@IsUrl()
targetUrl!: string;

@ApiProperty({
description: 'Repository URL containing the target application code',
example: 'https://github.com/org/repo',
required: false,
})
@IsOptional()
@IsUrl()
repoUrl?: string;

@ApiPropertyOptional({
description: 'GitHub token used for cloning private repositories',
required: false,
})
@IsOptional()
@IsString()
githubToken?: string;

@ApiPropertyOptional({
description: 'Optional YAML configuration for the pentest run',
required: false,
})
@IsOptional()
@IsString()
configYaml?: string;

@ApiPropertyOptional({
description: 'Whether to enable pipeline testing mode',
required: false,
default: false,
})
@IsOptional()
@IsBoolean()
pipelineTesting?: boolean;

@ApiPropertyOptional({
description: 'Workspace identifier used by the pentest engine',
required: false,
})
@IsOptional()
@IsString()
workspace?: string;

@ApiPropertyOptional({
description:
'Set false to reject non-mocked checkout flows for strict behavior',
required: false,
default: true,
})
@IsOptional()
@IsBoolean()
mockCheckout?: boolean;

@ApiPropertyOptional({
description: 'Optional webhook URL to notify when report generation completes',
required: false,
})
@IsOptional()
@IsUrl()
webhookUrl?: string;

@ApiPropertyOptional({
description: 'Whether to run the pentest in simulation mode',
required: false,
default: false,
})
@IsOptional()
@IsBoolean()
testMode?: boolean;
}
Loading
Loading