Skip to content

Commit

Permalink
fix(rules): add GCP Secret Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Aug 7, 2023
1 parent 9e038c4 commit 855ada5
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/common/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const list: TechItem[] = [
{ key: 'gcp.cloudrun', name: 'Cloud Run', type: 'hosting' },
{ key: 'gcp.functions', name: 'Functions', type: 'hosting' },
{ key: 'gcp.cloudbuild', name: 'Cloud Build', type: 'tool' },
{ key: 'gcp.secretmanager', name: 'Secret manager', type: 'db' },
{ key: 'gcp.pubsub', name: 'PubSub', type: 'messaging' },
{ key: 'gcp.gce', name: 'Compute Engine', type: 'hosting' },
{ key: 'gcp.gcs', name: 'Cloud Storage', type: 'storage' },
Expand Down
17 changes: 17 additions & 0 deletions src/rules/db/gcp.secretmanager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { register } from '../../rules.js';

register({
tech: 'gcp.secretmanager',
dependencies: [
{ type: 'npm', name: '@google-cloud/secret-manager' },
{
type: 'terraform.resource',
name: 'google_secret_manager_secret',
},
{
type: 'ruby',
name: /^google-cloud-secret_manager/,
example: 'google-cloud-secret_manager-v1',
},
],
});
1 change: 1 addition & 0 deletions src/rules/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import './elasticsearch.js';
import './gcp.bigquery.js';
import './gcp.bigtable.js';
import './gcp.datastore.js';
import './gcp.secretmanager.js';
import './gcp.sql.js';
import './hashicorp_vault.js';
import './influxdb.js';
Expand Down
1 change: 1 addition & 0 deletions src/rules/spec/nodejs/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ exports[`npm > should match everything 1`] = `
"gcp.gce",
"gcp.gcs",
"gcp.pubsub",
"gcp.secretmanager",
"gcp.sql",
"github",
"hotjar",
Expand Down
6 changes: 6 additions & 0 deletions src/rules/spec/ruby/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Set {
"gcp.bigquery",
"gcp.bigtable",
"gcp.datastore",
"gcp.secretmanager",
"gcp.sql",
"hashicorp_vault",
"influxdb",
Expand Down Expand Up @@ -219,6 +220,11 @@ exports[`ruby (component) > should match everything 2`] = `
"google-cloud-run_v2",
"1.0.0",
],
[
"ruby",
"google-cloud-secret_manager-v1",
"1.0.0",
],
[
"ruby",
"google-cloud-storage",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ exports[`terraform (resource) > should match everything 1`] = `
"gcp.gcs",
"gcp.gke",
"gcp.pubsub",
"gcp.secretmanager",
"gcp.sql",
"terraform",
]
Expand Down
1 change: 1 addition & 0 deletions src/types/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export type AllowedKeys =
| 'gcp.gcs'
| 'gcp.gke'
| 'gcp.pubsub'
| 'gcp.secretmanager'
| 'gcp.sql'
| 'gcp'
| 'github.actions'
Expand Down

0 comments on commit 855ada5

Please sign in to comment.