Socket
Book a DemoInstallSign in
Socket

github.com/peakle/security-rules

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/peakle/security-rules

Source
Go
Version
v0.0.0-20220419193449-0ce687934508
Version published
Created
Source

security-rules

Ruleguard security rules

Tests Go Report Card Go Reference

What are we checking now?:

  • HTTP without SSL
  • old hash functions like: md5
  • TLS insecureSkipVerify option usage
  • Old TLS versions
  • Old cipher functions usage: like RC4
  • Swagger body validation function usage

How to use:

Full installation example: https://github.com/peakle/dc-rules-example

  • Install rules:
    go get -v github.com/peakle/security-rules
    
  • Create rules.go file in your project like in example
  • Add linter to your pipeline:
    • Like another one check in golangci-lint (will work for golangci-lint >v1.27.0):

      linters:
        enable:
          - gocritic
      linters-settings:
        gocritic:
          enabled-checks:
            - ruleguard
          settings:
            ruleguard:
              rules: "YourDir/rules.go"
      
    • Like file watcher in Goland IDE (will work for golangci-lint >v1.27.0):

      • add golangci-lint as File Watcher in IDE (Preferences -> Tools -> File Watchers -> Add)
      • set Arguments field where .golangci.yml file will be like example above:
      run $FileDir$ --config=$ProjectFileDir$/.golangci.yml
      

How to update to new rules version:

  • update rules version in your go.mod file
  • download new rules version:
    go get github.com/peakle/security-rules@newVersion
    
  • if you using golangci-lint update cache:
    golangci-lint cache clean
    

How to add new checks:

FAQs

Package last updated on 19 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts