Skip to content
Skills Library
Security · Review & audit

source-control-hardening

/source-control-hardening

Harden GitHub/GitLab/Azure DevOps organizations and repositories — SSO and MFA enforcement, branch/ruleset protection, required reviews and CODEOWNERS, signed commits, secret scanning and push protection, third-party app access, deploy keys and PAT governance, audit log streaming. Use when assessing SCM security posture, onboarding a new org, or after a source-code or token leak.

Repository
Claude-Blue ↗
Licence
MIT
Last repository change
01.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
4
Deprecation

No signals detected. Repository changed on 01.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Harden GitHub/GitLab/Azure DevOps organizations and repositories — SSO and MFA enforcement, branch/ruleset protection, required reviews and CODEOWNERS, signed commits, secret scanning and push protection, third-party app access, deploy keys and PAT governance, audit log streaming. Use when assessing SCM security posture, onboarding a new org, or after a source-code or token leak.

Original author description

Harden GitHub/GitLab/Azure DevOps organizations and repositories — SSO and MFA enforcement, branch/ruleset protection, required reviews and CODEOWNERS, signed commits, secret scanning and push protection, third-party app access, deploy keys and PAT governance, audit log streaming. Use when assessing SCM security posture, onboarding a new org, or after a source-code or token leak.

How it works

  1. Organization controls
  2. Repository controls
  3. Quick review commands (GitHub CLI)
  4. Related skills
  5. References
Original SKILL.md headings · 44 lines, 301 words
SKILL.md preview
---
name: source-control-hardening
description: Harden GitHub/GitLab/Azure DevOps organizations and repositories — SSO and MFA enforcement, branch/ruleset protection, required reviews and CODEOWNERS, signed commits, secret scanning and push protection, third-party app access, deploy keys and PAT governance, audit log streaming. Use when assessing SCM security posture, onboarding a new org, or after a source-code or token leak.
license: MIT
metadata:
  category: devsecops
  version: "2.0.0"
  verification: documented
---

# Source Control Hardening

## Organization controls

| Control | GitHub | GitLab |
|---|---|---|
| SSO + MFA | SAML SSO / EMU, require 2FA | SAML group sync, enforce 2FA |
| Base permissions | Members: read or none | Default role minimal |
| Owners/admins | ≤ few, reviewed quarterly | Same |
| Third-party apps | OAuth app access restrictions; review GitHub Apps installations and permissions | Approved integrations |
| Tokens | Fine-grained PAT policy with approval & max lifetime; restrict classic PATs | PAT expiry enforcement |
| Audit | Audit log streaming to SIEM (incl. git events) | Audit events streaming |
| Secret scanning | Secret scanning + **push protection**, custom patterns | Secret detection + push rules |
| Actions/CI | Allowed actions list, read-only default token | Protected variables/runners |

## Repository controls

- Rulesets/branch protection on default and release branches: required PR reviews (≥ 1, ≥ 2 for critical), dismiss stale approvals, require review from CODEOWNERS, required status checks, block force-push and deletion, include administrators.
- CODEOWNERS covering `.github/workflows/`, CI config, IaC, auth code.
- Signed commits/tags where feasible (`git commit -S`, Sigstore gitsign).
- Deploy keys: read-only unless required; inventory and rotate.
- Archive or delete abandoned repos; watch public repository creation by members.

## Quick review commands (GitHub CLI)

```sh
gh api orgs/ORG --jq '{two_factor_requirement_enabled, default_repository_permission, members_can_create_public_repositories}'
gh api orgs/ORG/installations --jq '.installations[] | {app_slug, repository_selection, permissions}'
gh api repos/ORG/REPO/rulesets --jq '.[] | {name, enforcement, target}'
gh api repos/ORG/REPO/branches/main/protection 2>/dev/null | jq '{reviews: .required_pull_request_reviews, enforce_admins: .enforce_admins.enabled}'
```

## Related skills

`github-actions-hardening`, `github-audit-investigation`, `secret-scanning`, `pipeline-threat-model`

## References

- GitHub: Best practices for securing accounts and organizations: https://docs.github.com/en/code-security/securing-your-organization
- GitHub rulesets: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets
- OpenSSF Source Code Management Best Practices (SCM platform guide): https://best.openssf.org/SCM-BestPractices/
- CIS Software Supply Chain Security Guide: https://www.cisecurity.org/insights/white-papers/cis-software-supply-chain-security-guide

Versions

The database has no other skills named source-control-hardening.

Database snapshot: 13.11.2026 · package version 1a291bb1b919 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100github-hardening
    Harden a GitHub account and repo — 2FA, secret scanning with push protection, Dependabot, branch protection, least-privilege Actions and app installs. Use when setting up a new repo, before going public, or after any security scare.
  • 100repo-harden
    Harden a repository's security setup — audit it against a checklist and apply only what is missing, within the user's permissions. Use when asked to harden, secure or audit a repo, or to set up git hooks (branch guard, secret scan, conflict/large-file checks, lint/test,…
  • 100secret-scanning
    Guide for configuring and managing GitHub secret scanning, push protection, custom patterns, and secret alert remediation. For pre-commit secret scanning in AI coding agents via the GitHub MCP Server, this skill references the Advanced Security plugin…
  • 90azure-security-posture-hardening
    Use this skill for Azure security posture review, baseline hardening, managed identity adoption, Key Vault posture, private access decisions, Azure Policy guardrails, and logging or audit gap analysis. Trigger when the user asks how to harden an Azure workload or platform…
  • 100ci-secret-review
    Review how CI/CD systems store and expose secrets — GitHub Actions secrets/environments, GitLab CI variables, Jenkins credentials, Azure DevOps variable groups, CircleCI contexts — scoping per environment, fork/PR exposure, log masking, OIDC replacement of static cloud keys, and…
  • 95identity-access-control
    Use this capability for login, signup, session management, OAuth/OIDC, SSO, JWT, cookies, MFA, RBAC, ABAC, ReBAC, permission checks, service identities, and access reviews. Trigger on auth, login, signup, token, JWT, OAuth, OIDC, SSO, session, cookie, role, permission, MFA, 2FA,…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.