seguridad por diseno

    by Miguel Elias Gutierrez Garcia

    1

    Implements security by design for web apps and APIs using OWASP standards and a 12-principle defensive framework.

    Free

    Security scanned

    Works with the AI Agents you already use

    seguridad por diseno

    Example session with this skill installed

    I need to create a new Express endpoint for updating user profiles. How do I make sure it is secure against IDOR and mass-assignment?

    • Read your context and instructions
    • Compiled the seguridad por diseno

    I will help you build this endpoint following the

    Seguridad por diseño principles, specifically focusing on server-side authority and whitelist validation.

    Secure Profile Update Endpoint

    // PUT /api/v1/profile
    // Protected by authMiddleware - identity comes from the verified JWT
    router.put('/profile', authMiddleware, async (req, res) => {
      try {
        // 1. Establish identity from server-side token, not request body
        const userId = req.user.id;
        const tenantId = req.user.tenant_id;
    
        // 2. Whitelist validation (Anti Mass-Assignment)
        // Only allow specific fields to be updated
        const { bio, avatar_url, display_name } = req.body;
        
        // Simple validation example
        if (display_name && display_name.length > 50) {
          return res.status(400).json({ error: 'Display name too long' });
        }
    
        // 3. Parameterized Query with Tenant Scope (Anti-IDOR)
        const query = `
          UPDATE users 
          SET bio = $1, avatar_url = $2, display_name = $3 
          WHERE id = $4 AND tenant_id = $5
          RETURNING id, bio, avatar_url, display_name;
        `;
        
        const values = [bio, avatar_url, display_name, userId, tenantId];
        const result = await db.query(query, values);
    
        if (result.rows.length === 0) {
          // Return 404 to avoid confirming existence if tenant/id mismatch
          return res.status(404).json({ error: 'Profile not found' });
        }
    
        // 4. Safe output (Return only what is necessary)
        res.json(result.rows[0]);
    
      } catch (error) {
        console.error('Update profile error:', error.message);
        // 5. Fall closed: Generic error to client, details to logs
        res.status(500).json({ error: 'Internal server error' });
      }
    });
    

    Next steps

    1. Add a rate-limit middleware to this specific route to prevent brute-force profile scraping.
    2. Implement a negative test case verifying that a user from tenant_A cannot update a profile in tenant_B.
    3. Ensure avatar_url is validated against a whitelist of allowed domains.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Security is not a final phase; it is how you write every line of code. This skill enforces security by design during construction and auditing, ensuring your web applications, APIs, and databases are protected against the OWASP Top 10 and common data leaks from the very first commit.

    What it does

    • Enforce AuthZ/AuthP patterns by applying deny-by-default rules and verifying identity at the server level rather than trusting client-side claims.
    • Prevent IDOR and BOLA by ensuring every object access maps to the correct tenant and user role via scoped queries.
    • Sanitize inputs and outputs using whitelist validation and context-aware encoding to stop SQL injection, XSS, and mass-assignment.
    • Audit existing codebases to map attack surfaces and find vulnerabilities in routes, file uploads, and admin panels.
    • Secure integrations by implementing HMAC signatures for webhooks and managing secrets via environment variables instead of code.

    How it works

    1. Identify the task type such as building a new feature or auditing an existing repository.
    2. Apply specific references for your domain (API, Web, Database, or Operations) to maintain compliance with security principles.
    3. Execute the delivery checklist for every change to verify authorization, rate limiting, and failure modes.
    4. Generate audit reports prioritised by severity with concrete exploitation scenarios and suggested fixes.

    Frameworks & tools

    Optimized for Node.js, Express, Angular, and PostgreSQL. It integrates with modern stacks involving Render, Netlify, Neon, and Cloudflare, utilizing standard libraries like crypto and helmet.

    Why this beats prompting it yourself

    Generic prompts often suggest security measures that break production or ignore specific business logic like multi-tenancy. This skill uses a systematic 12-principle framework and a specialized delivery checklist to ensure security doesn't come at the cost of functionality.

    Use cases

    • Secure a multi-tenant API against unauthorized data access (IDOR).
    • Implement robust webhook authentication for third-party payment integrations.
    • Conduct a security audit on an existing codebase before a major release.
    • Harden a PostgreSQL database using Least Privilege and Row Level Security.

    Known limitations

    Focuses on software logic and configuration. It does not replace infrastructure-level penetration testing or physical network security audits.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 14 days ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Network Access
    Listed14 days ago

    What's inside

    Frequently Asked Questions

    This skill automates the implementation of a 12-principle defensive framework during your development cycle, specifically targeting OWASP Top 10 vulnerabilities like IDOR, BOLA, and SQL injection from the very first line of code.

    The skill is optimized for JavaScript-based stacks (Node.js, Express, Angular) and PostgreSQL databases, and it is compatible with major LLMs that support structured coding tasks and repository analysis.

    Beyond code generation, you receive a specialized delivery checklist for security verification and a framework for generating audit reports that prioritize vulnerabilities by severity and exploitation risk.

    Yes, the skill is designed to perform deep audits of existing repositories, mapping your current attack surface and providing concrete fixes for routes, file uploads, and administrative panels.

    While highly effective for software logic and API security, this skill does not cover physical network security, hardware-level hardening, or manual infrastructure penetration testing.

    Updates are released periodically to align with the latest OWASP standards and emerging threat vectors, ensuring your defensive patterns remain effective against new types of cyber attacks.

    New in Security

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.

    Free