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/02/25 22:11]
val [Удаление чувствительных данных (паролей, ключей) из репозитория]
сервис_git [2026/03/02 17:30] (current)
val [Поиск чувствительных данных (паролей, ключей) в репозитории]
Line 300: Line 300:
  
 (venv1) server:​~/​kubespray#​ git checkout tags/​v2.26.0 (venv1) server:​~/​kubespray#​ git checkout tags/​v2.26.0
 +</​code>​
 +
 +===== Поиск чувствительных данных (паролей,​ ключей) в репозитории =====
 +
 +  * [[https://​www.reddit.com/​r/​git/​comments/​o7jaau/​how_to_scan_for_secrets_on_git_repositories/​]]
 +<​code>​
 +~/openvpn1# git rev-list --all | while read commit_hash;​ do
 +    git grep pass $commit_hash | cat
 +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>​
  
Line 331: Line 352:
 server:/​tmp/​openvpn1#​ git remote -v server:/​tmp/​openvpn1#​ git remote -v
 server:/​tmp/​openvpn1#​ git remote add origin https://​server.corpX.un/​student/​openvpn1.git server:/​tmp/​openvpn1#​ git remote add origin https://​server.corpX.un/​student/​openvpn1.git
 +</​code>​ 
 +Settings -> Repository -> Protected Branches -> Allowed to force push: ON 
 +<​code>​
 server:/​tmp/​openvpn1#​ git push --force --all server:/​tmp/​openvpn1#​ git push --force --all
 server:/​tmp/​openvpn1#​ git push --force --tags server:/​tmp/​openvpn1#​ git push --force --tags
 </​code>​ </​code>​
сервис_git.1772046699.txt.gz · Last modified: 2026/02/25 22:11 by val