microsoft / microsoft/DevSkim

T-SQL rules

Open
#7 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

rule
Dominant language
C#
Stars
1k
Forks
131
Avg merge
1m
Merged PRs (30d)
1

Description

There aren't a lot of T-SQL security checkers out there, so lets add some rules for T-SQL scripts. Suggestions from Raul:

  • Executing any of the dangerous XPs, such as xp_cmdshell
  • Changing the configuration to enable dangerous features (i.e. EXEC[UTE] sp_configure ‘xp_cmdshell’, 1)
  • Using dynamic SQL (i.e. EXECUTE).
    • The difficult part of this one would be to know if the dynamic SQL is properly escaped to prevent SQLi, so we could simply warn the user
  • Enabling some features on DBs such as setting the trustworthy = ON on a DB
  • Granting elevated permissions (i.e. GRANT UNSAFE ASSEMBLY … )
  • Create a new login (with password) without CHECK_POLICY = ON

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by reviewing the existing rule and analyzer structure for SQL-related checks, then scope the proposed T-SQL rules, including dangerous XPs, dynamic SQL, database configuration, elevated permissions, and login policy; done means each agreed rule is implemented with coverage and documented warning behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.