HoangNguyen0403

Security

Security best practices for Angular (XSS, CSP, Route Guards).

HoangNguyen0403 501 148 Updated 4mo ago

Resources

1
GitHub

Install

npx skillscat add hoangnguyen0403/agent-skills-standard/security

Install via the SkillsCat registry.

SKILL.md

Security

Priority: P0 (CRITICAL)

Principles

  • XSS Prevention: Angular sanitizes by default. Do NOT use innerHTML unless absolutely necessary.
  • Bypass Security: Avoid DomSanitizer.bypassSecurityTrust... unless the content source is trusted.
  • Route Guards: Protect all sensitive routes with CanActivateFn.

Guidelines

  • CSP: Configure Content Security Policy headers on the server.
  • HTTP: Use Interceptors to attach secure tokens (HttpOnly cookies preferred over LocalStorage tokens).
  • Secrets: NEVER store secrets (API keys) in Angular code.

References

Related Topics

common/security-standards | components