Skip to content
项目

关于

A lightweight static security analysis tool for modern Perl Apps

安全与隐私

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

ZARN

A lightweight static code security analysis for Modern Perl Applications



Summary

Performing static analysis, Zarn is able to identify possible vulnerabilities: for this purpose, each file is parsed using AST analysis to recognize tokens that present risks and subsequently runs the taint tracking process to confirm that it is a whether exploitable or not, to validate whether a malicious agent is able to target the method in question.

Currently, Zarn do single file context analysis, which means that it is not able to identify vulnerabilities that are not directly related to the file being analyzed. But in the future, we plan to implement a call graph analysis to identify vulnerabilities that are not directly related to the file being analyzed.

You can read the full publication about Zarn at: a lightweight static security analysis tool for modern Perl Apps.


Download and install

# Download
$ git clone https://github.com/htrgouvea/zarn && cd zarn
    
# Install libs dependencies
$ sudo cpanm --installdeps .

Example of use

$ perl zarn.pl --rules rules/quick-wins.yml --source ../nozaki --sarif report.sarif

[warn] - FILE:../nozaki/lib/Functions/Helper.pm          Potential: Timing Attack.
[vuln] - FILE:../nozaki/lib/Engine/Orchestrator.pm       Potential: Path Traversal.
[vuln] - FILE:../nozaki/lib/Engine/Orchestrator.pm       Potential: Path Traversal.
[warn] - FILE:../nozaki/lib/Engine/FuzzerThread.pm       Potential: Timing Attack.

Rules example

rules:
  - id: '0001'
    type: presence
    category: info
    name: Debug module enabled
    message: Debug modules can expose sensitive information and potentially create security vulnerabilities.
    sample:
      - Dumper
  - id: '0002'
    type: presence
    category: vuln
    name: Code Injection
    message: Occur when untrusted data is executed as code, allowing attackers to run arbitrary commands on the server.
    sample:
      - system
      - eval
      - exec
      - qx
  - id: '0003'
    type: presence
    category: vuln
    name: Path Traversal
    message: Occur when user input is not properly sanitized, allowing attackers to access files and directories outside of the intended directory structure.
    sample:
      - open
  - id: '0004'
    type: presence
    category: vuln
    name: Weak Criptography Algorithm
    message: Weak algorithms like MD5 are susceptible to various attacks and should be avoided in favor of stronger alternatives to ensure the security of sensitive data.
    sample:
      - md5
  - id: '0005'
    type: presence
    category: vuln
    name: Weak Random Value Generator
    message: Weak random value generators can lead to predictable values, which can be exploited by attackers to bypass security controls.
    sample:
      - rand
  - id: '0006'
    type: absence
    category: warning
    name: Error Suppression
    message: Suppressing errors can make it difficult to identify and troubleshoot issues, potentially leading to security vulnerabilities.
    sample:
      - strict
      - warnings

Github Actions

name: ZARN SAST

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  schedule:
    - cron: "28 23 * * 1"

jobs:
  zarn:
    name: Security Static Analysis with ZARN
    runs-on: ubuntu-20.04
    steps:
    - name: Checkout code
      uses: actions/checkout@v4
      
    - name: Perform Static Analysis
      uses: htrgouvea/[email protected]

    - name: Send result to Github Security
      uses: github/codeql-action/upload-sarif@v3
      with:
        sarif_file: result.sarif

Contribution

Your contributions and suggestions are heartily ♥ welcome. See here the contribution guidelines. Please, report bugs via issues page and for security issues, see here the security policy. (✿ ◕‿◕) This project follows this style guide: (https://github.com/htrgouvea/perl-style-guide).


License

This work is licensed under MIT License.

探索相关项目

加载中…