Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refactor / additional flag autoGenerateIamPermissions #1089

Merged
merged 10 commits into from
Jan 20, 2025
40 changes: 40 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[extend]
useDefault = true

[[rules]]
id = "generic-api-key"
# all the other attributes from the default rule are inherited

[[rules.allowlists]]
regexTarget = "line"
regexes = [
'''objectKey''',
'''S3Key''',
'''SopsAgeKey''',
'''s3Key''',
]

[[rules]]
id = "private-key"

[[rules.allowlists]]
regexTarget = "line"
regexes = [
'''(.*)OAdqlMznWINBDoyR\+PESgQJlUptwnh(.*)''',
]

[allowlist]
description = "global allow list"
paths = [
'''\.gitleaks\.toml''',
'''lambda/events/(.*?)json''',
'''lambda/__snapshots__/(.*?)snap''',
'''test-secrets/(.*?)(json|yaml|yml|env|binary)''',
'''test/(.*)\.integ\.snapshot/(.*?)json'''
]

regexTarget = "match"
regexes = [
'''AGE-SECRET-KEY-1EFUWJ0G2XJTJFWTAM2DGMA4VCK3R05W58FSMHZP3MZQ0ZTAQEAFQC6T7T3''',
]

233 changes: 94 additions & 139 deletions API.md

Large diffs are not rendered by default.

24 changes: 23 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,26 @@

Thanks for your interest in our project. Contributions are welcome. Feel free to [open an issue](issues) with questions or reporting ideas and bugs, or [open pull requests](pulls) to contribute code.

We are committed to fostering a welcoming, respectful, and harassment-free environment. Be kind!
We are committed to fostering a welcoming, respectful, and harassment-free environment. Be kind!

## How to buidl/deploy local

Install all necessary tools with `yarn install` and others manually like `go`

Build the go Lambda code:
```
./scripts/build.sh
```
Build the package (for CDK development only the first `js` build has to complete):
```
yarn projen build
```
Link the package:
```
yarn link
```
Switch to the path/project where you would like to use cdk-sops-secrets. \
Link the package to your local build source:
```
yarn link "cdk-sops-secrets"
```
3 changes: 2 additions & 1 deletion lambda/__snapshots__/handler_parameter_raw_test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions lambda/__snapshots__/handler_parameter_yaml_multi_test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions lambda/__snapshots__/handler_secret_env_test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions lambda/__snapshots__/handler_secret_json_test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lambda/__snapshots__/handler_secret_raw_test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 14 additions & 7 deletions lambda/__snapshots__/handler_secret_yaml_test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lambda/events/event_create_s3_parameter_raw_simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "PARAMETER",
"CreationType": "SINGLE",
"ParameterName": "arn:aws:ssm:eu-central-1:123456789012:parameter/testsecret",
"SopsS3File": {
"Bucket": "..",
Expand Down
3 changes: 1 addition & 2 deletions lambda/events/event_create_s3_parameter_yaml_complex.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"RequestType": "Create",
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "PARAMETER",
"CreationType": "MULTI",
"ResourceType": "PARAMETER_MULTI",
"ParameterName": "arn:aws:ssm:eu-central-1:123456789012:parameter/testsecret",
"SopsS3File": {
"Bucket": "..",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"RequestType": "Create",
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "PARAMETER",
"CreationType": "MULTI",
"ResourceType": "PARAMETER_MULTI",
"ParameterName": "arn:aws:ssm:eu-central-1:123456789012:parameter/testsecret",
"SopsS3File": {
"Bucket": "..",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
1 change: 0 additions & 1 deletion lambda/events/event_create_s3_secret_env_simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
1 change: 0 additions & 1 deletion lambda/events/event_create_s3_secret_json_complex.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
1 change: 0 additions & 1 deletion lambda/events/event_create_s3_secret_json_simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
1 change: 0 additions & 1 deletion lambda/events/event_create_s3_secret_raw_simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
1 change: 0 additions & 1 deletion lambda/events/event_create_s3_secret_yaml_complex.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
1 change: 0 additions & 1 deletion lambda/events/event_create_s3_secret_yaml_simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"LogicalResourceId": "LogicalResourceId",
"ResourceProperties": {
"ResourceType": "SECRET",
"CreationType": "SINGLE",
"FlattenSeparator": ".",
"SecretARN": "arn:aws:secretsmanager:eu-central-1:123456789012:secret:testsecret",
"SopsS3File": {
Expand Down
Loading
Loading