Skip to content

Conversation

@stas-schaller
Copy link
Collaborator

@stas-schaller stas-schaller commented Dec 1, 2025

Summary

Release v1.1.8 of the Terraform Provider for Keeper Secrets Manager, including security fixes, critical bug fixes, and major PAM (Privileged Access Management) feature additions.

Changes

Security Fixes (KSM-707)

  • Upgraded Go from 1.24.0 to 1.24.8 to address critical security vulnerabilities:
    • CVE-2025-22871: net/http chunked encoding request smuggling vulnerability
    • CVE-2025-58185: DER payload parsing memory exhaustion vulnerability
  • Updated GitHub Actions workflow to use Go 1.24.8 for builds and SBOM generation

Bug Fixes

  • Fixed shortcuts/linked records error (KSM-522): Resolved issue where shortcuts (linked records) across multiple shared folders caused "changes to folder_uid not allowed" errors during Terraform apply operations. The provider now correctly handles duplicate UIDs from linked records.

New Features: PAM Record Type Support (KSM-527)

Added comprehensive support for Keeper Privileged Access Management (PAM) record types:

New Resources

  • pamMachine: Manage SSH, RDP, and other remote machine credentials
  • pamDatabase: Manage PostgreSQL, MySQL, MongoDB, and other database credentials
  • pamDirectory: Manage Active Directory and LDAP directory credentials

New Data Sources

  • pamMachine: Read existing machine credentials
  • pamDatabase: Read existing database credentials
  • pamDirectory: Read existing directory credentials
  • pamUser: Read existing user credentials (schema updated)

Core PAM Features

  • pamSettings field: Protocol-specific connection configuration as JSON
    • Supports SSH, RDP, PostgreSQL, MySQL, MongoDB, and more
    • JSON string approach preserves all fields (prevents data loss on round-trips)
    • Forward-compatible with new protocols and fields
  • Bug fix: Corrected useSSL checkbox label mismatch in pamDatabase

PAM Test Coverage

  • resource_pam_machine_test.go: 4 tests (create, update, delete, import)
  • resource_pam_database_test.go: 4 tests (create, update, delete, import)
  • Tests validate pamSettings JSON round-trip operations

PAM Examples

Comprehensive Terraform examples for:

  • Resources: SSH server, Windows RDP, AWS EC2, PostgreSQL, MySQL, AWS RDS, MongoDB, Active Directory, LDAP
  • Data Sources: Reading PAM records, parsing pamSettings JSON, building connection strings

Documentation

  • Updated all version references from 1.1.7 to 1.1.8 across README, documentation, and 44 example files

Files Changed

  • 63 files changed: 2,779 additions, 284 deletions

Modified Files (10)

  • `go.mod` - Go version 1.24.0 → 1.24.8
  • `.github/workflows/terraform-provider-release-process.yml` - Go version updates
  • `README.md`, `docs/index.md` - Version references 1.1.7 → 1.1.8
  • `secretsmanager/provider.go` - Added PAM field mappings + shortcuts fix
  • `secretsmanager/record_fields_pam.go` - Added pamSettings helpers and schema functions
  • `secretsmanager/resource_pam_machine.go` - Added pamSettings CRUD
  • `secretsmanager/resource_pam_database.go` - Added pamSettings CRUD + useSSL fix
  • `secretsmanager/data_source_pam_machine.go` - Added pamSettings read
  • `secretsmanager/data_source_pam_database.go` - Added pamSettings read + useSSL fix
  • `secretsmanager/data_source_pam_user.go` - Schema consistency updates

Created Files (10)

  • `secretsmanager/resource_pam_directory.go` - New directory resource
  • `secretsmanager/data_source_pam_directory.go` - New directory data source
  • `secretsmanager/resource_pam_machine_test.go` - Machine tests
  • `secretsmanager/resource_pam_database_test.go` - Database tests
  • `examples/resources/pam_machine.tf` - Machine examples
  • `examples/resources/pam_database.tf` - Database examples
  • `examples/resources/pam_directory.tf` - Directory examples
  • `examples/data-sources/pam_machine.tf` - Machine data source examples
  • `examples/data-sources/pam_database.tf` - Database data source examples
  • `examples/data-sources/pam_directory.tf` - Directory data source examples

Updated Files (43)

  • All example files (data-sources and resources): Version references 1.1.7 → 1.1.8

Related Issues

Release Type

This is a minor version release (1.1.7 → 1.1.8) containing:

  • Security patches (backward compatible)
  • Bug fixes (backward compatible)
  • Major feature additions (backward compatible)
  • No breaking changes

Testing

PAM tests can be run with:
```bash
TF_ACC=1 go test ./secretsmanager -v -run "TestAccResourcePamMachine"
TF_ACC=1 go test ./secretsmanager -v -run "TestAccResourcePamDatabase"
```

Notes

  • PR KSM-527: Add support for PAM record types #63 (KSM-527: Add support for PAM record types) has been merged into this branch
  • This release is ready for final review and merge to master
  • Go 1.24.8 addresses customer-reported security findings (Wiz scan)
  • PAM support enables Terraform management of privileged access credentials
  • Shortcuts fix resolves long-standing issue with linked records across shared folders

stas-schaller and others added 12 commits October 30, 2025 16:57
  - Implemented pamDirectory resource and data source for Active Directory and OpenLDAP
  - Fixed Schedule field structure to match Go SDK (6 fields)
  - Fixed login/password field reading in all PAM data sources (directory, machine, database, user)
  - Created examples for pamDirectory resources and data sources
  - Documented AllowedSettings investigation in field comments
Bumps the go_modules group with 1 update in the / directory: [golang.org/x/crypto](https://github.com/golang/crypto).


Updates `golang.org/x/crypto` from 0.42.0 to 0.45.0
- [Commits](golang/crypto@v0.42.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
@stas-schaller stas-schaller marked this pull request as ready for review December 1, 2025 17:17
@stas-schaller stas-schaller changed the title Release v1.1.8: Go upgrade and security fixes Release v1.1.8: Go upgrade and security fixes, PAM Record Type Support Dec 1, 2025
Fixed pre-existing compilation errors:
- Changed ProviderFactories to Providers (testAccProviders)
- Replaced undefined variables with testAcc helpers
- Fixed PreCheck function call syntax

The test now compiles but still requires TF_ACC=1 and test data to run.
Added GitHub Actions workflow to run tests on pull requests:
- Builds provider binary
- Runs go vet and go fmt checks
- Runs unit tests and provider validation
- Based on pattern from secrets-manager-go repository

Acceptance tests require TF_ACC=1 and test credentials,
so they should be run manually or in a separate workflow.
Comment on lines +11 to +52
strategy:
matrix:
go-version: [ '1.24.8' ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
name: Test with Go ${{ matrix.go-version }}

steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v4

- name: Download dependencies
run: go mod download

- name: Build provider
run: go build -v .

- name: Run go vet
run: go vet ./...

- name: Run go fmt check
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "Go files are not formatted:"
gofmt -s -d .
exit 1
fi

- name: Run unit tests
run: go test -v -timeout=10m ./...

- name: Run provider validation
run: go test -v -run TestProvider ./secretsmanager

# Acceptance tests require secrets and test data
# Run these manually with TF_ACC=1 and KEEPER_CREDENTIAL set locally
# or add them to a separate protected workflow with secrets

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium test

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 7 days ago

To fix this issue, you should add an explicit permissions block in your workflow YAML, specifying least privilege, which is sufficient for your workflow's needs. Since none of the steps require writing to the repo, a read-only permission on contents is sufficient. The most concise and maintainable way is to add the following block at the root of the workflow file (before jobs:), so it applies to all jobs unless overridden. Insert it after the on: block and before jobs:. No additional libraries or imports are needed; this is simply a YAML configuration change.


Suggested changeset 1
.github/workflows/test.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -6,6 +6,8 @@
 
   workflow_dispatch:
 
+permissions:
+  contents: read
 jobs:
   test-terraform-provider:
     strategy:
EOF
@@ -6,6 +6,8 @@

workflow_dispatch:

permissions:
contents: read
jobs:
test-terraform-provider:
strategy:
Copilot is powered by AI and may make mistakes. Always verify output.
Changed test files to properly skip tests when TF_ACC is not set
instead of failing. This prevents CI from failing when running
unit tests without acceptance test credentials.

Files fixed:
- data_source_folder_test.go: removed nil pointer dereference
- resource_folder_test.go: changed t.Fail() to t.Skip()
- resource_pam_machine_test.go: changed t.Fatal() to t.Skip()
- resource_pam_database_test.go: changed t.Fatal() to t.Skip()
- Add resource_pam_user_test.go with 4 acceptance tests (create, update, delete, import)
- Add resource_pam_directory_test.go with 4 acceptance tests
- Enable PAM Database update test (was disabled due to SDK concerns)
- Add examples for PAM User resources and data sources
- Fix test data formats (checkbox values, database_type lowercase, distinguished_name labels)
- All 16 PAM acceptance tests now pass (Database, Directory, Machine, User)

Note: Update tests only test fields that work with current SDK (v1.6.4).
Fields using ApplyFieldChange() have known SDK limitation where RecordDict changes
don't sync to RawJson. Workaround: tests focus on fields using SetStandardFieldValue().
Updated version constraints in PAM resource and data source examples:
- examples/data-sources/pam_{database,machine,user}.tf
- examples/resources/pam_{database,machine,user}.tf

All PAM examples now consistently require provider version >= 1.1.8
which includes the PAM record type support added in KSM-527.
Ensure go mod tidy runs with -compat=1.24.8 to maintain compatibility
with the Go version specified in go.mod during releases, regardless of
the Go version installed on the release machine.
…modules-dd7da38a6b

Bump golang.org/x/crypto from 0.42.0 to 0.45.0 in the go_modules group across 1 directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code Security finding - golang-stdlib - please upgrade to 1.24.2 Bug: Shortcuts cause errors when applying changes...

2 participants