/glean-pack:glean-security-basicsfrom glean-pack
Token security: Indexing tokens have write access -- never expose in frontend. Trigger: "glean security basics", "security-basics".
Ships in glean-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Glean indexes and searches across an enterprise's entire knowledge base — Confluence, Google Drive, Slack, GitHub, and dozens more connectors. Security concerns center on indexing token management (write-access tokens that can push content into the search index), client token scoping (user-level search permissions), and document-level access controls. A leaked indexing token allows injecting arbitrary content into enterprise search results.
function createGleanClient(tokenType: "indexing" | "client"): { token: string; baseUrl: string } {
const token = tokenType === "indexing"
? process.env.GLEAN_INDEXING_TOKEN
: process.env.GLEAN_CLIENT_TOKEN;
if (!token) {
throw new Error(`Missing GLEAN_${tokenType.toUpperCase()}_TOKEN — store in secrets manager`);
}
// Indexing tokens have WRITE access — never expose in frontend code
if (tokenType === "indexing") {
console.log("WARNING: Indexing token loaded — backend use only");
}
return { token, baseUrl: `https://${process.env.GLEAN_INSTANCE}.glean.com/api` };
}
import crypto from "crypto";
import { Request, Response, NextFunction } from "express";
function verifyGleanWebhook(req: Request, res: Response, next: NextFunction): void {
const signature = req.headers["x-glean-signature"] as string;
const secret = process.env.GLEAN_WEBHOOK_SECRET!;
const expected = crypto.createHmac("sha256", secret).update(req.body).digest("hex");
if (!signature || !crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
res.status(401).send("Invalid signature");
return;
}
next();
}
import { z } from "zod";
const IndexDocumentSchema = z.object({
datasource: z.string().min(1).max(100),
document_id: z.string().min(1).max(500),
title: z.string().min(1).max(500),
body: z.string().max(1_000_000),
allowed_users: z.array(z.string().email()).optional(),
allowed_groups: z.array(z.string()).optional(),
permissions_type: z.enum(["public", "restricted", "private"]).default("restricted"),
});
function validateIndexDocument(data: unknown) {
return IndexDocumentSchema.parse(data);
}
const GLEAN_SENSITIVE_FIELDS = ["indexing_token", "client_token", "document_body", "user_query", "search_results"];
function redactGleanLog(record: Record<string, unknown>): Record<string, unknown> {
const redacted = { ...record };
for (const field of GLEAN_SENSITIVE_FIELDS) {
if (field in redacted) redacted[field] = "[REDACTED]";
}
return redacted;
}
X-Glean-Auth-Type headerallowedUsers/allowedGroups| Vulnerability | Risk | Mitigation |
|---|---|---|
| Leaked indexing token | Arbitrary content injected into search index | Backend-only storage + rotation |
| Missing document permissions | Confidential docs exposed in search results | allowedUsers/allowedGroups on every document |
| Client token in frontend | User impersonation in search queries | Server-side proxy for search API |
| Overly broad connector scope | Sensitive repos/channels indexed unintentionally | Per-connector permission review |
| Search queries in logs | Employee activity surveillance risk | Query redaction in logging pipeline |
See glean-prod-checklist.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub flight505/skill-forge --plugin glean-pack24 skills in this plugin
/glean-ci-integrationCI/CD for Glean connectors with automated indexing tests and search quality validation.
Trigger: "glean CI", "glean GitHub Actions", "glean connector CI/CD".
/glean-common-errorsDiagnose and fix common Glean API errors including indexing failures, search issues, and permission problems.
Trigger: "glean error", "glean not indexing", "glean search empty", "debug glean".
/glean-core-workflow-aExecute Glean primary workflow: search, chat, and AI-powered answers across enterprise data.
Use when building search integrations, implementing Glean chat, or creating AI assistants.
Trigger: "glean search API", "glean chat", "glean AI answers", "enterprise search".
/glean-core-workflow-bExecute Glean secondary workflow: bulk document indexing, custom datasource connectors,
and content lifecycle management via the Indexing API.
Trigger: "glean bulk index", "glean custom connector", "glean datasource", "glean indexing".
/glean-cost-tuningOptimize Glean costs by managing indexed content volume, datasource efficiency,
and connector resource usage.
Trigger: "glean costs", "glean optimization", "reduce glean indexing".
/glean-data-handlingPII filtering: strip emails, phone numbers, SSNs from document body before indexing.
Trigger: "glean data handling", "data-handling".