Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/Excoriate/daggerverse/terragrunt
A powerful Dagger module for managing Terragrunt, Terraform, and OpenTofu operations in a containerized environment.
Feature | Description |
---|---|
🛠️ Flexible Base Image | Built using APKO for a secure and optimized container environment. |
🔧 Multi-Tool Support | Primarily focused on Terragrunt, but also supports Terraform and OpenTofu. |
⚙️ Customizable Configurations | Extensive options for Terragrunt and Terraform settings. |
💾 Caching Mechanisms | Implements caching for Terragrunt and Terraform for improved performance. |
☁️ AWS CLI Integration | Option to include AWS CLI in the container. |
🔐 Permissions Management | Fine-grained control over directory permissions. |
🌐 Environment Variable Handling | Easy setting and management of environment variables. |
🔒 Secret Management | Secure handling of sensitive information like Terraform tokens. |
🚀 Execution Flexibility | Run Terragrunt, Terraform, or shell commands within the container. |
Feature | Description |
---|---|
🛠️ Terragrunt, Terraform, and OpenTofu binaries | Pre-installed binaries for Terragrunt, Terraform, and OpenTofu. |
📄 Terragrunt Configuration | Best practice configuration files for Terragrunt. |
⚙️ Terragrunt Options | Configurable options for Terragrunt (see terragrunt_opts.go ). |
🔧 Directory Permissions | Manage directory permissions (see terragrunt_cfg.go ). |
💾 Caching Configuration | Setup caching for Terragrunt and Terraform (see terragrunt_cfg.go ). |
🌐 Environment Variables | Handle environment variables for Terragrunt (see terragrunt_opts.go ). |
🔐 Secret Management | Secure handling of sensitive information like Terraform tokens. |
ctr
: Specify a custom base container.imageURL
: Specify a custom base image URL.tgVersion
: Set the version of Terragrunt (default: 0.68.1
).tfVersion
: Set the version of Terraform (default: 1.9.5
).openTofuVersion
: Set the version of OpenTofu (default: 1.8.2
).enableAWSCLI
: Enable or disable the installation of the AWS CLI (default: false
).awscliVersion
: Set the version of the AWS CLI to install (default: 2.15.1
).extraPackages
: A list of extra packages to install with APKO, from the Alpine packages repository (default: []
). testEnvVars := []string{
"AWS_ACCESS_KEY_ID=test",
"AWS_SECRET_ACCESS_KEY=test",
"AWS_SESSION_TOKEN=test",
}
// Initialize the Terragrunt module
tgModule := dag.
Terragrunt(dagger.TerragruntOpts{
EnvVarsFromHost: testEnvVars,
}).
WithTerragruntPermissionsOnDirsDefault().
WithTerragruntLogOptions(
dagger.TerragruntWithTerragruntLogOptionsOpts{
TgLogLevel: "debug",
TgForwardTfStdout: true,
},
)
// Execute the init command, but don't run it in a container
tgCtrConfigured := tgModule.
Exec("init", dagger.TerragruntExecOpts{
Source: m.getTestDir("").
Directory("terragrunt"),
})
// Evaluate the terragrunt init command.
tgInitCmdOut, tgInitCmdErr := tgCtrConfigured.
Stdout(ctx)
tgModule := dag.
Terragrunt(dagger.TerragruntOpts{
EnvVarsFromHost: testEnvVars,
TfVersion: "1.7.0",
}).
WithTerragruntPermissionsOnDirsDefault().
WithTerragruntLogOptions(dagger.TerragruntWithTerragruntLogOptionsOpts{
TgLogDisableFormatting: true,
TgLogShowAbsPaths: true,
TgLogLevel: "debug",
}).
WithTerraformLogOptions(dagger.TerragruntWithTerraformLogOptionsOpts{
TfLog: "debug",
TfLogPath: "/mnt/tflogs", // it's a directory that the terragrunt user owns.
}).
// Extra options added for more realism.
WithTerragruntOptions(dagger.TerragruntWithTerragruntOptionsOpts{
IgnoreDependencyErrors: true,
IgnoreExternalDependencies: true,
DisableBucketUpdate: true,
})
// Execute the plan command and get the container back.
tgCtr := tgModule.Exec("plan", dagger.TerragruntExecOpts{
Source: m.
getTestDir("").
Directory("terragrunt"),
Secrets: []*dagger.Secret{
dbPasswordSecret,
apiKeySecret,
sshKeySecret,
},
// Args to output the plan to a file.
Args: []string{
"-out=plan.tfplan",
"-refresh=true",
},
})
The module includes comprehensive tests covering various aspects of functionality. You can run these tests using:
just test terragrunt
To contribute or modify the module:
Common commands:
just run-hooks # Initialize pre-commit hooks
just lintall terragrunt # Run linter
just test terragrunt # Run tests
just ci terragrunt # Run entire CI tasks locally
This module uses APKO to build its base image, ensuring:
For more information on APKO, refer to the Chainguard APKO documentation.
For detailed API documentation and more examples, please refer to the source code and test files in the tests/
directory.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.