Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/security-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow helps maintain repository security by monitoring for unwanted changes
name: Repository Security Check

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
security-check:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Verify repository contains only documentation
run: |
echo "Checking repository contents..."

# Define allowed file extensions and names
ALLOWED_EXTENSIONS=("*.md" "*.txt" "*.yml" "*.yaml")
ALLOWED_FILES=("LICENSE" ".gitignore")

# Check if any files have executable permission bits set
EXECUTABLES=$(find . -type f -perm -111 -not -path "./.git/*" -not -path "./.github/*" | wc -l)

if [ "$EXECUTABLES" -gt 0 ]; then
echo "Error: Executable files found. This repository should only contain documentation."
find . -type f -perm -111 -not -path "./.git/*" -not -path "./.github/*"
exit 1
fi

# Build find command with allowed file types
FIND_CMD="find . -type f -not -path \"./.git/*\" -not -path \"./.github/*\""
for ext in "${ALLOWED_EXTENSIONS[@]}"; do
FIND_CMD="$FIND_CMD -not -name \"$ext\""
done
for file in "${ALLOWED_FILES[@]}"; do
FIND_CMD="$FIND_CMD -not -name \"$file\""
done

# Check for disallowed file types
DISALLOWED=$(eval "$FIND_CMD" | wc -l)

if [ "$DISALLOWED" -gt 0 ]; then
echo "Warning: Non-documentation files detected:"
eval "$FIND_CMD"
Comment on lines +37 to +51
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shell array syntax and command construction has a potential issue. When building the find command dynamically with eval, the negation logic will exclude all files matching ANY of the allowed patterns. However, since *.yml and *.yaml are in ALLOWED_EXTENSIONS, this workflow file itself would be excluded from the disallowed files check. This means the logic for detecting disallowed files is functioning as intended for filtering, but the overall approach of using eval with dynamically constructed commands can be fragile and has security implications. Consider using a whitelist approach by finding all files and then filtering them with grep or a proper loop instead of eval.

Suggested change
# Build find command with allowed file types
FIND_CMD="find . -type f -not -path \"./.git/*\" -not -path \"./.github/*\""
for ext in "${ALLOWED_EXTENSIONS[@]}"; do
FIND_CMD="$FIND_CMD -not -name \"$ext\""
done
for file in "${ALLOWED_FILES[@]}"; do
FIND_CMD="$FIND_CMD -not -name \"$file\""
done
# Check for disallowed file types
DISALLOWED=$(eval "$FIND_CMD" | wc -l)
if [ "$DISALLOWED" -gt 0 ]; then
echo "Warning: Non-documentation files detected:"
eval "$FIND_CMD"
# Find files and filter them against the allowed lists without using eval
DISALLOWED_FILES=()
# Iterate over all files (excluding .git and .github) and apply whitelist logic
while IFS= read -r -d '' FILE; do
BASENAME=$(basename "$FILE")
ALLOWED=false
# Check allowed extensions
for ext in "${ALLOWED_EXTENSIONS[@]}"; do
case "$BASENAME" in
$ext)
ALLOWED=true
break
;;
esac
done
# Check explicitly allowed filenames if not allowed by extension
if [ "$ALLOWED" = false ]; then
for allowed_file in "${ALLOWED_FILES[@]}"; do
if [ "$BASENAME" = "$allowed_file" ]; then
ALLOWED=true
break
fi
done
fi
# Collect disallowed files
if [ "$ALLOWED" = false ]; then
DISALLOWED_FILES+=("$FILE")
fi
done < <(find . -type f -not -path "./.git/*" -not -path "./.github/*" -print0)
# Check for disallowed file types
DISALLOWED=${#DISALLOWED_FILES[@]}
if [ "$DISALLOWED" -gt 0 ]; then
echo "Warning: Non-documentation files detected:"
printf '%s\n' "${DISALLOWED_FILES[@]}"

Copilot uses AI. Check for mistakes.
Comment on lines +50 to +51
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check only produces a warning (not an error) when non-documentation files are found. For a security-focused repository that should only contain documentation, this should fail the workflow (exit 1) rather than just warn. Otherwise, unexpected file types could be merged despite the security check.

Suggested change
echo "Warning: Non-documentation files detected:"
eval "$FIND_CMD"
echo "Error: Non-documentation files detected:"
eval "$FIND_CMD"
exit 1

Copilot uses AI. Check for mistakes.
fi

echo "Repository security check completed successfully."
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Editor and IDE files
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store

# Temporary files
*.tmp
*.temp
/tmp/

# Build artifacts (should not exist in this repo, but just in case)
dist/
build/
*.o
*.exe
*.dll
*.so
*.dylib

# Logs
*.log

# OS generated files
Thumbs.db
63 changes: 63 additions & 0 deletions REPOSITORY_SETTINGS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# GitHub Repository Security Settings

This document provides instructions for configuring high-security settings for this repository.

## Required Manual Configuration Steps

The following settings must be configured through the GitHub repository settings UI:

### 1. Disable Forks

Navigate to: **Settings → General → Features**

- [ ] Uncheck "Allow forking"

### 2. Disable Downloads

Navigate to: **Settings → General → Features**

- [ ] Uncheck "Releases" (prevents creating downloadable releases)
- [ ] Consider disabling "Packages" if enabled

### 3. Branch Protection Rules

Navigate to: **Settings → Branches → Branch protection rules**

Create a rule for the `main` branch with the following settings:

- [ ] Require pull request reviews before merging
- [ ] Dismiss stale pull request approvals when new commits are pushed
- [ ] Require status checks to pass before merging
- [ ] Require branches to be up to date before merging
- [ ] Require conversation resolution before merging
- [ ] Do not allow bypassing the above settings

### 4. General Security Settings

Navigate to: **Settings → Code security and analysis**

- [ ] Enable "Private vulnerability reporting" if available
- [ ] Enable "Dependency graph"
- [ ] Enable "Dependabot alerts" if applicable
Comment on lines +40 to +41
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reference to "Dependency graph" and "Dependabot alerts" settings is inconsistent with the repository's purpose. This is a documentation-only repository with no dependencies to track. The Dependency graph is specifically for analyzing code dependencies in package manifests (package.json, requirements.txt, etc.), which this repository doesn't have. Consider removing both the Dependency graph and Dependabot alerts items from this checklist.

Suggested change
- [ ] Enable "Dependency graph"
- [ ] Enable "Dependabot alerts" if applicable

Copilot uses AI. Check for mistakes.

### 5. Access Control

Navigate to: **Settings → Collaborators and teams**

- [ ] Review and minimize collaborator access
- [ ] Ensure only authorized users have write access

## Verification

After applying these settings, verify:

1. Visitors cannot fork the repository
2. There are no downloadable releases or archives available
3. Direct pushes to the main branch are blocked
4. Only authorized collaborators can make changes

## Notes

- These settings protect the integrity of your profile README
- The repository remains publicly viewable but contributions are restricted
- Changes can only be made by authorized collaborators through pull requests
24 changes: 24 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Security Policy

## Repository Purpose

This repository serves as a personal profile README hosting space. It contains no executable code and is intended solely for displaying extended profile information.

## Security Configuration

This repository has been configured with high security settings:

- **Forks**: Disabled to prevent unauthorized copies
- **Downloads**: Repository downloads should be disabled as there is no distributable content
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description states "Repository downloads should be disabled" with conditional language ("should be"), but given this is a security-focused configuration guide, it would be clearer to use definitive language like "Repository downloads are disabled" or explicitly state this is a manual step that must be completed. The current wording creates ambiguity about whether this is already configured or needs to be configured.

Suggested change
- **Downloads**: Repository downloads should be disabled as there is no distributable content
- **Downloads**: Repository downloads are disabled as there is no distributable content

Copilot uses AI. Check for mistakes.
- **Branch Protection**: Main branch should be protected to prevent unauthorized modifications
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description "Main branch should be protected" uses conditional language ("should be") which creates ambiguity about whether this protection is already in place or needs to be configured manually. For consistency and clarity, consider using language that clearly indicates this is a manual configuration requirement, matching the tone of REPOSITORY_SETTINGS.md.

Suggested change
- **Branch Protection**: Main branch should be protected to prevent unauthorized modifications
- **Branch Protection**: Configure branch protection rules for the `main` branch to prevent unauthorized modifications

Copilot uses AI. Check for mistakes.

## Reporting Security Issues

If you discover any security concerns with this repository, please contact the repository owner directly through GitHub.

## Security Best Practices Applied

1. No executable code to minimize attack surface
2. Read-only access for general visitors
3. Minimal repository permissions
4. No external dependencies or build processes
70 changes: 70 additions & 0 deletions SECURITY_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Security Configuration Guide

This repository has been configured for high security as a documentation-only profile README host.

## What's Been Implemented

### 1. Security Documentation (`SECURITY.md`)
- Documents the repository's security policy
- Explains the purpose and security configuration
- Provides contact information for security concerns

### 2. Repository Settings Guide (`REPOSITORY_SETTINGS.md`)
- Step-by-step instructions for configuring GitHub repository settings
- Includes checklist for disabling forks and downloads
- Branch protection configuration guidance
- Access control recommendations

### 3. Automated Security Checks (`.github/workflows/security-check.yml`)
- GitHub Actions workflow that runs on every push and pull request
- Verifies repository contains only documentation files
- Prevents introduction of executable files
- Alerts if unexpected file types are added

## Required Manual Steps

**Important:** The following settings MUST be configured manually in the GitHub repository settings:

1. **Disable Forks**
- Go to: Settings → General → Features
- Uncheck "Allow forking"

2. **Disable Downloads/Releases**
- Go to: Settings → General → Features
- Uncheck "Releases"

3. **Configure Branch Protection**
- Go to: Settings → Branches
- Add protection rules for the `main` branch
- Require pull request reviews
- Require status checks to pass

See `REPOSITORY_SETTINGS.md` for detailed instructions.

## Security Benefits

- ✅ No executable code = minimal attack surface
- ✅ Automated monitoring of repository contents
- ✅ Prevention of unauthorized forks (when configured)
- ✅ Protected main branch (when configured)
- ✅ Clear security policy for visitors
- ✅ Documented security practices

## Verification

After applying manual settings:
1. Try to fork the repository (should be blocked)
2. Check that no download options are available
3. Attempt to push directly to main (should require PR)
4. Verify GitHub Actions workflow is running

## Next Steps

1. Review and apply the manual configuration steps in `REPOSITORY_SETTINGS.md`
2. Monitor the GitHub Actions runs to ensure the security check workflow passes
3. Update the `README.md` with any additional profile information as needed
4. Periodically review security settings to ensure they remain configured correctly

## Support

For questions about these security configurations, refer to the individual documentation files or contact the repository owner.