@cdot65/prisma-airs 0.1.1 → 0.1.2
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 +64 -7
- package/index.ts +15 -3
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,26 +20,83 @@ OpenClaw plugin for [Prisma AIRS](https://www.paloaltonetworks.com/prisma/ai-run
|
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
|
+
### Install from npm
|
|
24
|
+
|
|
23
25
|
```bash
|
|
24
26
|
openclaw plugins install @cdot65/prisma-airs
|
|
25
27
|
```
|
|
26
28
|
|
|
29
|
+
### Restart Gateway
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# systemd (Linux)
|
|
33
|
+
openclaw gateway restart
|
|
34
|
+
|
|
35
|
+
# or manually
|
|
36
|
+
openclaw gateway stop && openclaw gateway start
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Verify Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Check plugin is loaded
|
|
43
|
+
openclaw plugins list | grep prisma
|
|
44
|
+
|
|
45
|
+
# Check status
|
|
46
|
+
openclaw prisma-airs
|
|
47
|
+
```
|
|
48
|
+
|
|
27
49
|
## Configuration
|
|
28
50
|
|
|
29
51
|
### 1. Set API Key
|
|
30
52
|
|
|
53
|
+
Get your API key from [Strata Cloud Manager](https://docs.paloaltonetworks.com/ai-runtime-security).
|
|
54
|
+
|
|
55
|
+
**Option A: Environment variable**
|
|
56
|
+
|
|
31
57
|
```bash
|
|
32
|
-
export PANW_AI_SEC_API_KEY="your-key
|
|
58
|
+
export PANW_AI_SEC_API_KEY="your-key"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Option B: systemd service (Linux)**
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Create override file
|
|
65
|
+
mkdir -p ~/.config/systemd/user/openclaw-gateway.service.d
|
|
66
|
+
cat > ~/.config/systemd/user/openclaw-gateway.service.d/env.conf << 'EOF'
|
|
67
|
+
[Service]
|
|
68
|
+
Environment=PANW_AI_SEC_API_KEY=your-key-here
|
|
69
|
+
EOF
|
|
70
|
+
|
|
71
|
+
# Reload and restart
|
|
72
|
+
systemctl --user daemon-reload
|
|
73
|
+
openclaw gateway restart
|
|
33
74
|
```
|
|
34
75
|
|
|
35
76
|
### 2. Plugin Config (optional)
|
|
36
77
|
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
78
|
+
```bash
|
|
79
|
+
# Via CLI
|
|
80
|
+
openclaw config set plugins.entries.prisma-airs.config.profile_name "my-profile"
|
|
81
|
+
openclaw config set plugins.entries.prisma-airs.config.app_name "my-app"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Or in `~/.openclaw/openclaw.json`:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"plugins": {
|
|
89
|
+
"entries": {
|
|
90
|
+
"prisma-airs": {
|
|
91
|
+
"config": {
|
|
92
|
+
"profile_name": "default",
|
|
93
|
+
"app_name": "openclaw",
|
|
94
|
+
"reminder_enabled": true
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
43
100
|
```
|
|
44
101
|
|
|
45
102
|
## Usage
|
package/index.ts
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { scan, isConfigured, ScanRequest, ScanResult } from "./src/scanner";
|
|
14
|
+
import { fileURLToPath } from "url";
|
|
15
|
+
import { dirname, join } from "path";
|
|
14
16
|
|
|
15
17
|
// Plugin config interface
|
|
16
18
|
interface PrismaAirsConfig {
|
|
@@ -62,6 +64,7 @@ interface PluginApi {
|
|
|
62
64
|
handler: (params: ScanRequest) => Promise<ScanResult>;
|
|
63
65
|
}) => void;
|
|
64
66
|
registerCli: (setup: (ctx: { program: unknown }) => void, opts: { commands: string[] }) => void;
|
|
67
|
+
registerPluginHooksFromDir?: (dir: string) => void;
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
// Get plugin config from OpenClaw config
|
|
@@ -90,13 +93,22 @@ export default function register(api: PluginApi): void {
|
|
|
90
93
|
`Prisma AIRS plugin loaded (reminder_enabled=${config.reminder_enabled ?? true})`
|
|
91
94
|
);
|
|
92
95
|
|
|
96
|
+
// Register hooks from the hooks directory
|
|
97
|
+
if (api.registerPluginHooksFromDir) {
|
|
98
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
99
|
+
const __dirname = dirname(__filename);
|
|
100
|
+
const hooksDir = join(__dirname, "hooks");
|
|
101
|
+
api.registerPluginHooksFromDir(hooksDir);
|
|
102
|
+
api.logger.info(`Registered hooks from ${hooksDir}`);
|
|
103
|
+
}
|
|
104
|
+
|
|
93
105
|
// Register RPC method for status check
|
|
94
106
|
api.registerGatewayMethod("prisma-airs.status", ({ respond }) => {
|
|
95
107
|
const cfg = getPluginConfig(api);
|
|
96
108
|
const hasApiKey = isConfigured();
|
|
97
109
|
respond(true, {
|
|
98
110
|
plugin: "prisma-airs",
|
|
99
|
-
version: "0.1.
|
|
111
|
+
version: "0.1.2",
|
|
100
112
|
config: {
|
|
101
113
|
profile_name: cfg.profile_name ?? "default",
|
|
102
114
|
app_name: cfg.app_name ?? "openclaw",
|
|
@@ -185,7 +197,7 @@ export default function register(api: PluginApi): void {
|
|
|
185
197
|
const hasKey = isConfigured();
|
|
186
198
|
console.log("Prisma AIRS Plugin Status");
|
|
187
199
|
console.log("-------------------------");
|
|
188
|
-
console.log(`Version: 0.1.
|
|
200
|
+
console.log(`Version: 0.1.2`);
|
|
189
201
|
console.log(`Profile: ${cfg.profile_name ?? "default"}`);
|
|
190
202
|
console.log(`App Name: ${cfg.app_name ?? "openclaw"}`);
|
|
191
203
|
console.log(`Reminder: ${cfg.reminder_enabled ?? true}`);
|
|
@@ -236,7 +248,7 @@ export default function register(api: PluginApi): void {
|
|
|
236
248
|
// Export plugin metadata for discovery
|
|
237
249
|
export const id = "prisma-airs";
|
|
238
250
|
export const name = "Prisma AIRS Security";
|
|
239
|
-
export const version = "0.1.
|
|
251
|
+
export const version = "0.1.2";
|
|
240
252
|
|
|
241
253
|
// Re-export scanner types and functions
|
|
242
254
|
export { scan, isConfigured } from "./src/scanner";
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "prisma-airs",
|
|
3
3
|
"name": "Prisma AIRS Security",
|
|
4
4
|
"description": "AI Runtime Security scanning via Palo Alto Networks - TypeScript implementation with Gateway RPC, agent tool, and bootstrap reminder hook",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.2",
|
|
6
6
|
"hooks": ["hooks/prisma-airs-guard"],
|
|
7
7
|
"configSchema": {
|
|
8
8
|
"type": "object",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdot65/prisma-airs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Prisma AIRS (AI Runtime Security) plugin for OpenClaw - TypeScript implementation with Gateway RPC, agent tool, and bootstrap hook",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|