sekura 0.2.0 → 0.4.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 +49 -11
- package/dist/api.js +4 -2
- package/dist/auth.js +46 -19
- package/dist/catalogue.js +21 -1
- package/dist/cli.js +12 -7
- package/dist/commands/billing.js +60 -0
- package/dist/commands/init.js +137 -55
- package/dist/commands/login.js +11 -10
- package/dist/commands/pay.js +84 -0
- package/dist/device.js +87 -0
- package/dist/guide.js +150 -102
- package/dist/payment.js +37 -0
- package/dist/skill.js +6 -4
- package/dist/ui.js +60 -0
- package/dist/writers.js +5 -1
- package/package.json +2 -2
- package/skills/sekura/SKILL.md +117 -40
package/skills/sekura/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sekura
|
|
3
3
|
description: Use when the user wants a GitHub repository scanned for vulnerabilities, wants to read scan findings or a report, or wants to put a repository on a recurring Sekura scan. Covers the sekura MCP tools and the rule that every scan and plan is quoted first and started only after the user agrees.
|
|
4
|
-
argument-hint: "[help | repos | scan <owner/repo> | scans | scan-status <scan> | report <scan> | always <owner/repo>]"
|
|
4
|
+
argument-hint: "[help | repos | scan <owner/repo> | scans | scan-status <scan> | findings <scan> | report <scan> | cancel <scan|owner/repo> | always <owner/repo> | schedule <owner/repo> | plans | billing]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Sekura
|
|
@@ -22,15 +22,23 @@ the first word:
|
|
|
22
22
|
- `help`, `-h`, `--help` or `?`: reply with the help text below exactly as written,
|
|
23
23
|
and call no tool.
|
|
24
24
|
- nothing: call `getAccount` and `listRepositories`, summarise who is signed in,
|
|
25
|
-
|
|
26
|
-
then end with "Type `/sekura help` for commands."
|
|
25
|
+
anything the account still needs on sekura.ai, and the repositories Sekura can
|
|
26
|
+
scan, then end with "Type `/sekura help` for commands."
|
|
27
27
|
- `repos`: `listRepositories`.
|
|
28
|
-
- `scan <owner/repo>`: `
|
|
29
|
-
the two-step rule below applies.
|
|
28
|
+
- `scan <owner/repo>`: `quoteScan` for that repository, then the two-step rule below.
|
|
30
29
|
- `scans`: `listScans`.
|
|
31
30
|
- `scan-status <scan>`: `getScan`. `findings <scan>`: `getScanFindings`.
|
|
32
31
|
- `report <scan>`: `getReportLink`.
|
|
33
|
-
- `
|
|
32
|
+
- `cancel <scan>`: `previewCancelScan` with that scan id. `cancel <owner/repo>`:
|
|
33
|
+
`previewCancelPlan` with that repository. An argument with a `/` in it is a
|
|
34
|
+
repository; anything else is a scan id. Then the two-step rule below.
|
|
35
|
+
- `always <owner/repo>`: `quoteAlways` for that repository, then the two-step rule.
|
|
36
|
+
It needs a schedule; if the user gave none, ask when it should run (daily,
|
|
37
|
+
weekly on a weekday, or monthly on the Nth weekday, at what time, in which time
|
|
38
|
+
zone) before quoting. The plan (`tier`) is `always` unless the user asks for
|
|
39
|
+
`plus` or `pro`.
|
|
40
|
+
- `schedule <owner/repo>`: `updateSchedule` for that repository with the schedule
|
|
41
|
+
the user gives; ask for one if they gave none.
|
|
34
42
|
- `plans`: `getPlans`. `billing`: `getBilling`.
|
|
35
43
|
- anything else: treat the whole text as an ordinary request about Sekura.
|
|
36
44
|
|
|
@@ -39,25 +47,28 @@ The help text:
|
|
|
39
47
|
```
|
|
40
48
|
Sekura: AI red team scans for your GitHub repositories
|
|
41
49
|
|
|
42
|
-
/sekura
|
|
43
|
-
/sekura repos
|
|
44
|
-
/sekura scan <owner/repo>
|
|
45
|
-
/sekura scans
|
|
46
|
-
/sekura scan-status <scan>
|
|
47
|
-
/sekura findings <scan>
|
|
48
|
-
/sekura report <scan>
|
|
49
|
-
/sekura
|
|
50
|
-
/sekura
|
|
51
|
-
/sekura
|
|
52
|
-
/sekura
|
|
50
|
+
/sekura account and repositories at a glance
|
|
51
|
+
/sekura repos repositories Sekura can scan
|
|
52
|
+
/sekura scan <owner/repo> quote a scan; it starts only after you agree
|
|
53
|
+
/sekura scans your scans and their status
|
|
54
|
+
/sekura scan-status <scan> one scan's progress
|
|
55
|
+
/sekura findings <scan> a scan's findings, with proof
|
|
56
|
+
/sekura report <scan> link to the report
|
|
57
|
+
/sekura cancel <scan> what cancelling a scan means; cancels only after you agree
|
|
58
|
+
/sekura cancel <owner/repo> the same for a repository's Sekura Always plan
|
|
59
|
+
/sekura always <owner/repo> quote a recurring Sekura Always plan
|
|
60
|
+
/sekura schedule <owner/repo> change when a Sekura Always plan runs
|
|
61
|
+
/sekura plans repositories on a recurring plan
|
|
62
|
+
/sekura billing what is being billed
|
|
63
|
+
/sekura help this list
|
|
53
64
|
|
|
54
65
|
Every scan and plan is quoted first (price and authorization) and started
|
|
55
|
-
only after you say yes.
|
|
56
|
-
https://sekura.ai/app/start
|
|
66
|
+
only after you say yes. Cancelling is shown first too.
|
|
57
67
|
|
|
58
68
|
Setup, in a terminal:
|
|
59
|
-
npx sekura@latest login
|
|
60
|
-
npx sekura@latest status
|
|
69
|
+
npx sekura@latest login sign in again, or pick another repository
|
|
70
|
+
npx sekura@latest status what is connected on this machine
|
|
71
|
+
npx sekura@latest billing your saved cards (--open to change them)
|
|
61
72
|
|
|
62
73
|
Add repositories: https://sekura.ai/app (the Sekura GitHub App)
|
|
63
74
|
Documentation: https://sekura.ai/connect/
|
|
@@ -65,37 +76,103 @@ Documentation: https://sekura.ai/connect/
|
|
|
65
76
|
|
|
66
77
|
## Tools
|
|
67
78
|
|
|
68
|
-
Read,
|
|
79
|
+
The server has eighteen tools. Read, change nothing, no confirmation:
|
|
69
80
|
|
|
70
|
-
- `getAccount`: who is signed in,
|
|
81
|
+
- `getAccount`: who is signed in, whether the Terms are accepted and the email verified, where the Sekura GitHub App is installed, and what is billed. Call it first.
|
|
71
82
|
- `listRepositories`: the repositories the Sekura GitHub App is installed on.
|
|
72
83
|
- `listScans`, `getScan`, `getScanFindings`, `getReportLink`: scans, their status, their findings and the report.
|
|
73
84
|
- `getPlans`, `getBilling`: the repositories on a recurring plan, and a billing summary without card numbers.
|
|
74
85
|
|
|
75
|
-
|
|
86
|
+
Quote, then confirm. The quote changes nothing and charges nothing:
|
|
76
87
|
|
|
77
|
-
- `startScan`: a Sekura Once scan of one repository.
|
|
78
|
-
- `startAlways`: a recurring Sekura Always plan for one repository.
|
|
79
|
-
- `runNow`: bring an Always plan's next scheduled run forward. Charges nothing.
|
|
80
|
-
- `cancelScan`, `cancelPlan`: stop a scan, or end a plan.
|
|
88
|
+
- `quoteScan` → `startScan`: a Sekura Once scan of one repository.
|
|
89
|
+
- `quoteAlways` → `startAlways`: a recurring Sekura Always plan for one repository.
|
|
81
90
|
|
|
82
|
-
|
|
91
|
+
Preview, then act. The preview cancels nothing:
|
|
92
|
+
|
|
93
|
+
- `previewCancelScan` → `cancelScan`: stop a scan inside its five-minute window.
|
|
94
|
+
- `previewCancelPlan` → `cancelPlan`: end a repository's Sekura Always plan.
|
|
95
|
+
|
|
96
|
+
One call, charges nothing:
|
|
83
97
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
tool again with the arguments the preview names (`confirmArguments` in the
|
|
89
|
-
JSON block). Never invent a confirmation argument, and never pass one before the
|
|
90
|
-
user has said yes.
|
|
98
|
+
- `updateSchedule`: change when a repository on Sekura Always is scanned.
|
|
99
|
+
- `runNow`: bring an Always plan's next scheduled run forward. It is one of the plan's own runs, so there is no quote.
|
|
100
|
+
|
|
101
|
+
## The two-step rule
|
|
91
102
|
|
|
92
|
-
A
|
|
93
|
-
|
|
94
|
-
the
|
|
103
|
+
A scan or a plan is never started in one call.
|
|
104
|
+
|
|
105
|
+
1. Call the quote: `quoteScan` with `repository`, or `quoteAlways` with
|
|
106
|
+
`repository`, `schedule` and, if the user chose one, `tier`. It answers with
|
|
107
|
+
prose (what will run, against which repository, the authorization wording,
|
|
108
|
+
the price, and how it can be paid) and a JSON block whose `confirmArguments`
|
|
109
|
+
are the exact arguments of the confirm: for `startScan` the `repository`,
|
|
110
|
+
`disclosureVersion` and `amountCents`; for `startAlways` the same plus
|
|
111
|
+
`schedule` and `tier`.
|
|
112
|
+
2. Show the prose to the user as it stands, including the price and the
|
|
113
|
+
authorization wording, and ask whether they agree. Start nothing until they
|
|
114
|
+
have said yes in the conversation.
|
|
115
|
+
3. Then call `startScan` or `startAlways` with `confirmArguments` exactly as the
|
|
116
|
+
quote returned them, plus the `payment` for the way the user chose to pay (see
|
|
117
|
+
Paying, below). Never invent a `disclosureVersion` or an `amountCents`, never
|
|
118
|
+
reuse one from an older quote, and never call a confirm before the user has
|
|
119
|
+
said yes. A confirm without the `disclosureVersion` is refused.
|
|
120
|
+
|
|
121
|
+
If the confirm is refused because the wording or the price changed, the answer
|
|
122
|
+
carries a fresh quote: show that one to the user and ask again.
|
|
123
|
+
|
|
124
|
+
Cancelling is the same: call `previewCancelScan` (with `scanId`) or
|
|
125
|
+
`previewCancelPlan` (with `planId` or `repository`), show its answer to the
|
|
126
|
+
user, and call `cancelScan` or `cancelPlan` with the same arguments only after
|
|
127
|
+
they agree.
|
|
128
|
+
|
|
129
|
+
`updateSchedule` and `runNow` take one call each and charge nothing; call them
|
|
130
|
+
only when the user has asked for that change.
|
|
131
|
+
|
|
132
|
+
## Paying
|
|
133
|
+
|
|
134
|
+
The quote's `paymentOptions` are the only ways to pay. Show them to the user as a
|
|
135
|
+
numbered list, each by its `label`, in the quote's order, and ask which one they
|
|
136
|
+
want together with whether they agree:
|
|
137
|
+
|
|
138
|
+
- With saved cards: one line per card, masked as the quote gives it (for example
|
|
139
|
+
`Visa •••• •••• •••• 4242`), then `Pay with a Checkout link`, then
|
|
140
|
+
`Change payment method`. Never show more of a card than the quote does.
|
|
141
|
+
- With no saved card: only `Pay with a Checkout link`. The first payment is
|
|
142
|
+
always made in the browser, and the card used there is saved for next time.
|
|
143
|
+
|
|
144
|
+
Then:
|
|
145
|
+
|
|
146
|
+
- **A saved card**: call the confirm with that option's `payment`, which is
|
|
147
|
+
`{ "savedCard": { "card": "pm_…" } }` with the card the user picked. Only that
|
|
148
|
+
card is charged, in place, with no browser. Relay the answer: what was charged
|
|
149
|
+
to which card ("Charged $199 to Visa ending 4242"), the scan id and the link.
|
|
150
|
+
- **Pay with a Checkout link**: call the confirm with no `payment`. It answers 402
|
|
151
|
+
with `checkoutUrl` and `planId`. Run, in the terminal, with a timeout of ten
|
|
152
|
+
minutes:
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
npx sekura@latest pay "<checkoutUrl>" --plan <planId>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
It opens the link in the user's browser (where they are signed in to Sekura)
|
|
159
|
+
and waits until the payment lands, then prints the scan id and link, or that
|
|
160
|
+
Checkout was closed unpaid. Tell the user the page is open and you are
|
|
161
|
+
waiting, then relay what it printed. If the command cannot run here, give the
|
|
162
|
+
user the link to open, and once they say they have paid, call `getPlans` and
|
|
163
|
+
report the plan and its scan.
|
|
164
|
+
- **Change payment method**: starts and charges nothing. Run
|
|
165
|
+
`npx sekura@latest billing --open`, which opens the page where the user adds
|
|
166
|
+
or changes a card and waits for the change. Then call the quote again and show
|
|
167
|
+
its updated list of cards, and ask again.
|
|
168
|
+
|
|
169
|
+
Nothing is charged without a quote and the user's yes, and only the card the user
|
|
170
|
+
picked is charged.
|
|
95
171
|
|
|
96
172
|
## What to tell the user
|
|
97
173
|
|
|
98
|
-
-
|
|
174
|
+
- Through this connection a scan is Sekura Once at the quoted price. Do not mention or offer any free scan.
|
|
175
|
+
- When `getAccount` says the Terms or the email are not done, or the GitHub App is not installed, give the user the sekura.ai link it names; a scan cannot start before that.
|
|
99
176
|
- A scan can take a while. Offer `getScan` to check on it rather than polling in a loop.
|
|
100
177
|
- Findings carry proof. When summarising, keep the evidence the finding gives; do not soften a severity.
|
|
101
178
|
- Sekura scans only repositories the user has granted through the Sekura GitHub App. To add one: https://sekura.ai/app.
|