Skip to main content
In this lesson, you’ll see Talisman in action—installing it on a developer workstation, scanning for secrets before pushing, and configuring exceptions.

Talisman Repository

You can find the official Talisman project on GitHub. Explore the code, review open issues, or contribute back to the repository.
The image shows a GitHub repository page for "thoughtworks/talisman," displaying the code files, recent commits, and an "About" section describing the project.
Refer to the project’s README for detailed installation and usage instructions.
The image shows a GitHub page for the "Talisman" project, displaying a table of contents related to installation and usage instructions. The page includes various sections like installation methods and handling hooks.

Installing Talisman Locally

Prerequisites

  • Git installed on your Linux or macOS system
  • curl (or wget) available in your PATH
Download and install Talisman as a Git hook in your project directory:
The installer adds or updates hooks in .git/hooks. Ensure you have write permissions to the project directory before running the script.

Hook Types Comparison

Preparing the Demo Repository

On your VM, clone (or navigate to) the demo repository and pull the latest changes:
You should see:
  • Jenkinsfile
  • Dockerfile
  • k8s_deployment_service.yaml
  • .git folder (containing the hooks directory)

Installing the Pre-Push Hook

Add Talisman to your demo repo:
Verify the hook is in place:

Testing Talisman Scans

Create a directory with sample files simulating secrets:
Stage and commit:
Attempt to push:
Talisman will scan and block any push with detected secrets. Example output:
By default, Talisman checks for passwords, API keys, and Base64-encoded secrets. You can customize its behavior with a .talismanrc file if needed.

Ignoring Specific Files

To exempt certain files from scanning, create a .talismanrc in your project root:
Then commit and push again:
Talisman will now skip sec_files/file3 but still block other flagged content.

Cleaning Up and Final Push

Remove or refactor any remaining flagged files:
With only approved files left, the final push should succeed.
By integrating Talisman as a pre-push (or pre-commit) hook, you ensure that sensitive data—passwords, API keys, and Base64-encoded tokens—are caught before they reach your remote repository.

Watch Video

Practice Lab