Skip to content
Back to skills

Cis Apache24 5.11

ASecurity

Ensure Access to .git Files Is Restricted

  • 3,723 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 3, 2026
securitygogit

Works with

  • cli

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add CyberStrikeus/CyberStrike --skill cis-apache24-5.11 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cis Apache24 5.11?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cis Apache24 5.11
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/cyberstrikeus-cis-apache24-5-11/badge)](https://www.skillsdirectory.com/skills/cyberstrikeus-cis-apache24-5-11)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cis-apache24-5.11
description: "Ensure Access to .git Files Is Restricted"
category: cis-apache
version: "2.3.0"
author: cyberstrike-official
tags: [cis, apache, linux, features, content, options]
cis_id: "5.11"
cis_benchmark: "CIS Apache HTTP Server 2.4 Benchmark v2.3.0"
tech_stack: [linux, apache]
cwe_ids: []
chains_with: []
prerequisites: []
severity_boost: {}
---

# Ensure Access to .git Files Is Restricted (Manual)

## Profile Applicability

Level 1

## Description

Restrict access to any files beginning with `.git` using the `FilesMatch` directive.

## Rationale

More and more websites track their changes in a Git repository we see a lot of attackers search for .git directories. Access to .git directories should be restricted. These files should be placed in the document root, but, in the event they are, the `FilesMatch` and `DirectoryMatch` directives can be used to prevent them from being viewed by web clients.

## Impact

`.git` files are not accessible.

## Audit Procedure

Perform the following steps to determine if the recommended state is implemented:

Verify that a `FilesMatch` and `DirectoryMatch` directives similar to the one below is present in the apache configuration and not commented out. The deprecated `Deny from All` directive may be used instead of the Require directive.

```
<FilesMatch "/\.git">
    Require all denied
</FilesMatch>

<DirectoryMatch "/\.git">
    Require all denied
</DirectoryMatch>
```

## Remediation

Perform the following to implement the recommended state:

Add or modify the following lines in the Apache configuration file at the server configuration level.

```
<FilesMatch "/\.git">
    Require all denied
</FilesMatch>

<DirectoryMatch "/\.git">
    Require all denied
</DirectoryMatch>
```

## Default Value

This is not set by default

## References

1. https://httpd.apache.org/docs/2.4/mod/core.html#filesmatch

## CIS Controls

**v8:**

- 9.4 Restrict Unnecessary or Unauthorized Browser and Email Client Extensions
  - Restrict, either through uninstalling or disabling, any unauthorized or unnecessary browser or email client plugins, extensions, and add-on applications.

**v7:**

- 18.2 Ensure Explicit Error Checking is Performed for All In-house Developed Software
  - For in-house developed software, ensure that explicit error checking is performed and documented for all input, including for size, data type, and acceptable ranges or formats.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.