pubnub-security/SKILL.md
Secure PubNub applications with Access Manager v3, end-to-end AES-256 encryption, TLS 1.2+, IP allowlisting, DoS mitigation, and compliance posture (SOC 2, HIPAA, GDPR). Use when designing access control, issuing/revoking tokens, encrypting message and file payloads, hardening network access, or producing compliance evidence. Foundational keyset and rotation concerns are owned by pubnub-keyset-management.
npx skillsauth add pubnub/skills pubnub-securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are the PubNub security specialist. Your role is to help developers secure real-time applications across access control, payload confidentiality, network hardening, and compliance.
Invoke this skill when:
grantToken)Foundational concerns — keyset structure, environment separation, secret-key rotation, demo keys, custom origin — live in pubnub-keyset-management. Do not duplicate that material here. For routing security events to external systems use Events & Actions action targets.
grantToken() with the Secret Key; never put the Secret Key on a client.pubnub.setToken().| Reference | Purpose | |-----------|---------| | access-manager.md | Access Manager v3 setup, token grants, permissions, revocation | | encryption.md | AES-256 message/file encryption, TLS configuration | | security-best-practices.md | Auth patterns, key handling, channel architecture | | ip-whitelisting.md | Restrict sub-key access by source IP / CIDR | | dos-mitigation.md | Rate caps, abuse detection, attack response | | compliance-reports.md | SOC 2, HIPAA, GDPR, ISO 27001 evidence requests |
Cross-references: Built on keysets and the secret key. Pair with Access Manager,
grantToken, and AES-256 / message encryption. For SDK integration (new PubNub(,userId/UUID, listener wiring) see the pub/sub basics and SDK patterns.
const token = await pubnub.grantToken({
ttl: 60,
authorizedUUID: 'user-123',
resources: {
channels: { 'private-room': { read: true, write: true } }
}
});
const pubnub = new PubNub({
subscribeKey: 'sub-c-...',
publishKey: 'pub-c-...',
userId: 'user-123'
});
pubnub.setToken(token);
const pubnub = new PubNub({
subscribeKey: 'sub-c-...',
publishKey: 'pub-c-...',
userId: 'user-123',
cryptoModule: PubNub.CryptoModule.aesCbcCryptoModule({
cipherKey: 'my-secret-cipher-key'
})
});
grantToken() + setToken() for new work; authKey + grant() is legacy.grant_token — model token issuance from a real grant payloadget_sdk_documentation — pull SDK-specific Access Manager and CryptoModule APIs (see intent-to-tool routing)When providing implementations:
grantToken + setToken first; mention legacy authKey only when explicitly asked.tools
Cross-cutting reliability patterns for PubNub apps. Covers reconnect with exponential backoff + jitter, idempotent publish with client-generated message IDs, dedup-on-merge for live + history streams, queue-and-retry for offline writes, and schema versioning of message envelopes. Use during design reviews, when planning offline support, or during incident response when network or delivery reliability is the concern.
testing
Scale PubNub applications for high-volume real-time events using channel groups, wildcard subscriptions, sharding, and large-event readiness. Covers Stream Controller add-on, hard caps, payload coalescing referenced into pubnub-observability, and the engagement model for 10K+ concurrent live events. Persistence/history is owned by pubnub-history.
development
Build real-time multiplayer games with PubNub game state sync
development
Build real-time voting and polling systems with PubNub