SQLCheck - Check for dangerous SQL - OSS Daily

Daily Open Source News for IT Engineer and Designer

Breaking

Home Top Ad

Post Top Ad

Tuesday, October 3, 2017

SQLCheck - Check for dangerous SQL


A database is indispensable when developing a system. However, depending on the technique, there is tremendous data depending on the technique used in that case, but there is a risk that data will be lost or taken out by erroneous coding.

SQLCheck is what I would like to use there. Let's pre-check the problem, risky SQL.

How to use SQLCheck

Execution result of SQLCheck. Just pass the SQL file.

  1. $ sqlcheck -f /path/to/tmp-publisher.sql
  2. -------------------------------------------------
  3. > RISK LEVEL :: ALL ANTI-PATTERNS
  4. > SQL FILE NAME :: /path/to/tmp-publisher.sql
  5. -------------------------------------------------
  6. ==================== Results ===================
  7. -------------------------------------------------
  8. SQL Statement: create table user ( id text primary key, customer_id text, -- customer provided
  9. id email text, phone text, name text, uploaded boolean, created_at bigint,
  10. updated_at bigint );
  11. [/path/to/tmp-publisher.sql]: (HIGH RISK) (LOGICAL_DATABASE_DESIGN ANTI-PATTERN) Multi-Valued Attribute
  12. [Matching Expression: id text]
  13. [/path/to/tmp-publisher.sql]: (HIGH RISK) (LOGICAL_DATABASE_DESIGN ANTI-PATTERN) Generic Primary Key
  14. [Matching Expression: id ]
  15. :
  16. -------------------------------------------------
  17. SQL Statement: create index user_customer_id on user (customer_id);
  18. [/path/to/tmp-publisher.sql]: (LOW RISK) (PHYSICAL_DATABASE_DESIGN ANTI-PATTERN) Index Attribute Order
  19. [Matching Expression: create index]
  20. :
  21. ==================== Summary ===================
  22. All Anti-Patterns :: 7
  23. > High Risk :: 4
  24. > Medium Risk :: 0
  25. > Low Risk :: 3

Depending on the condition, it determines that the risk is high, middle, low and gives the result. Since it checks with anti pattern in SQL, if you check the SQL log executed by the system, you should see improvement points.

SQLCheck is C ++ open source software (Apache Licnese 2.0).


No comments:

Post a Comment

Post Bottom Ad