Catalog npm
Back to packageRELEASE DETAILS

1.1.3

npm

@01a/git-sentinel

[![npm version](https://img.shields.io/npm/v/@01a/git-sentinel.svg)](https://www.npmjs.com/package/@01a/git-sentinel) [![npm downloads](https://img.shields.io/npm/dm/@01a/git-sentinel.svg)](https://www.npmjs.com/package/@01a/git-sentinel) [![license](http

Published23 Mar 2026
Direct dependencies10
Transitive dependenciesNot calculated

README

Current package documentation

Git Sentinel

npm version npm downloads license

Git Sentinel is a powerful security scanner designed to analyze Git repositories for malicious code patterns, BiDi (bidirectional) attacks, and obfuscated malware. It helps developers and security researchers safely inspect untrusted repositories before running scripts or including them in their projects.

Features

  • Repository Scanning: Scan local directories or remote Git repositories by URL.
  • BiDi Attack Detection: Identifies Unicode control characters (BiDi) that can visually reorder code logic to hide malicious intent.
  • Pattern Matching: Uses a robust set of predefined rules to detect reverse shells, persistence mechanisms, dropper behaviors, and obfuscation.
  • Custom Rules: Extend the scanner with your own JSON-based rule sets.
  • Isolated Sandbox: Safely execute repository scripts (like ./configure or install scripts) in an isolated, non-networked Docker container.
  • Suspicious Filename Detection: Flags files with names like ... or . commonly used by malware.
  • Obfuscation Detection: Identifies excessively long lines and common obfuscation techniques (Base64 eval, character concatenation).

Installation

Prerequisites

Setup

  1. Clone this repository:

    git clone https://github.com/youruser/git-sentinel.git
    cd git-sentinel
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    

Usage

The easiest way to run Git Sentinel is with npx:

npx @01a/git-sentinel scan <url-or-path> [options]

Or you can run it directly using npm start after cloning the repository.

Self-Scanning Example

You can try scanning this repository itself to see Git Sentinel in action:

npx @01a/git-sentinel scan git@github.com:eknowlton/git-sentinel.git

Options

OptionShortcutDescription
--run-script <script>-sExecute a specific script from the repo in an isolated sandbox.
--rules-dir <dir>-rInclude custom JSON rule files from a specific directory.
--keep-repoDo not delete the cloned repository after the scan completes.
--version-vShow the version number.
--help-hShow help information.

Example with Sandbox

To scan a repository and safely test its install.sh script:

npm start -- scan https://github.com/example/repo.git -s ./install.sh

Custom Rules

Custom rules are JSON files containing an array of rule objects.

Example custom-rules/my-rules.json:

[
  {
    "pattern": "rm -rf /",
    "description": "Attempted destruction of the root directory",
    "severity": "critical"
  }
]

Run with custom rules:

npm start -- scan ./target-repo -r ./custom-rules

How the Sandbox Works

The sandbox uses Docker to create an isolated environment with the following constraints:

  • No Network: The container has no internet access (--network none).
  • Read-Only Mount: The repository is mounted as read-only at /repo.
  • Resource Limits: Limited to 512MB RAM and 0.5 CPU core.
  • Non-Privileged User: Scripts run as a restricted sentinel user.
  • Base Image: Uses a lightweight Alpine Linux image with bash, python3, and coreutils pre-installed.

Disclaimer and Limitation of Liability

Git Sentinel is provided "as is", without warranty of any kind, express or implied.

The authors and contributors of this project:

  • Do not guarantee the detection of all malicious patterns or security threats.
  • Are not responsible for any damage to your system, data loss, or security breaches that may occur while using this tool or as a result of relying on its findings.
  • Do not endorse or guarantee the safety of any repository scanned by this tool, even if no issues are found.

Security scanning is an inherently complex task. This tool should be used as part of a broader security strategy and not as a sole source of truth. Use at your own risk.

License

ISC License. See package.json for details.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 10

Native requirements
10 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
chalk
Environment
{
  "local_name": "chalk",
  "alias": false,
  "peer_metadata": null
}
^5.6.2runtime
commander
Environment
{
  "local_name": "commander",
  "alias": false,
  "peer_metadata": null
}
^14.0.3runtime
dockerode
Environment
{
  "local_name": "dockerode",
  "alias": false,
  "peer_metadata": null
}
^4.0.10runtime
simple-git
Environment
{
  "local_name": "simple-git",
  "alias": false,
  "peer_metadata": null
}
^3.33.0runtime
@types/chalk
Environment
{
  "local_name": "@types/chalk",
  "alias": false,
  "peer_metadata": null
}
^0.4.31runtime
@types/dockerode
Environment
{
  "local_name": "@types/dockerode",
  "alias": false,
  "peer_metadata": null
}
^4.0.1runtime
tsx
Environment
{
  "local_name": "tsx",
  "alias": false,
  "peer_metadata": null
}
^4.21.0development
ts-node
Environment
{
  "local_name": "ts-node",
  "alias": false,
  "peer_metadata": null
}
^10.9.2development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.9.3development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^25.5.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "54d9b11937115bd7830124382f550555cd99ddaf",
  "tarball": "https://registry.npmjs.org/@01a/git-sentinel/-/git-sentinel-1.1.3.tgz",
  "fileCount": 17,
  "integrity": "sha512-ELlbSHSEzcVzWCGxoz4wJfxwd+IiIH09b2TY+pyd3W+oP9kskZqIvnSOVIT9knTBvqMTet0HpoRpE/J6IBhwWQ==",
  "signatures": [
    {
      "sig": "MEQCICHaoUsRdOB3EjOUikoSv9N/8hN/ajRLsO6Nb0Z9pj+AAiA8cfiSFlSh30oF4InsEKPQNnyqoU27P5lFquDzYWSUlw==",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 32197
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:56 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:2ca5123fec681c31ea265c8dca27cf2316b2f3bc3d83f517436799cac638c5fc

Other collected versions

1.1.424 Mar1.1.223 Mar1.1.023 MarView all collected versions →