security guardian

Security Guardian Skill

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "security guardian" with this command: npx skills add chrysaliscat/designgraduation/chrysaliscat-designgraduation-security-guardian

Security Guardian Skill

This skill ensures the application complies with the RuoYi Security Model and general Web Security standards.

🛡️ Core Principles

  • Zero Trust: Never trust frontend input. Validate everything on the server.

  • Permission First: Every Controller method (except public ones) MUST have @PreAuthorize .

  • Data Isolation: Users should only see their own data.

🛠️ Common Workflows

  1. Data Scoping (Multi-Tenancy/Isolation)

Context: A user should only see their OWN cart or orders. Pattern:

// Controller public TableDataInfo list(AgOrder order) { // FORCE the query to be filtered by current User ID order.setUserId(SecurityUtils.getUserId()); startPage(); // ... }

Audit: Check if any select method inadvertently returns all records because userId wasn't set.

  1. Permission Annotations

Context: Creating a new API. Pattern:

  • Add: @PreAuthorize("@ss.hasPermi('agri:order:add')")

  • Edit: @PreAuthorize("@ss.hasPermi('agri:order:edit')")

  • Query: @PreAuthorize("@ss.hasPermi('agri:order:list')")

Rule: Define these permissions in the Menu/Database first.

  1. SQL Injection Prevention

Rule:

  • Always use #{param} (Prepared Statement).

  • NEVER use ${param} (String Concatenation) unless absolutely necessary (e.g., dynamic sort columns) and strictly sanitized.

How to use

Invoke this skill when:

  • Creating new API endpoints (to ensure @PreAuthorize ).

  • Writing SQL queries (to check for injection risks).

  • Implementing logic that accesses sensitive user data.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

ui/ux pro max

No summary provided by upstream source.

Repository SourceNeeds Review
General

web test case generator

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

mini program expert

No summary provided by upstream source.

Repository SourceNeeds Review
General

debugging expert

No summary provided by upstream source.

Repository SourceNeeds Review