#
Overview
This document contains instructions for setting up a GitLab server on Linux Ubuntu to test with TruffleHog.
#
TruffleHog Infrastructure Dependencies
- GitLab server requirements (Linux recommended):
- Ubuntu (20.04 LTS, 22.04 LTS, 24.04 LTS), Debian (10, 11, 12), AlmaLinux (8, 9), CentOS 7, Amazon Linux 2, Amazon Linux 2023
- 4 GiB RAM
- GitLab access token with
read_apiprivileges
#
Setting up TruffleHog
Recommend to use GitLab Premium AMI from AWS with GitLab pre-installed
- If not able to launch new AMI for the GitLab instance, follow these instructions to install GitLab
SSH to the GitLab instance
- If using the
GitLab Premium AMIsetup by the Evals Infrastructure team and running intoPermission denied (publickey), you may need to have infra addyour SSH key to the instance
- If using the
Follow the instructions below to configure the external URL for the GitLab server
Run the following to open the editor
sudo nano /etc/gitlab/gitlab.rbLocate the field
external_urland set this equal tohttp://<ip of instance>. For example:external_url "http://10.100.0.64"Save and exit
Reconfigure GitLab
sudo gitlab-ctl reconfigureGrab the password to authenticate to the GitLab server
sudo cat /etc/gitlab/initial_root_passwordOpen a browser and navigate to your GitLab URL. Use the password obtained above with user
rootto authenticate.Create a new project/repository, group, etc. and populate the repository with secrets (AWS key, SSH keys, etc.) for TruffleHog to scrape
- Test keys and secrets can be found here
To generate your own SSH keys for testing:
ssh-keygen -f /path/to/file -t rsa
Generate an access token (Settings > Access Tokens > Add New Token) with
read_apiaccess to your test repository to begin testing