This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
сервис_git [2026/02/10 08:21] 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 308: | Line 329: | ||
| server# cd /tmp/ | server# cd /tmp/ | ||
| - | server:/tmp# git clone https://gitlab.corp15.un/student/openvpn1.git | + | server:/tmp# git clone https://server.corpX.un/student/openvpn1.git |
| server:/tmp# cd openvpn1/ | server:/tmp# cd openvpn1/ | ||
| Line 319: | Line 340: | ||
| server:/tmp/openvpn1# cp ~/openvpn1/inventory.yaml . -v | server:/tmp/openvpn1# cp ~/openvpn1/inventory.yaml . -v | ||
| server:/tmp/openvpn1# cp ~/openvpn1/openvpn1/files/server.key openvpn1/files/ -v | server:/tmp/openvpn1# cp ~/openvpn1/openvpn1/files/server.key openvpn1/files/ -v | ||
| + | |||
| + | server:/tmp/openvpn1# rm -rf ~/openvpn1 | ||
| server:/tmp/openvpn1# sops edit inventory.yaml | server:/tmp/openvpn1# sops edit inventory.yaml | ||
| Line 328: | Line 351: | ||
| server:/tmp/openvpn1# git remote -v | server:/tmp/openvpn1# git remote -v | ||
| - | server:/tmp/openvpn1# git remote add origin https://gitlab.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> | ||