security-practices
БесплатноБез исполняемых скриптовНе проверенModern security standards including Zero Trust Architecture, supply chain security, DevSecOps integration, and cloud-native protection
Об этом скилле
Security Practices Skill
Level 1: Quick Start (5 minutes)
What You'll Learn
Implement essential security practices to protect applications from common vulnerabilities and attacks.
Core Principles
- Zero Trust: Never trust, always verify
- Defense in Depth: Multiple layers of security controls
- Shift Left: Integrate security early in development
- Least Privilege: Grant minimum necessary permissions
Quick Security Checklist
- Enable MFA for all user accounts
- Use HTTPS/TLS 1.3 for all connections
- Validate and sanitize all inputs
- Never commit secrets to version control
- Run dependency vulnerability scans
- Implement proper error handling (no sensitive info in errors)
Common Vulnerabilities to Avoid
// ❌ NEVER: Hardcoded secrets
const API_KEY = "sk_live_abc123";
// ✅ ALWAYS: Use environment variables
const API_KEY = process.env.API_KEY;
// ❌ NEVER: SQL injection vulnerability
const query = `SELECT * FROM users WHERE id = ${userId}`;
// ✅ ALWAYS: Parameterized queries
const query = "SELECT * FROM users WHERE id = ?";
db.query(query, [userId]);
// ❌ NEVER: Weak password validation
if (password.length >= 6) { /* valid */ }
// ✅ ALWAYS: Strong password requirements
if (
password.length >= 12 &&
/[A-Z]/.test(password) &&
/[a-z]/.test(password) &&
/[0-9]/.test(password) &&
/[^A-Za-z0-9]/.test(password)
) { /* valid */ }
Critical Security Tools
- Secrets Management: HashiCorp Vault, AWS Secrets Manager
- Dependency Scanning: Snyk, Dependabot, npm audit
- SAST: SonarQube, Semgrep, CodeQL
- DAST: OWASP ZAP, Burp Suite
Level 2: Implementation (30 minutes)
Deep Dive Topics
1. Zero Trust Architecture
Core Components:
// Identity verification with MFA
interface AuthenticationService {
// Primary authentication
verifyCredentials(username: string, password: string): Promise<Session>;
// Multi-factor authentication
verifyMfaToken(sessionId: string, token: string): Promise<boolean>;
// Continuous authentication
verifySessionValidity(sessionId: string): Promise<boolean>;
}
// Policy engine for access decisions
class PolicyEngine {
async evaluateAccess(
user: User,
resource: Resource,
context: Context
): Promise<AccessDecision> {
const riskScore = await this.calculateRiskScore(user, context);
const policy = await this.getApplicablePolicy(user, resource);
return {
allowed: this.checkPermissions(user, resource, policy),
requiresStepUp: riskScore > RISK_THRESHOLD,
auditRequired: true,
};
}
private async calculateRiskScore(
user: User,
context: Context
): Promise<number> {
let risk = 0;
if (context.location !== user.knownLocations) risk += 30;
if (context.device !== user.knownDevices) risk += 20;
if (context.timeOfDay < 6 || context.timeOfDay > 22) risk += 10;
return risk;
}
}
NIST Mapping:
- @nist-controls: [ac-2, ac-3, ac-6, ia-2, ia-5, au-2, sc-8]
2. Supply Chain Security
# .github/workflows/supply-chain-security.yml
name: Supply Chain Security
on: [push, pull_request]
jobs:
dependency-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Dependency vulnerability scanning
- name: Run Snyk
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=high
# SBOM generation
- name: Generate SBOM
run: |
npm install -g @cyclonedx/cyclonedx-npm
cyclonedx-npm --output-file sbom.json
# License compliance
- name: Check Licenses
run: |
npm install -g license-checker
license-checker --production --failOn "GPL;AGPL"
SBOM Implementation:
// Generate Software Bill of Materials
interface SBOMEntry {
name: string;
version: string;
license: string;
supplier: string;
checksum: string;
vulnerabilities: Vulnerability[];
}
async function generateSBOM(): Promise<SBOM> {
const dependencies = await analyzeDependencies();
const vulnerabilities = await scanVulnerabilities(dependencies);
return {
components: dependencies.map((dep) => ({
name: dep.name,
version: dep.version,
license: dep.license,
checksum: calculateChecksum(dep),
vulnerabilities: vulnerabilities.filter((v) => v.package === dep.name),
})),
metadata: {
timestamp: new Date().toISOString(),
toolVersion: "1.0.0",
},
};
}
NIST Mapping:
- @nist-controls: [sa-10, sr-3, sr-4, sr-6, sr-11]
3. Container Security
# Secure Dockerfile example
FROM node:20-alpine AS base
# Security: Run as non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
# Security: Minimal base image, scan for vulnerabilities
FROM base AS dependencies
WORKDIR /app
COP
Установить security-practices в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл security-practices?
Modern security standards including Zero Trust Architecture, supply chain security, DevSecOps integration, and cloud-native protection
Как установить скилл security-practices?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл security-practices запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic