.claude/skills/klytos-security-architecture/SKILL.md
Security architecture and best practices for Klytos CMS. Use when dealing with authentication, encryption, access control, CSRF protection, rate limiting, security headers, HTTPS, or security hardening. Essential for secure development and understanding Klytos security model.
npx skillsauth add joseconti/klytos klytos-security-architectureInstall 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.
CRITICAL: The admin panel URL is SECRET. It must NEVER be discoverable from the public-facing site.
/ ← Web root (public-facing)
├── index.html ← Redirect or landing page
├── assets/ ← Public assets (CSS, JS, images, fonts)
│ ├── css/
│ ├── js/
│ ├── images/
│ └── fonts/
├── sitemap.xml ← Search engine sitemap
├── robots.txt ← Crawler directives
├── llms.txt ← AI indexing summary
├── llms-full.txt ← AI indexing full content
│
└── {random-admin-name}/ ← SECRET admin directory (e.g. "x7k9m2-panel")
├── .htaccess ← Routes all requests, blocks sensitive dirs
├── index.php ← Front controller
├── install.php ← Installer (renamed after use)
├── t.php ← Analytics pixel
├── config/ ← BLOCKED by .htaccess
├── core/ ← BLOCKED by .htaccess
├── data/ ← BLOCKED by .htaccess
├── backups/ ← BLOCKED by .htaccess
├── plugins/ ← PHP blocked, assets allowed
├── admin/ ← Admin panel (requires auth)
├── public/ ← Generated static site (served via .htaccess)
└── templates/ ← HTML templates (BLOCKED)
No admin URL leaks: Generated HTML pages NEVER contain references to the admin URL.
<meta name="generator"> says "Klytos" but NOT the admin path.Public assets are separate: CSS, JS, images, and fonts for the public site
live in /assets/ at the web root, NOT inside the admin directory.
Build output goes to root: The build engine writes HTML pages to the web root
and assets to /assets/. The admin directory is never exposed.
Admin URL is configured during installation: The directory name is chosen by the user or auto-generated. It should be random and non-guessable.
random_bytes(32) (CSPRNG).config/.encryption_key with chmod 0600.Encryption::rotateKey().The site admin chooses an encryption level during installation. It determines which data is encrypted at rest:
| Level | What is encrypted | |---|---| | Basic | System config only (config.json.enc, license, AI keys, MCP tokens) | | Medium | + Users, audit logs, sessions, chats, 2FA (GDPR-relevant data) | | Professional | + ALL data (pages, blocks, templates, theme, menus, forms, logs, etc.) |
The level can be changed bidirectionally from Settings > Security (requires re-auth).
Plugins declare the sensitivity of their options via klytos_register_option(). This provides per-option encryption control independent of the site-wide encryption level:
| Sensitivity | Encrypted at | Example |
|---|---|---|
| true | Always (all levels) | API keys, tokens, webhook secrets |
| 'user_data' | Medium + Professional | Emails, IPs, personal data (GDPR) |
| false (default) | Professional only | Colors, toggles, non-sensitive settings |
klytos_register_option('my-plugin.stripe_key', true); // Always encrypted
klytos_register_option('my-plugin.user_email', 'user_data'); // Encrypted from medium
klytos_register_option('my-plugin.color', false); // Only at professional
config/admin-identity.pub.enc (encrypted with AES).config/admin-identity.priv.enc (encrypted with AES).klytos-identity.pem — downloaded during installation, used with klytos-encryption.key for emergency access recovery via the unified installer.Order of authentication in token-auth.php:
Authorization: Bearer <token> → tokens.json.encAuthorization: Bearer <token> → oauth_tokens.json.encAuthorization: Basic base64(user:pass) → app_passwords.json.enc$auth->validateCsrf($token).X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Referrer-Policy: strict-origin-when-cross-origin
Content-Security-Policy: [with nonce support]
Permissions-Policy: camera=(), microphone=(), geolocation=()
Blocks direct access to:
config/ (encryption keys, credentials)core/ (PHP source code)data/ (encrypted data files)backups/ (backup archives)templates/ (HTML templates).enc files (encrypted data).encryption_key (master key).install.lock (installation lock)VERSION fileEvery significant action is logged with:
Retention: 90 days (configurable), auto-pruned by CronManager.
development
Guide for working with dates, times, and timezones in Klytos CMS. Use when formatting dates, converting timezones, scheduling actions with timestamps, displaying local time, working with UTC storage, building timezone selectors, or using any klytos_date/klytos_gmdate/klytos_timezone functions.
tools
Guide for developing and extending the Klytos web terminal. Use when modifying terminal commands, adding terminal commands from plugins, fixing terminal bugs, extending the pseudo-terminal, working with TerminalExecutor class, registering custom permissions, adding custom category labels, or managing terminal UI and security.
development
--- name: klytos-site-builder description: Guide for building a complete website from scratch with Klytos CMS. Use when creating a new site, configuring a site after installation, setting up design/content/SEO/navigation, or when the user pastes the post-install prompt. Covers 9 phases: discovery, design reference, global config, theme, content structure, templates, content creation, additional features, and launch. --- # Klytos Site Builder ## Overview The Site Builder is a conversational AI
development
Use when creating or editing page content in Klytos CMS. Ensures every page has proper SEO structure, HTML semantics, meta tags, structured data, accessibility for maximum search engine visibility. Apply when writing page titles, descriptions, content, headings, images, internal links, JSON-LD schema, or following the SEO checklist before publishing pages.