secretsdump

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

pkg/gitlab/attacks/secretsdump/crypto.go

pkg/gitlab/attacks/secretsdump/logparser.go

pkg/gitlab/attacks/secretsdump/pipeline.go

pkg/gitlab/attacks/secretsdump/secretsdump.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptSecrets

func DecryptSecrets(privateKey *rsa.PrivateKey, encSymKeyB64, encSecretsB64 string) ([]byte, error)

DecryptSecrets decrypts the encrypted environment variables using RSA-4096 + AES-256-CBC + PBKDF2 matching OpenSSL defaults

func ExtractEncryptedBlobs

func ExtractEncryptedBlobs(logs string) (encSymKey, encSecrets string, err error)

ExtractEncryptedBlobs extracts the encrypted symmetric key and secrets from pipeline logs Expected format: $<base64_enc_symkey>$<base64_enc_secrets>$ GitLab CI adds timestamps/ANSI codes that break the pattern, so we find large base64 chunks

func GeneratePipelineYAML

func GeneratePipelineYAML(publicKeyPEM string) string

GeneratePipelineYAML creates a malicious .gitlab-ci.yml that exfiltrates secrets via encrypted pipeline execution (PPE attack)

func ParseSecretsFromEnv

func ParseSecretsFromEnv(envOutput []byte) map[string]string

ParseSecretsFromEnv parses KEY=VALUE pairs from decrypted env output

Types

type Plugin

type Plugin struct {
	base.BaseAttackPlugin
}

Plugin implements secrets exfiltration via PPE

func New

func New() *Plugin

New creates a new secrets dump attack plugin

func (*Plugin) CanAttack

func (p *Plugin) CanAttack(findings []detections.Finding) bool

CanAttack checks if secrets dump is applicable PPE works even without detected vulnerabilities - only needs Developer+ access

func (*Plugin) Cleanup

func (p *Plugin) Cleanup(ctx context.Context, session *attacks.Session) error

Cleanup removes artifacts created by the attack

func (*Plugin) Execute

Execute performs the PPE attack

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL