Skip to content

Commit 0875363

Browse files
authored
Merge pull request #32 from Jeymz/feat-copilot_security_plugin_support
feat: Copilot Security Plugin Support
2 parents a785450 + 7a17da1 commit 0875363

24 files changed

Lines changed: 2593 additions & 211 deletions

File tree

.github/plugin/marketplace.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "copilot-security-instructions",
33
"metadata": {
4-
"description": "Security-focused GitHub Copilot plugin marketplace for AppSec agents and the threat-model skill",
4+
"description": "A collection of instructions and skills for application security tasks, including threat modeling, secure code review, and other appsec activities.",
55
"version": "1.0.0",
66
"pluginRoot": "./plugins"
77
},
@@ -10,10 +10,10 @@
1010
},
1111
"plugins": [
1212
{
13-
"name": "threat-model",
14-
"description": "Performs threat modeling using Mermaid diagrams to validate flowcharts / sequence diagrams for security review",
13+
"name": "copilot-security",
14+
"description": "A plugin that provides application security skills and agents to help developers with threat modeling, secure code review, and other appsec tasks.",
1515
"version": "1.0.0",
16-
"source": "threat-model"
16+
"source": "copilot-security"
1717
}
1818
]
1919
}

README.md

Lines changed: 139 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This project offers:
2222
- **AI hallucination protections** to prevent package spoofing, non-existent APIs, and misinformation risks.
2323
- **Mentorship-style tips** to help newer engineers build secure coding habits.
2424
- **Custom agents & Agent Skills** under `agents/` and `skills/` for repeatable AppSec workflows inside Copilot.
25+
- **An installable GitHub Copilot CLI plugin** under `plugins/copilot-security` for reusable AppSec agents and skills across projects.
2526
- **An MCP server** for seamless integration of these prompts into other projects.
2627

2728
---
@@ -37,7 +38,7 @@ It standardizes intake, then hands off to specialist agents (Analyst/Architect/E
3738

3839
| Prompt | Description | Intended Use |
3940
| --- | --- | --- |
40-
| [access-control-and-authorization-architecutre.prompt.md](prompts/access-control-and-authorization-architecture.prompt.md) | Review and report on access control / authorization architecture for project. | Perform analysis of the current architecture for access control and authorization within the project. |
41+
| [access-control-review.prompt.md](prompts/access-control-review.prompt.md) | Review and report on access control / authorization architecture for project. | Perform analysis of the current architecture for access control and authorization within the project. |
4142
| [assess-logging.prompt.md](prompts/assess-logging.prompt.md) | Identify unsafe logging and exposure of sensitive data. | Audit log output for leaks and recommend safer patterns. |
4243
| [business-logic-review.prompt.md](prompts/business-logic-review.prompt.md) | Analyze overall business logic flow and decision making. | Map application behavior and critique critical logic paths. |
4344
| [check-access-controls.prompt.md](prompts/check-access-controls.prompt.md) | Audit authorization and access control weaknesses. | Ensure RBAC/ABAC enforcement and consistent permission checks. |
@@ -68,39 +69,59 @@ It standardizes intake, then hands off to specialist agents (Analyst/Architect/E
6869
| Skill | Intended use |
6970
| --- | --- |
7071
| [secure-code-review](skills/secure-code-review/SKILL.md) | Repeatable security review workflow + findings template. |
71-
| [authn-authz-review](skills/authn-authz-review/SKILL.md) | Review authentication and authorization controls. |
72+
| [access-control-review](skills/access-control-review/SKILL.md) | Review identity, access control, and authorization architecture with evidence-first reporting. |
7273
| [input-validation-hardening](skills/input-validation-hardening/SKILL.md) | Tighten validation boundaries and parsing safety. |
7374
| [dependency-cve-triage](skills/dependency-cve-triage/SKILL.md) | CVE reachability + remediation plan workflow. |
7475
| [secrets-and-logging-hygiene](skills/secrets-and-logging-hygiene/SKILL.md) | Prevent secret leaks and add redaction defaults. |
7576
| [genai-acceptance-review](skills/genai-acceptance-review/SKILL.md) | Prevent over-trust and prompt/tool injection risks. |
7677
| [threat-model](skills/threat-model/SKILL.md) | Full 4Q threat modeling workflow with CLI-friendly Mermaid docs and validation helpers. |
77-
| [threat-model-lite](skills/threat-model-lite/SKILL.md) | Lightweight threat modeling with ranked mitigations. |
7878
| [secure-fix-validation](skills/secure-fix-validation/SKILL.md) | Prove fixes work and don’t regress behavior. |
7979

80-
For GitHub Copilot CLI users, the `threat-model` skill bundles local Mermaid helper scripts so you can draft diagrams, print syntax guidance, and validate report files without the VS Code Mermaid Chart extension.
81-
8280
## 📦 How to Use in a Real Project
8381

8482
Tip for contributors: when adding a file under `prompts/`, update the Prompt Catalogue table.
8583

86-
### Leveraging Static Files
84+
### Option 1: Leveraging Static Files
85+
86+
This option is best when you want to vendor a fixed set of guidance files directly into a repository instead of installing the reusable CLI plugin.
87+
88+
Copy the components you want from this repository into the matching `.github/` locations in your target project:
89+
90+
| From this repository | Copy into target project | Purpose |
91+
| --- | --- | --- |
92+
| `copilot-instructions.md` | `.github/copilot-instructions.md` | Repository-wide default coding and security guidance |
93+
| `prompts/*.prompt.md` | `.github/prompts/` | Reusable prompt files that can be run directly in Copilot |
94+
| `agents/*.agent.md` | `.github/agents/` | Reusable specialist agents such as analyst, architect, or engineer |
95+
| `skills/**/SKILL.md` and skill-local files | `.github/skills/` | On-demand skills, including any helper scripts kept inside each skill directory |
96+
| `instructions/*.instructions.md` | `.github/instructions/` | Path-specific instructions for matching file globs |
97+
98+
Notes:
99+
100+
- If you copy a skill directory, copy the entire folder, not just `SKILL.md`. Some skills include helper assets or scripts alongside the Markdown file.
101+
- The root-level `instructions/` folder in this repository is currently empty, so there are no path-specific instruction files to copy right now.
102+
- If you only need a subset, copy only the prompts, agents, or skills you plan to use.
103+
104+
1. Copy `copilot-instructions.md` into your repo under `.github/copilot-instructions.md`.
87105

88-
1. Copy the `copilot-instructions.md` file into your repo under:
89-
`.github/copilot-instructions.md`
106+
2. Copy whichever reusable folders and files you want to adopt:
90107

91-
2. Drop the prompts you want into:
92-
`.github/prompts/`
108+
- prompts into `.github/prompts/`
109+
- agents into `.github/agents/`
110+
- skills into `.github/skills/`
111+
- instructions into `.github/instructions/` when this repository provides them
93112

94-
3. Open the prompt you wish to run within your IDE
113+
3. Open the prompt or agent-enabled workflow you want to run within your IDE.
95114

96-
4. Click the `Run Prompt` button to the top-right of the file
115+
4. For prompt files, click the `Run Prompt` button at the top-right of the file.
97116

98117
![Run Prompt Button](images/example-run_prompt.png)
99118

100119
> ℹ️ **Note**: If you don't see the run prompt button; check to make sure the `Chat: Prompt Files` functionality is enabled in your settings
101120
> ![Chat Prompt Files Setting](images/example-chat_prompt_files.png)
102121
103-
### Leveraging the MCP Server
122+
5. For agents and skills, invoke them from Copilot Chat after the files are present in `.github/agents/` and `.github/skills/`.
123+
124+
### Option 2: Leveraging the MCP Server
104125

105126
The MCP server simplifies the integration of secure coding prompts into your workflow. Follow these steps:
106127

@@ -118,29 +139,29 @@ The MCP server simplifies the integration of secure coding prompts into your wor
118139
cp .env.example .env
119140
```
120141

121-
> The MCP server reads configuration from a `.env` file. Customize the following variables as needed:
122-
>
123-
> | Variable | Description | Default |
124-
> | --- | --- | --- |
125-
> | `server.port` | Port the MCP server listens on. | `8080` |
126-
> | `server.ssl` | Whether to use ssl for express server | `false` |
127-
> | `server.ssl.pfx` | Path to pfx file | `localhost.pfx` |
128-
> | `server.ssl.pfx.passphrase` | Passphrase for pfx file | `PFX_PASSPHRASE` |
129-
> | `server.hostname` | Hostname the server binds to. | `localhost` |
130-
> | `logger.transports.console.enabled` | Enable console logging output. | `false` |
131-
> | `logger.transports.console.level` | Log level for console output. | `info` |
132-
> | `logger.transports.amqp.enabled` | Enable AMQP-based logging. | `false` |
133-
> | `logger.transports.amqp.level` | Log level for AMQP transport. | `http` |
134-
> | `logger.transports.amqp.hostname` | Hostname of the AMQP broker. | `localhost` |
135-
> | `logger.transports.amqp.port` | Port for the AMQP broker. | `5672` |
136-
> | `logger.transports.amqp.username` | Username for AMQP authentication. | `guest` |
137-
> | `logger.transports.amqp.password` | Password for AMQP authentication. | `guest` |
138-
> | `logger.transports.amqp.exchange` | Exchange name used for AMQP logging. | `logs` |
139-
> | `logger.transports.amqp.vhost` | Virtual host for AMQP logging. | `/logs` |
140-
> | `logger.transports.amqp.heartbeat` | Heartbeat interval in seconds. | `60` |
141-
> | `logger.transports.amqp.locale` | Locale for the AMQP connection. | `en_US` |
142-
> | `logger.transports.amqp.type` | AMQP exchange type. | `direct` |
143-
> | `logger.transports.amqp.durable` | Whether the AMQP exchange is durable. | `false` |
142+
The MCP server reads configuration from a `.env` file. Customize the following variables as needed:
143+
144+
| Variable | Description | Default |
145+
| --- | --- | --- |
146+
| `server.port` | Port the MCP server listens on. | `8080` |
147+
| `server.ssl` | Whether to use ssl for express server | `false` |
148+
| `server.ssl.pfx` | Path to pfx file | `localhost.pfx` |
149+
| `server.ssl.pfx.passphrase` | Passphrase for pfx file | `PFX_PASSPHRASE` |
150+
| `server.hostname` | Hostname the server binds to. | `localhost` |
151+
| `logger.transports.console.enabled` | Enable console logging output. | `false` |
152+
| `logger.transports.console.level` | Log level for console output. | `info` |
153+
| `logger.transports.amqp.enabled` | Enable AMQP-based logging. | `false` |
154+
| `logger.transports.amqp.level` | Log level for AMQP transport. | `http` |
155+
| `logger.transports.amqp.hostname` | Hostname of the AMQP broker. | `localhost` |
156+
| `logger.transports.amqp.port` | Port for the AMQP broker. | `5672` |
157+
| `logger.transports.amqp.username` | Username for AMQP authentication. | `guest` |
158+
| `logger.transports.amqp.password` | Password for AMQP authentication. | `guest` |
159+
| `logger.transports.amqp.exchange` | Exchange name used for AMQP logging. | `logs` |
160+
| `logger.transports.amqp.vhost` | Virtual host for AMQP logging. | `/logs` |
161+
| `logger.transports.amqp.heartbeat` | Heartbeat interval in seconds. | `60` |
162+
| `logger.transports.amqp.locale` | Locale for the AMQP connection. | `en_US` |
163+
| `logger.transports.amqp.type` | AMQP exchange type. | `direct` |
164+
| `logger.transports.amqp.durable` | Whether the AMQP exchange is durable. | `false` |
144165

145166
3. Start the server
146167

@@ -192,6 +213,88 @@ The MCP server simplifies the integration of secure coding prompts into your wor
192213

193214
**Example:** `Please get and run the secure code review prompt.`
194215

216+
### Option 3: Using the `copilot-security` GitHub Copilot CLI Plugin
217+
218+
This repository ships an installable GitHub Copilot CLI plugin named `copilot-security`.
219+
220+
Plugins are reusable bundles of Copilot components such as agents, skills, hooks, and integrations. In this project, the plugin is published from the official marketplace repository:
221+
222+
- `robotti-io/copilot-security-instructions`
223+
224+
The plugin manifest lives under `plugins/copilot-security/.github/plugin/plugin.json`, and the marketplace manifest for this repository lives under `.github/plugin/marketplace.json`.
225+
226+
#### What the plugin contains
227+
228+
The `copilot-security` plugin currently packages these reusable components:
229+
230+
- Agents:
231+
- `application-security-analyst`
232+
- `application-security-architect`
233+
- Skills:
234+
- `access-control-review`
235+
- `dependency-cve-triage`
236+
- `threat-model`
237+
238+
After installation, these agents and skills are available in any project where you use GitHub Copilot CLI.
239+
240+
#### Install from the official marketplace
241+
242+
GitHub documents CLI plugins here:
243+
244+
- `https://docs.github.com/en/copilot/concepts/agents/copilot-cli/about-cli-plugins`
245+
- `https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/plugins-finding-installing`
246+
247+
To register this repository as a plugin marketplace and install the `copilot-security` plugin:
248+
249+
```bash
250+
copilot plugin marketplace add robotti-io/copilot-security-instructions
251+
copilot plugin marketplace list
252+
copilot plugin marketplace browse copilot-security-instructions
253+
copilot plugin install copilot-security@copilot-security-instructions
254+
```
255+
256+
Notes:
257+
258+
- `robotti-io/copilot-security-instructions` is the marketplace repository reference you add.
259+
- `copilot-security-instructions` is the marketplace name exposed by this repository's `marketplace.json`.
260+
- `copilot-security` is the plugin name exposed by `plugins/copilot-security/.github/plugin/plugin.json`.
261+
262+
#### Install directly from the repository
263+
264+
If you do not want to register the marketplace first, you can install the plugin directly from this repository by pointing Copilot CLI at the plugin subdirectory:
265+
266+
```bash
267+
copilot plugin install robotti-io/copilot-security-instructions:plugins/copilot-security
268+
```
269+
270+
This form is required because the plugin manifest is stored in a plugin subdirectory, not at the repository root.
271+
272+
#### Install from a local checkout
273+
274+
For local development or testing from a cloned copy of this repository:
275+
276+
```bash
277+
copilot plugin install ./plugins/copilot-security
278+
```
279+
280+
#### Manage the installed plugin
281+
282+
Use the standard Copilot CLI plugin commands:
283+
284+
```bash
285+
copilot plugin list
286+
copilot plugin update copilot-security
287+
copilot plugin uninstall copilot-security
288+
copilot plugin marketplace remove copilot-security-instructions
289+
```
290+
291+
You can also get command help with:
292+
293+
```bash
294+
copilot plugin --help
295+
copilot plugin install --help
296+
```
297+
195298
---
196299

197300
## 📚 Languages Supported

plugins/threat-model/.github/plugin/plugin.json renamed to plugins/copilot-security/.github/plugin/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "threat-model",
3-
"description": "Performs threat modeling using Mermaid diagrams to validate flowcharts / sequence diagrams for security review",
2+
"name": "copilot-security",
3+
"description": "A plugin that provides application security skills and agents to help developers with threat modeling, secure code review, and other appsec tasks.",
44
"version": "1.0.0",
55
"keywords": [
66
"security",
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: application-security-analyst
3+
description: Triage and explain application security risks. Produces actionable findings and guidance without making code changes.
4+
tools: ['vscode', 'read', 'search', 'web', 'agent', 'todo']
5+
model: GPT-5.4
6+
---
7+
8+
You are an **Application Security Analyst** embedded with a delivery team. Your job is to **find, explain, and prioritize security risks** in code and configurations, and to give **clear, developer-friendly guidance** for fixes.
9+
10+
## Operating principles
11+
12+
- Be **practical**: focus on issues that matter in real deployments and plausible threat models.
13+
- Be **precise**: point to exact files, functions, lines, inputs/outputs, and trust boundaries.
14+
- Be **actionable**: provide reproduction steps, impact, and recommended fixes.
15+
- Be **conservative with scope**: you do **not** implement code changes. You may suggest diffs, but you must not edit files.
16+
17+
## Default workflow
18+
19+
1. **Clarify context (minimal):** identify component (API, web, worker), data sensitivity (PII, auth), environment (prod vs dev), and attacker model (external, internal, multi-tenant).
20+
2. **Inventory entry points & assets:**
21+
- Inputs: HTTP params/body/headers, message queues, files, environment variables, deserialization, templates.
22+
- Assets: secrets, tokens, PII, financial data, privileged actions.
23+
3. **Review with a security lens:**
24+
- Injection (SQL/NoSQL/OS/template), authn/authz, SSRF, XSS, CSRF, deserialization, path traversal, file upload, crypto misuse, secrets/logging, supply chain.
25+
4. **Produce findings in a standard format** (below), ranked by risk and fix cost.
26+
5. **Recommend next actions**: quick wins, tests, monitoring, and who should own the fix.
27+
28+
## Output format (use this exact structure)
29+
30+
### Summary
31+
32+
- What you reviewed
33+
- Top risks (3–5 bullets)
34+
- Overall risk rating: Low / Medium / High / Critical
35+
36+
### Findings
37+
38+
For each finding, include:
39+
40+
- **Title**
41+
- **Severity** (Critical/High/Medium/Low) and **confidence** (High/Medium/Low)
42+
- **Where** (file + function + relevant snippet description)
43+
- **Risk** (what could happen, who can do it, required preconditions)
44+
- **How to reproduce** (steps or a request example)
45+
- **Recommendation** (specific fix guidance)
46+
- **Verification** (how to test the fix)
47+
48+
### Notes
49+
50+
- Assumptions
51+
- Out-of-scope items
52+
- Follow-ups / questions for the team
53+
54+
## Repo-specific helpers (optional)
55+
56+
If the repository contains prompt files under `/prompts`, you may reference them by name (e.g., `secure-code-review.prompt.md`) and suggest the developer run them in Copilot.

plugins/threat-model/agents/application-security-architect.md renamed to plugins/copilot-security/agents/application-security-architect,agent.md

File renamed without changes.

0 commit comments

Comments
 (0)