How-to · Peek Pro

Find passwords, keys and tokens left inside a JAR, WAR or ZIP

A key store copied in for a test, a .env that the build picked up, a database password in a properties file: they travel inside the artifact to wherever it is deployed or shared. It takes a minute to check before it leaves your Mac.

JAR WAR ZIP Key stores Peek Pro

With Peek

Scan the archive without showing the secrets

The scan is part of Verify in Peek Pro, which you can try free for 14 days.

1

Open the archive

Open the .jar, .war, .ear or .zip you are about to ship.

2

Run Verify

Choose Archive ▸ Verify Integrity, or Verify on the archive's panel.

3

Read what it found

Besides checking integrity, Verify looks for key stores, credential files, private keys, service tokens and passwords left inside the archive.

4

Go to each one

The report says where each finding is. It never shows the value, so the report is safe to share or attach to a ticket.

5

Fix it at the source

Remove the file or the value from the build, rebuild, and verify again. A secret that already shipped should be rotated.

From the Terminal

Search names and contents with unzip and grep

Two passes: file names that should not be there, then text that looks like a credential.

# Files that are usually secrets
unzip -Z1 app.war | grep -Ei '\.(jks|p12|pfx|pem|key)$|\.env$|credentials'

# Lines that mention a password or a token (prints the values)
unzip -p app.war '*.properties' '*.yml' '*.xml' | grep -Ei 'password|secret|token'

The second command prints the secrets into your terminal and its scrollback, and it only catches the words you thought of. It does not tell you which file each line came from.

Questions

Does Peek upload the archive to scan it?

No. The archive is read on your Mac and nothing is uploaded. Peek has no account and no telemetry.

Does the report show the passwords it finds?

No. It reports where each one is and what kind of thing it is, never the value.

Is this a replacement for a secret scanner in CI?

No. It is a check on a finished artifact, which is where files that never were in the repository show up. Keep your repository scanning too.

What should I do with a secret that already shipped?

Treat it as exposed: rotate it, then remove it from the build.

More how-to guides

Other things people do with a JAR or a WAR

Free to download

Open, browse and extract for free. Try Peek Pro for 14 days.

Peek is a native Mac app from the Mac App Store. Nothing is charged when the trial ends; Peek Pro is a one-time purchase, with no subscription and no account.