Crates.io | ghsec |
lib.rs | ghsec |
version | 0.5.0 |
source | src |
created_at | 2023-12-27 23:56:03.26536 |
updated_at | 2023-12-27 23:56:03.26536 |
description | GitHub Security Linter |
homepage | https://vtavernier.github.io/ghsec/ |
repository | https://github.com/vtavernier/ghsec.git |
max_upload_size | |
id | 1081961 |
size | 90,817 |
ghsec is an opinionated linter (with fixes) for public GitHub repository security. It helps diagnose and fix potential security issues caused by GitHub repository settings that are usually too open by default.
cargo install --force --locked ghsec
cargo binstall ghsec
You will need a personal access token with admin access level to your repositories. Currently, this tool has only been tested with classic tokens with the repo scope.
# Provide a GitHub personal access token with admin access to your repositories
export GITHUB_TOKEN=ghp_.....
# Run the checks
ghsec
# Run the checks and fix the issues, if possible
ghsec --fix
# You can also specify repositories to check using a unix-style glob
ghsec 'workflows-*'
branch_protections
:
check branch protection settingscode_review_limits
:
check account settings for code review limitsdefault_workflow_permissions
:
use secure defaults for "Default Workflow Permissions"fork_pull_request_workflows
:
check repository settings for public fork pull request workflow runsrepository_secrets
:
list repositories containing GitHub Actions secretsThis project is licensed under the MIT License.