Skip to main content
rule

security-devsecops-ssdls-appsec — Cursor rule: setup and security

This rule guides Cursor on secure coding, dependencies, access control, and security checks. Use it when you want these requirements applied while editing project files.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/security-devsecops-ssdls-appsec.mdc
Open on GitHub

What security-devsecops-ssdls-appsec does

The rule applies at all times to matching Python, JavaScript, TypeScript, Go, Java, Ruby, PHP, C#, and shell files. It tells the agent to keep secrets out of source code and logs, validate user input, escape output, and avoid exec and eval. Database access should use parameterized queries or an ORM.

For dependencies, the rule calls for verified sources, vulnerability scans, and explicit approval before a new package is added. That approval requirement prevents the agent from introducing a library on its own. The guidance also covers secure authentication, password hashing, RBAC, and least privilege.

It describes CI/CD checks including SAST, SCA, secret scanning, infrastructure scanning, and DAST. It also asks for security controls to be documented and references OWASP Top 10, NIST, and ISO 27001.

What it helps with

  • keep secrets out of source code and logs
  • validate input and build database queries safely
  • restrict API and operation access by role
  • check dependencies and code for known vulnerabilities
  • document security controls for audits

Example prompts for the agent

  • Check this code for exposed secrets and unsafe handling of user input.
  • Before adding a package, check whether it has approval and known vulnerabilities.
  • Suggest security checks for this project's CI/CD pipeline.

How to install security-devsecops-ssdls-appsec

Manually: put the files in place

.cursor/rules/security-devsecops-ssdls-appsec.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about security-devsecops-ssdls-appsec

How do I install security-devsecops-ssdls-appsec in Cursor?

Add the rule file to your project at .cursor/rules/security-devsecops-ssdls-appsec.mdc.

What does security-devsecops-ssdls-appsec do?

It sets guidance for secure coding, secrets, database access, dependencies, authentication, and authorization. It also describes security checks and documentation practices.

Which files does the rule cover?

Its patterns match Python, JavaScript, TypeScript, Go, Java, Ruby, PHP, C#, and shell files. The rule is configured to apply at all times.

Source text

security-devsecops-ssdls-appsec.mdc · CC0-1.0
---
description: "Cursor rules for secure coding, secret handling, dependency hygiene, authentication, authorization, security testing, and compliance documentation."
globs: ["**/*.py", "**/*.js", "**/*.ts", "**/*.go", "**/*.java", "**/*.rb", "**/*.php", "**/*.cs", "**/*.sh"]
alwaysApply: true
---
# DevSecOps + SSDLC + AppSec Cursor Rule

## General Security Principles
- Never hardcode secrets, credentials, or API keys. Use environment variables or secure vaults for sensitive data.
- Prohibit the inclusion of `.env`, secret config files, or unknown tokens in source control.
- Never log sensitive data, secrets, or session tokens in application logs.
- Validate and sanitize all user input. Escape output in HTML, JS, and SQL contexts.
- Avoid unsafe functions such as `exec`, `eval`, or similar dynamic code execution.

## Database Security
- Use parameterized queries or ORM for all database access. Do not use string concatenation for query building.
- Ensure database users have the least privilege required for their tasks.
- Regularly review and update database access policies.

## Dependency Management
- Only use packages from verified sources.
- Do not add new dependencies without explicit approval and security review.
- Regularly update dependencies and scan for known vulnerabilities (SCA).

## Authentication & Authorization
- Use secure authentication frameworks; never implement custom authentication.
- Store passwords using strong, salted hashes (e.g., Argon2, bcrypt).
- Implement Role-Based Access Control (RBAC) for sensitive operations.
- Enforce the principle of least privilege for APIs and UI actions.

## Secure SDLC Practices
- Integrate Static Application Security Testing (SAST) and Software Composition Analysis (SCA) into the CI pipeline.
- Scan all code for secrets before merging (Secret Scanning).
- Use Infrastructure as Code (IaC) scanning for all infrastructure code.
- Integrate Dynamic Application Security Testing (DAST) in the CD pipeline for deployed applications.
- Enforce Policy as Code (PaC) for automated, version-controlled security policies.

## Monitoring & Feedback
- Enable continuous vulnerability monitoring and alerting.
- Integrate Runtime Application Self-Protection (RASP) and Web Application Firewall (WAF) as appropriate.
- Encourage regular vulnerability assessments and penetration testing.
- Maintain a feedback loop to update rules and prompts based on recurring vulnerabilities.

## Compliance & Documentation
- Align with industry standards (e.g., OWASP Top 10, NIST, ISO 27001).
- Document all security controls and decisions for auditability.

© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules

Similar IDE rules

All IDE rules for Security →

From the same set210

snowflake-data-engineering-cursorrules-prompt-file Snowflake data engineering rules for Cursor: SQL standards, semi-structured VARIANT handling, declarative Dynamic Tables, and warehouse cost control. ★ 41,024repo stars snowflake-cortex-ai-cursorrules-prompt-file This Cursor rule covers Snowflake Cortex AI Functions and Cortex Search. Use it for SQL-based AI tasks or to build a retrieval-augmented search flow. ★ 41,024repo stars shopify-theme-dev-liquid A Cursor rule collecting Shopify theme practices across Liquid, JavaScript, CSS, accessibility and performance. Useful when you build a theme and want the agent to keep the structure. ★ 41,024repo stars semiotic-react-dataviz-cursorrules-prompt-file Guides Cursor when building data charts with Semiotic in React, covering HOC props and event callbacks. ★ 41,024repo stars salesforce-apex-cursorrules-prompt-file A Cursor rule that points the agent at Salesforce Apex work: queueables instead of @future, GoF patterns, and almost no comments. ★ 41,024repo stars rust-general This rule guides safe, idiomatic Rust work. It fits projects where .rs, Cargo.toml, and Cargo.lock need consistent coding guidance. ★ 41,024repo stars rtl-right-to-left-i18n-cursorrules-prompt-file A Cursor rule that pushes the agent toward logical CSS and Tailwind utilities instead of left/right. Useful when the app has to run in Arabic, Hebrew, Persian or Urdu. ★ 41,024repo stars ros-ros2 Enforces conventions for ROS and ROS2 workspaces, covering composable nodes, package layout, and launch testing. ★ 41,024repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor