User Tools

Site Tools


сервис_git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
сервис_git [2026/03/02 15:08]
val [Удаление чувствительных данных (паролей, ключей) из репозитория]
сервис_git [2026/03/19 14:05] (current)
val [Работа с локальным репозиторием]
Line 32: Line 32:
  
 server:​~/​conf$ git init server:​~/​conf$ git init
 +
 +server:​~/​conf$ cat .gitignore
 +__pycache__/​
  
 server:​~/​conf$ git add . server:​~/​conf$ git add .
Line 45: Line 48:
  
 server:​~/​conf$ git status server:​~/​conf$ git status
 +
 +server:​~/​conf$ ###git restore file1
  
 server:​~/​conf$ git add -v . server:​~/​conf$ git add -v .
Line 302: Line 307:
 </​code>​ </​code>​
  
-===== Удаление чувствительных данных (паролей,​ ключей) ​из репозитория =====+===== Поиск чувствительных данных (паролей,​ ключей) ​в репозитории ===== 
 + 
 +  * [[https://​www.reddit.com/​r/​git/​comments/​o7jaau/​how_to_scan_for_secrets_on_git_repositories/​]]
 <​code>​ <​code>​
 ~/openvpn1# git rev-list --all | while read commit_hash;​ do ~/openvpn1# git rev-list --all | while read commit_hash;​ do
     git grep pass $commit_hash | cat     git grep pass $commit_hash | cat
 done done
 +</​code>​
 +  * https://​github.com/​trufflesecurity/​trufflehog
 +<​code>​
 +~# wget https://​github.com/​trufflesecurity/​trufflehog/​releases/​download/​v3.93.6/​trufflehog_3.93.6_linux_amd64.tar.gz
  
 +~# tar -xvf trufflehog_3.93.6_linux_amd64.tar.gz trufflehog
 +
 +~# mv trufflehog /​usr/​local/​bin/​
 +
 +~# trufflehog git https://​server.corp13.un:​4443/​student/​openvpn1.git
 +
 +~# ###​trufflehog git file://​openvpn1
 +</​code>​
 +
 +===== Удаление чувствительных данных (паролей,​ ключей) из репозитория =====
 +<​code>​
 server# apt install git-filter-repo server# apt install git-filter-repo
  
сервис_git.1772453298.txt.gz · Last modified: 2026/03/02 15:08 by val