@transcend-io/cli 4.120.1 → 4.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -37
- package/build/cli-discover-silos.js +15 -4
- package/build/cli-discover-silos.js.map +1 -1
- package/build/cli-scan-packages.d.ts +3 -0
- package/build/cli-scan-packages.d.ts.map +1 -0
- package/build/cli-scan-packages.js +74 -0
- package/build/cli-scan-packages.js.map +1 -0
- package/build/code-scanning/constants.d.ts +12 -0
- package/build/code-scanning/constants.d.ts.map +1 -0
- package/build/code-scanning/constants.js +25 -0
- package/build/code-scanning/constants.js.map +1 -0
- package/build/code-scanning/findCodePackagesInFolder.d.ts +16 -0
- package/build/code-scanning/findCodePackagesInFolder.d.ts.map +1 -0
- package/build/code-scanning/findCodePackagesInFolder.js +50 -0
- package/build/code-scanning/findCodePackagesInFolder.js.map +1 -0
- package/build/code-scanning/findFilesToScan.d.ts +29 -0
- package/build/code-scanning/findFilesToScan.d.ts.map +1 -0
- package/build/{plugins → code-scanning}/findFilesToScan.js +12 -12
- package/build/code-scanning/findFilesToScan.js.map +1 -0
- package/build/code-scanning/index.d.ts +4 -0
- package/build/code-scanning/index.d.ts.map +1 -0
- package/build/{plugins → code-scanning}/index.js +1 -1
- package/build/code-scanning/index.js.map +1 -0
- package/build/code-scanning/integrations/cocoaPods.d.ts +3 -0
- package/build/code-scanning/integrations/cocoaPods.d.ts.map +1 -0
- package/build/code-scanning/integrations/cocoaPods.js +44 -0
- package/build/code-scanning/integrations/cocoaPods.js.map +1 -0
- package/build/code-scanning/integrations/gemfile.d.ts +3 -0
- package/build/code-scanning/integrations/gemfile.d.ts.map +1 -0
- package/build/code-scanning/integrations/gemfile.js +58 -0
- package/build/code-scanning/integrations/gemfile.js.map +1 -0
- package/build/code-scanning/integrations/gradle.d.ts +13 -0
- package/build/code-scanning/integrations/gradle.d.ts.map +1 -0
- package/build/code-scanning/integrations/gradle.js +81 -0
- package/build/code-scanning/integrations/gradle.js.map +1 -0
- package/build/{plugins → code-scanning}/integrations/index.d.ts +2 -0
- package/build/code-scanning/integrations/index.d.ts.map +1 -0
- package/build/{plugins → code-scanning}/integrations/index.js +2 -0
- package/build/code-scanning/integrations/index.js.map +1 -0
- package/build/code-scanning/integrations/javascriptPackageJson.d.ts +3 -0
- package/build/code-scanning/integrations/javascriptPackageJson.d.ts.map +1 -0
- package/build/code-scanning/integrations/javascriptPackageJson.js +38 -0
- package/build/code-scanning/integrations/javascriptPackageJson.js.map +1 -0
- package/build/code-scanning/integrations/pubspec.d.ts +3 -0
- package/build/code-scanning/integrations/pubspec.d.ts.map +1 -0
- package/build/code-scanning/integrations/pubspec.js +70 -0
- package/build/code-scanning/integrations/pubspec.js.map +1 -0
- package/build/code-scanning/integrations/pythonRequirementsTxt.d.ts +3 -0
- package/build/code-scanning/integrations/pythonRequirementsTxt.d.ts.map +1 -0
- package/build/code-scanning/integrations/pythonRequirementsTxt.js +47 -0
- package/build/code-scanning/integrations/pythonRequirementsTxt.js.map +1 -0
- package/build/code-scanning/types.d.ts +10 -0
- package/build/code-scanning/types.d.ts.map +1 -0
- package/build/{plugins → code-scanning}/types.js.map +1 -1
- package/build/codecs.d.ts +108 -0
- package/build/codecs.d.ts.map +1 -1
- package/build/codecs.js +91 -1
- package/build/codecs.js.map +1 -1
- package/build/graphql/fetchActiveSiloDiscoPlugin.d.ts +2 -3
- package/build/graphql/fetchActiveSiloDiscoPlugin.d.ts.map +1 -1
- package/build/graphql/fetchActiveSiloDiscoPlugin.js +1 -7
- package/build/graphql/fetchActiveSiloDiscoPlugin.js.map +1 -1
- package/build/graphql/fetchAllCodePackages.d.ts +52 -0
- package/build/graphql/fetchAllCodePackages.d.ts.map +1 -0
- package/build/graphql/fetchAllCodePackages.js +32 -0
- package/build/graphql/fetchAllCodePackages.js.map +1 -0
- package/build/graphql/fetchAllRepositories.d.ts +33 -0
- package/build/graphql/fetchAllRepositories.d.ts.map +1 -0
- package/build/graphql/fetchAllRepositories.js +32 -0
- package/build/graphql/fetchAllRepositories.js.map +1 -0
- package/build/graphql/fetchAllSoftwareDevelopmentKits.d.ts +38 -0
- package/build/graphql/fetchAllSoftwareDevelopmentKits.d.ts.map +1 -0
- package/build/graphql/fetchAllSoftwareDevelopmentKits.js +32 -0
- package/build/graphql/fetchAllSoftwareDevelopmentKits.js.map +1 -0
- package/build/graphql/gqls/codePackage.d.ts +4 -0
- package/build/graphql/gqls/codePackage.d.ts.map +1 -0
- package/build/graphql/gqls/codePackage.js +112 -0
- package/build/graphql/gqls/codePackage.js.map +1 -0
- package/build/graphql/gqls/index.d.ts +3 -0
- package/build/graphql/gqls/index.d.ts.map +1 -1
- package/build/graphql/gqls/index.js +3 -0
- package/build/graphql/gqls/index.js.map +1 -1
- package/build/graphql/gqls/repository.d.ts +4 -0
- package/build/graphql/gqls/repository.d.ts.map +1 -0
- package/build/graphql/gqls/repository.js +80 -0
- package/build/graphql/gqls/repository.js.map +1 -0
- package/build/graphql/gqls/softwareDevelopmentKit.d.ts +4 -0
- package/build/graphql/gqls/softwareDevelopmentKit.d.ts.map +1 -0
- package/build/graphql/gqls/softwareDevelopmentKit.js +92 -0
- package/build/graphql/gqls/softwareDevelopmentKit.js.map +1 -0
- package/build/graphql/index.d.ts +3 -0
- package/build/graphql/index.d.ts.map +1 -1
- package/build/graphql/index.js +3 -0
- package/build/graphql/index.js.map +1 -1
- package/build/graphql/syncAssessmentTemplates.js +2 -2
- package/build/graphql/syncAssessmentTemplates.js.map +1 -1
- package/build/graphql/syncAssessments.js +3 -3
- package/build/graphql/syncAssessments.js.map +1 -1
- package/build/graphql/syncCodePackages.d.ts +77 -0
- package/build/graphql/syncCodePackages.d.ts.map +1 -0
- package/build/graphql/syncCodePackages.js +150 -0
- package/build/graphql/syncCodePackages.js.map +1 -0
- package/build/graphql/syncDataSilos.js +2 -2
- package/build/graphql/syncDataSilos.js.map +1 -1
- package/build/graphql/syncRepositories.d.ts +65 -0
- package/build/graphql/syncRepositories.d.ts.map +1 -0
- package/build/graphql/syncRepositories.js +113 -0
- package/build/graphql/syncRepositories.js.map +1 -0
- package/build/graphql/syncSoftwareDevelopmentKits.d.ts +84 -0
- package/build/graphql/syncSoftwareDevelopmentKits.d.ts.map +1 -0
- package/build/graphql/syncSoftwareDevelopmentKits.js +118 -0
- package/build/graphql/syncSoftwareDevelopmentKits.js.map +1 -0
- package/build/graphql/uploadSiloDiscoveryResults.d.ts +1 -1
- package/build/graphql/uploadSiloDiscoveryResults.d.ts.map +1 -1
- package/build/graphql/uploadSiloDiscoveryResults.js +5 -2
- package/build/graphql/uploadSiloDiscoveryResults.js.map +1 -1
- package/build/tests/findCodePackagesInFolder.test.d.ts +2 -0
- package/build/tests/findCodePackagesInFolder.test.d.ts.map +1 -0
- package/build/tests/findCodePackagesInFolder.test.js +507 -0
- package/build/tests/findCodePackagesInFolder.test.js.map +1 -0
- package/build/tsbuildinfo +1 -1
- package/examples/code-scanning/test-gradle/test-nested-package-json/package.json +20 -0
- package/examples/code-scanning/test-package-json/package.json +20 -0
- package/package.json +5 -4
- package/LICENSE +0 -21
- package/build/plugins/constants.d.ts +0 -9
- package/build/plugins/constants.d.ts.map +0 -1
- package/build/plugins/constants.js +0 -11
- package/build/plugins/constants.js.map +0 -1
- package/build/plugins/findFilesToScan.d.ts +0 -12
- package/build/plugins/findFilesToScan.d.ts.map +0 -1
- package/build/plugins/findFilesToScan.js.map +0 -1
- package/build/plugins/index.d.ts +0 -4
- package/build/plugins/index.d.ts.map +0 -1
- package/build/plugins/index.js.map +0 -1
- package/build/plugins/integrations/cocoaPods.d.ts +0 -3
- package/build/plugins/integrations/cocoaPods.d.ts.map +0 -1
- package/build/plugins/integrations/cocoaPods.js +0 -30
- package/build/plugins/integrations/cocoaPods.js.map +0 -1
- package/build/plugins/integrations/gradle.d.ts +0 -3
- package/build/plugins/integrations/gradle.d.ts.map +0 -1
- package/build/plugins/integrations/gradle.js +0 -53
- package/build/plugins/integrations/gradle.js.map +0 -1
- package/build/plugins/integrations/index.d.ts.map +0 -1
- package/build/plugins/integrations/index.js.map +0 -1
- package/build/plugins/integrations/javascriptPackageJson.d.ts +0 -3
- package/build/plugins/integrations/javascriptPackageJson.d.ts.map +0 -1
- package/build/plugins/integrations/javascriptPackageJson.js +0 -32
- package/build/plugins/integrations/javascriptPackageJson.js.map +0 -1
- package/build/plugins/integrations/pythonRequirementsTxt.d.ts +0 -3
- package/build/plugins/integrations/pythonRequirementsTxt.d.ts.map +0 -1
- package/build/plugins/integrations/pythonRequirementsTxt.js +0 -33
- package/build/plugins/integrations/pythonRequirementsTxt.js.map +0 -1
- package/build/plugins/typeguards.d.ts +0 -9
- package/build/plugins/typeguards.d.ts.map +0 -1
- package/build/plugins/typeguards.js +0 -15
- package/build/plugins/typeguards.js.map +0 -1
- package/build/plugins/types.d.ts +0 -29
- package/build/plugins/types.d.ts.map +0 -1
- /package/build/{plugins → code-scanning}/types.js +0 -0
package/README.md
CHANGED
|
@@ -17,114 +17,118 @@
|
|
|
17
17
|
- [Usage](#usage-2)
|
|
18
18
|
- [CI Integration](#ci-integration)
|
|
19
19
|
- [Dynamic Variables](#dynamic-variables)
|
|
20
|
-
- [tr-
|
|
20
|
+
- [tr-scan-packages](#tr-scan-packages)
|
|
21
21
|
- [Authentication](#authentication-2)
|
|
22
|
-
- [Usage](#usage-3)
|
|
23
22
|
- [Arguments](#arguments-2)
|
|
24
|
-
|
|
23
|
+
- [Usage](#usage-3)
|
|
24
|
+
- [tr-discover-silos](#tr-discover-silos)
|
|
25
25
|
- [Authentication](#authentication-3)
|
|
26
26
|
- [Arguments](#arguments-3)
|
|
27
27
|
- [Usage](#usage-4)
|
|
28
|
-
- [tr-request-
|
|
28
|
+
- [tr-request-approve](#tr-request-approve)
|
|
29
29
|
- [Authentication](#authentication-4)
|
|
30
30
|
- [Arguments](#arguments-4)
|
|
31
31
|
- [Usage](#usage-5)
|
|
32
|
-
- [tr-request-
|
|
32
|
+
- [tr-request-cancel](#tr-request-cancel)
|
|
33
33
|
- [Authentication](#authentication-5)
|
|
34
34
|
- [Arguments](#arguments-5)
|
|
35
35
|
- [Usage](#usage-6)
|
|
36
|
-
- [tr-request-
|
|
36
|
+
- [tr-request-mark-silent](#tr-request-mark-silent)
|
|
37
37
|
- [Authentication](#authentication-6)
|
|
38
38
|
- [Arguments](#arguments-6)
|
|
39
39
|
- [Usage](#usage-7)
|
|
40
|
-
- [tr-request-
|
|
40
|
+
- [tr-request-upload](#tr-request-upload)
|
|
41
41
|
- [Authentication](#authentication-7)
|
|
42
42
|
- [Arguments](#arguments-7)
|
|
43
43
|
- [Usage](#usage-8)
|
|
44
|
-
- [tr-request-
|
|
44
|
+
- [tr-request-restart](#tr-request-restart)
|
|
45
45
|
- [Authentication](#authentication-8)
|
|
46
46
|
- [Arguments](#arguments-8)
|
|
47
47
|
- [Usage](#usage-9)
|
|
48
|
-
- [tr-
|
|
48
|
+
- [tr-request-export](#tr-request-export)
|
|
49
49
|
- [Authentication](#authentication-9)
|
|
50
50
|
- [Arguments](#arguments-9)
|
|
51
51
|
- [Usage](#usage-10)
|
|
52
|
-
- [tr-cron-
|
|
52
|
+
- [tr-cron-pull-identifiers](#tr-cron-pull-identifiers)
|
|
53
53
|
- [Authentication](#authentication-10)
|
|
54
54
|
- [Arguments](#arguments-10)
|
|
55
55
|
- [Usage](#usage-11)
|
|
56
|
-
- [tr-
|
|
56
|
+
- [tr-cron-mark-identifiers-completed](#tr-cron-mark-identifiers-completed)
|
|
57
57
|
- [Authentication](#authentication-11)
|
|
58
58
|
- [Arguments](#arguments-11)
|
|
59
59
|
- [Usage](#usage-12)
|
|
60
|
-
- [tr-manual-enrichment-
|
|
60
|
+
- [tr-manual-enrichment-pull-identifiers](#tr-manual-enrichment-pull-identifiers)
|
|
61
61
|
- [Authentication](#authentication-12)
|
|
62
62
|
- [Arguments](#arguments-12)
|
|
63
63
|
- [Usage](#usage-13)
|
|
64
|
-
- [tr-
|
|
64
|
+
- [tr-manual-enrichment-push-identifiers](#tr-manual-enrichment-push-identifiers)
|
|
65
65
|
- [Authentication](#authentication-13)
|
|
66
66
|
- [Arguments](#arguments-13)
|
|
67
67
|
- [Usage](#usage-14)
|
|
68
|
-
- [tr-
|
|
68
|
+
- [tr-mark-request-data-silos-completed](#tr-mark-request-data-silos-completed)
|
|
69
69
|
- [Authentication](#authentication-14)
|
|
70
70
|
- [Arguments](#arguments-14)
|
|
71
71
|
- [Usage](#usage-15)
|
|
72
|
-
- [tr-
|
|
72
|
+
- [tr-skip-request-data-silos](#tr-skip-request-data-silos)
|
|
73
73
|
- [Authentication](#authentication-15)
|
|
74
74
|
- [Arguments](#arguments-15)
|
|
75
75
|
- [Usage](#usage-16)
|
|
76
|
-
- [tr-
|
|
76
|
+
- [tr-retry-request-data-silos](#tr-retry-request-data-silos)
|
|
77
77
|
- [Authentication](#authentication-16)
|
|
78
78
|
- [Arguments](#arguments-16)
|
|
79
79
|
- [Usage](#usage-17)
|
|
80
|
-
- [tr-consent-
|
|
80
|
+
- [tr-update-consent-manager](#tr-update-consent-manager)
|
|
81
81
|
- [Authentication](#authentication-17)
|
|
82
82
|
- [Arguments](#arguments-17)
|
|
83
83
|
- [Usage](#usage-18)
|
|
84
|
-
- [tr-consent-
|
|
84
|
+
- [tr-consent-managers-to-business-entities](#tr-consent-managers-to-business-entities)
|
|
85
85
|
- [Authentication](#authentication-18)
|
|
86
86
|
- [Arguments](#arguments-18)
|
|
87
87
|
- [Usage](#usage-19)
|
|
88
|
-
- [tr-
|
|
88
|
+
- [tr-consent-manager-service-json-to-yml](#tr-consent-manager-service-json-to-yml)
|
|
89
89
|
- [Authentication](#authentication-19)
|
|
90
90
|
- [Arguments](#arguments-19)
|
|
91
91
|
- [Usage](#usage-20)
|
|
92
|
-
- [tr-derive-data-silos-from-data-flows
|
|
92
|
+
- [tr-derive-data-silos-from-data-flows](#tr-derive-data-silos-from-data-flows)
|
|
93
93
|
- [Authentication](#authentication-20)
|
|
94
94
|
- [Arguments](#arguments-20)
|
|
95
95
|
- [Usage](#usage-21)
|
|
96
|
-
- [tr-
|
|
96
|
+
- [tr-derive-data-silos-from-data-flows-cross-instance](#tr-derive-data-silos-from-data-flows-cross-instance)
|
|
97
97
|
- [Authentication](#authentication-21)
|
|
98
98
|
- [Arguments](#arguments-21)
|
|
99
99
|
- [Usage](#usage-22)
|
|
100
|
-
- [tr-
|
|
100
|
+
- [tr-pull-consent-metrics](#tr-pull-consent-metrics)
|
|
101
101
|
- [Authentication](#authentication-22)
|
|
102
102
|
- [Arguments](#arguments-22)
|
|
103
103
|
- [Usage](#usage-23)
|
|
104
|
-
- [tr-
|
|
104
|
+
- [tr-upload-consent-preferences](#tr-upload-consent-preferences)
|
|
105
105
|
- [Authentication](#authentication-23)
|
|
106
106
|
- [Arguments](#arguments-23)
|
|
107
107
|
- [Usage](#usage-24)
|
|
108
|
-
- [tr-
|
|
108
|
+
- [tr-pull-consent-preferences](#tr-pull-consent-preferences)
|
|
109
109
|
- [Authentication](#authentication-24)
|
|
110
110
|
- [Arguments](#arguments-24)
|
|
111
111
|
- [Usage](#usage-25)
|
|
112
|
-
- [tr-upload-
|
|
112
|
+
- [tr-upload-data-flows-from-csv](#tr-upload-data-flows-from-csv)
|
|
113
113
|
- [Authentication](#authentication-25)
|
|
114
114
|
- [Arguments](#arguments-25)
|
|
115
115
|
- [Usage](#usage-26)
|
|
116
|
-
- [tr-
|
|
116
|
+
- [tr-upload-cookies-from-csv](#tr-upload-cookies-from-csv)
|
|
117
117
|
- [Authentication](#authentication-26)
|
|
118
118
|
- [Arguments](#arguments-26)
|
|
119
119
|
- [Usage](#usage-27)
|
|
120
|
-
- [tr-
|
|
120
|
+
- [tr-generate-api-keys](#tr-generate-api-keys)
|
|
121
121
|
- [Authentication](#authentication-27)
|
|
122
122
|
- [Arguments](#arguments-27)
|
|
123
123
|
- [Usage](#usage-28)
|
|
124
|
-
- [tr-
|
|
124
|
+
- [tr-build-xdi-sync-endpoint](#tr-build-xdi-sync-endpoint)
|
|
125
125
|
- [Authentication](#authentication-28)
|
|
126
126
|
- [Arguments](#arguments-28)
|
|
127
127
|
- [Usage](#usage-29)
|
|
128
|
+
- [tr-create-assessment](#tr-create-assessment)
|
|
129
|
+
- [Authentication](#authentication-29)
|
|
130
|
+
- [Arguments](#arguments-29)
|
|
131
|
+
- [Usage](#usage-30)
|
|
128
132
|
- [Prompt Manager](#prompt-manager)
|
|
129
133
|
- [Proxy usage](#proxy-usage)
|
|
130
134
|
|
|
@@ -147,6 +151,7 @@ yarn add -D @transcend-io/cli
|
|
|
147
151
|
# cli commands available within package
|
|
148
152
|
yarn tr-pull --auth=$TRANSCEND_API_KEY
|
|
149
153
|
yarn tr-push --auth=$TRANSCEND_API_KEY
|
|
154
|
+
yarn tr-scan-packages --auth=$TRANSCEND_API_KEY
|
|
150
155
|
yarn tr-discover-silos --auth=$TRANSCEND_API_KEY
|
|
151
156
|
yarn tr-request-approve --auth=$TRANSCEND_API_KEY
|
|
152
157
|
yarn tr-request-cancel --auth=$TRANSCEND_API_KEY
|
|
@@ -184,6 +189,7 @@ npm i -D @transcend-io/cli
|
|
|
184
189
|
# cli commands available within package
|
|
185
190
|
tr-pull --auth=$TRANSCEND_API_KEY
|
|
186
191
|
tr-push --auth=$TRANSCEND_API_KEY
|
|
192
|
+
tr-scan-packages --auth=$TRANSCEND_API_KEY
|
|
187
193
|
tr-discover-silos --auth=$TRANSCEND_API_KEY
|
|
188
194
|
tr-request-approve --auth=$TRANSCEND_API_KEY
|
|
189
195
|
tr-request-cancel --auth=$TRANSCEND_API_KEY
|
|
@@ -695,6 +701,60 @@ data-silos:
|
|
|
695
701
|
api-key-title: Webhook Key
|
|
696
702
|
```
|
|
697
703
|
|
|
704
|
+
### tr-scan-packages
|
|
705
|
+
|
|
706
|
+
Transcend can scan your codebase to inventory your code packages and dependencies. Currently we support scanning for discovering packages and dependencies for the following frameworks:
|
|
707
|
+
|
|
708
|
+
- package.json
|
|
709
|
+
- requirements.txt & setup.py
|
|
710
|
+
- Podfile
|
|
711
|
+
- build.gradle
|
|
712
|
+
- pubspec.yaml
|
|
713
|
+
- Gemfile & .gemspec
|
|
714
|
+
|
|
715
|
+
The command will scan the folder you point at to look for any of these files. Once found, the build file will be parsed in search of dependencies. Those code packages and dependencies will be uploaded to [Transcend](https://app.transcend.io/code-scanning/code-packages). The only information shared with Transcend includes:
|
|
716
|
+
|
|
717
|
+
- repository name
|
|
718
|
+
- package names
|
|
719
|
+
- dependency names and versions
|
|
720
|
+
- package descriptions
|
|
721
|
+
|
|
722
|
+
#### Authentication
|
|
723
|
+
|
|
724
|
+
In order to use this cli, you will first need to generate an API key on the Transcend Admin Dashboard (https://app.transcend.io/infrastructure/api-keys).
|
|
725
|
+
|
|
726
|
+
The API key needs the following scopes:
|
|
727
|
+
|
|
728
|
+
- Manage Code Scanning
|
|
729
|
+
|
|
730
|
+
#### Arguments
|
|
731
|
+
|
|
732
|
+
| Argument | Description | Type | Default | Required |
|
|
733
|
+
| ---------- | ------------------------------------- | -------- | ------- | -------- |
|
|
734
|
+
| auth | Transcend API key. | string | N/A | true |
|
|
735
|
+
| scanPath | File path in the project to scan. | string | ./ | false |
|
|
736
|
+
| ignoreDirs | List of directories to ignore in scan | string[] | [] | false |
|
|
737
|
+
|
|
738
|
+
#### Usage
|
|
739
|
+
|
|
740
|
+
Scan the current directory
|
|
741
|
+
|
|
742
|
+
```sh
|
|
743
|
+
yarn tr-scan-packages --auth=$TRANSCEND_API_KEY
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
Scan a specific directory
|
|
747
|
+
|
|
748
|
+
```sh
|
|
749
|
+
yarn tr-discover-silos --auth=$TRANSCEND_API_KEY --scanPath=./examples/
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
Ignore certain folders
|
|
753
|
+
|
|
754
|
+
```sh
|
|
755
|
+
yarn tr-discover-silos --auth=$TRANSCEND_API_KEY --ignoreDirs=./test,./build
|
|
756
|
+
```
|
|
757
|
+
|
|
698
758
|
### tr-discover-silos
|
|
699
759
|
|
|
700
760
|
Transcend can help scan dependency management files to help detect new data silos where you may be storing user personal data. Currently we support scanning for new data silos in Javascript, Python, Gradle, and CocoaPods projects.
|
|
@@ -710,6 +770,15 @@ The API key needs the following scopes:
|
|
|
710
770
|
- Manage Assigned Data Inventory
|
|
711
771
|
- [Data Silo for Scanner]
|
|
712
772
|
|
|
773
|
+
#### Arguments
|
|
774
|
+
|
|
775
|
+
| Argument | Description | Type | Default | Required |
|
|
776
|
+
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------- | -------- |
|
|
777
|
+
| scanPath | File path in the project to scan. | string | N/A | true |
|
|
778
|
+
| dataSiloID | The UUID of the corresponding data silo. | string | N/A | true |
|
|
779
|
+
| auth | Transcend API key. | string | N/A | true |
|
|
780
|
+
| fileGlobs | You can pass a [glob syntax pattern(s)](https://github.com/mrmlnc/fast-glob) to specify additional file paths to scan in addition to the default (ex: package.json). | string | N/A | false |
|
|
781
|
+
|
|
713
782
|
#### Usage
|
|
714
783
|
|
|
715
784
|
Then, you'll need to grab that `dataSiloId` and a Transcend API key and pass it to the CLI. Using JavaScript package.json as an example:
|
|
@@ -729,15 +798,6 @@ This call will look for all the package.json files that in the scan path `./myJa
|
|
|
729
798
|
|
|
730
799
|
You can include additional arguments as well:
|
|
731
800
|
|
|
732
|
-
#### Arguments
|
|
733
|
-
|
|
734
|
-
| Argument | Description | Type | Default | Required |
|
|
735
|
-
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------- | -------- |
|
|
736
|
-
| scanPath | File path in the project to scan. | string | N/A | true |
|
|
737
|
-
| dataSiloID | The UUID of the corresponding data silo. | string | N/A | true |
|
|
738
|
-
| auth | Transcend API key. | string | N/A | true |
|
|
739
|
-
| fileGlobs | You can pass a [glob syntax pattern(s)](https://github.com/mrmlnc/fast-glob) to specify additional file paths to scan in addition to the default (ex: package.json). | string | N/A | false |
|
|
740
|
-
|
|
741
801
|
### tr-request-approve
|
|
742
802
|
|
|
743
803
|
Bulk approve a set of privacy requests from the [DSR Automation -> Incoming Requests](https://app.transcend.io/privacy-requests/incoming-requests) tab.
|
|
@@ -9,12 +9,14 @@ const yargs_parser_1 = __importDefault(require("yargs-parser"));
|
|
|
9
9
|
const logger_1 = require("./logger");
|
|
10
10
|
const colors_1 = __importDefault(require("colors"));
|
|
11
11
|
const constants_1 = require("./constants");
|
|
12
|
-
const plugins_1 = require("./plugins");
|
|
13
12
|
const graphql_1 = require("./graphql");
|
|
14
|
-
const findFilesToScan_1 = require("./
|
|
13
|
+
const findFilesToScan_1 = require("./code-scanning/findFilesToScan");
|
|
14
|
+
const code_scanning_1 = require("./code-scanning");
|
|
15
15
|
/**
|
|
16
16
|
* Scan dependency files for new data silos.
|
|
17
17
|
*
|
|
18
|
+
* @deprecated TODO: https://transcend.height.app/T-32325 - use code scanning instead
|
|
19
|
+
*
|
|
18
20
|
* Dev Usage:
|
|
19
21
|
* yarn ts-node ./src/cli-discover-silos.ts --scanPath=./myJavascriptProject \
|
|
20
22
|
* --auth=$TRANSCEND_API_KEY \
|
|
@@ -37,8 +39,17 @@ async function main() {
|
|
|
37
39
|
// Create a GraphQL client
|
|
38
40
|
const client = (0, graphql_1.buildTranscendGraphQLClient)(transcendUrl, auth);
|
|
39
41
|
const plugin = await (0, graphql_1.fetchActiveSiloDiscoPlugin)(client, dataSiloId);
|
|
40
|
-
const config =
|
|
41
|
-
|
|
42
|
+
const config = code_scanning_1.SILO_DISCOVERY_CONFIGS[plugin.dataSilo.type];
|
|
43
|
+
if (!config) {
|
|
44
|
+
logger_1.logger.error(colors_1.default.red(`This plugin "${plugin.dataSilo.type}" is not supported for offline silo discovery.`));
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
const results = await (0, findFilesToScan_1.findFilesToScan)({
|
|
48
|
+
scanPath,
|
|
49
|
+
fileGlobs,
|
|
50
|
+
ignoreDirs,
|
|
51
|
+
config,
|
|
52
|
+
});
|
|
42
53
|
await (0, graphql_1.uploadSiloDiscoveryResults)(client, plugin.id, results);
|
|
43
54
|
const newUrl = new URL(constants_1.ADMIN_DASH);
|
|
44
55
|
newUrl.pathname = '/data-map/data-inventory/silo-discovery/triage';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-discover-silos.js","sourceRoot":"","sources":["../src/cli-discover-silos.ts"],"names":[],"mappings":";;;;;;AACA,+CAAyC;AACzC,gEAAiC;AACjC,qCAAkC;AAClC,oDAA4B;AAC5B,2CAAgE;AAChE,
|
|
1
|
+
{"version":3,"file":"cli-discover-silos.js","sourceRoot":"","sources":["../src/cli-discover-silos.ts"],"names":[],"mappings":";;;;;;AACA,+CAAyC;AACzC,gEAAiC;AACjC,qCAAkC;AAClC,oDAA4B;AAC5B,2CAAgE;AAChE,uCAImB;AACnB,qEAAkE;AAClE,mDAAyD;AAEzD;;;;;;;;;;;;;;;GAeG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,QAAQ,GAAG,GAAG,EACd,UAAU,GAAG,EAAE,EACf,YAAY,GAAG,iCAAqB,EACpC,UAAU,GAAG,EAAE,EACf,SAAS,GAAG,EAAE,EACd,IAAI,GACL,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjC,2BAA2B;IAC3B,IAAI,CAAC,IAAI,EAAE;QACT,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,uFAAuF,CACxF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,0BAA0B;IAC1B,MAAM,MAAM,GAAG,IAAA,qCAA2B,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAE/D,MAAM,MAAM,GAAG,MAAM,IAAA,oCAA0B,EAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAEpE,MAAM,MAAM,GAAG,sCAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5D,IAAI,CAAC,MAAM,EAAE;QACX,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,gBAAgB,MAAM,CAAC,QAAQ,CAAC,IAAI,gDAAgD,CACrF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,MAAM,OAAO,GAAG,MAAM,IAAA,iCAAe,EAAC;QACpC,QAAQ;QACR,SAAS;QACT,UAAU;QACV,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,IAAA,oCAA0B,EAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAE7D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,sBAAU,CAAC,CAAC;IACnC,MAAM,CAAC,QAAQ,GAAG,gDAAgD,CAAC;IACnE,MAAM,CAAC,MAAM,GAAG,IAAA,wBAAS,EAAC;QACxB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;KACpD,CAAC,CAAC;IAEH,mBAAmB;IACnB,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,cAAc,OAAO,CAAC,MAAM,4BAA4B,QAAQ,IAAI;QAClE,YAAY,MAAM,CAAC,IAAI,IAAI;QAC3B,0EAA0E,CAC7E,CACF,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-scan-packages.d.ts","sourceRoot":"","sources":["../src/cli-scan-packages.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const yargs_parser_1 = __importDefault(require("yargs-parser"));
|
|
8
|
+
const logger_1 = require("./logger");
|
|
9
|
+
const colors_1 = __importDefault(require("colors"));
|
|
10
|
+
const constants_1 = require("./constants");
|
|
11
|
+
const code_scanning_1 = require("./code-scanning");
|
|
12
|
+
const graphql_1 = require("./graphql");
|
|
13
|
+
const child_process_1 = require("child_process");
|
|
14
|
+
const requests_1 = require("./requests");
|
|
15
|
+
const REPO_ERROR = 'A repository name must be provided. ' +
|
|
16
|
+
'You can specify using --repositoryName=$REPO_NAME or by ensuring the ' +
|
|
17
|
+
'command "git config --get remote.origin.url" returns the name of the repository';
|
|
18
|
+
/**
|
|
19
|
+
* Scan a codebase to discovery new:
|
|
20
|
+
* - codePackages
|
|
21
|
+
* - softwareDevelopmentKits
|
|
22
|
+
*
|
|
23
|
+
* Dev Usage:
|
|
24
|
+
* yarn ts-node ./src/cli-scan-packages.ts --auth=$TRANSCEND_API_KEY \
|
|
25
|
+
* --scanPath=./ \
|
|
26
|
+
* --ignoreDirs=build_directories_to_ignore
|
|
27
|
+
*
|
|
28
|
+
* Standard usage
|
|
29
|
+
* yarn tr-scan-packages --auth=$TRANSCEND_API_KE --scanPath=./
|
|
30
|
+
*/
|
|
31
|
+
async function main() {
|
|
32
|
+
// Parse command line arguments
|
|
33
|
+
const { scanPath = '.', ignoreDirs = '', transcendUrl = constants_1.DEFAULT_TRANSCEND_API, repositoryName, auth, } = (0, yargs_parser_1.default)(process.argv.slice(2));
|
|
34
|
+
// // Ensure auth is passed
|
|
35
|
+
if (!auth) {
|
|
36
|
+
logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY'));
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
// Ensure repository name is specified
|
|
40
|
+
let gitRepositoryName = repositoryName;
|
|
41
|
+
if (!gitRepositoryName) {
|
|
42
|
+
try {
|
|
43
|
+
const name = (0, child_process_1.execSync)('git config --get remote.origin.url');
|
|
44
|
+
// Trim and parse the URL
|
|
45
|
+
const url = name.toString('utf-8').trim();
|
|
46
|
+
[gitRepositoryName] = (url.split(':').pop() || '').split('.');
|
|
47
|
+
if (!gitRepositoryName) {
|
|
48
|
+
logger_1.logger.error(colors_1.default.red(REPO_ERROR));
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
logger_1.logger.error(colors_1.default.red(`${REPO_ERROR} - Got error: ${err.message}`));
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Create a GraphQL client
|
|
58
|
+
const client = (0, graphql_1.buildTranscendGraphQLClient)(transcendUrl, auth);
|
|
59
|
+
// Scan the codebase to discovery packages
|
|
60
|
+
const results = await (0, code_scanning_1.findCodePackagesInFolder)({
|
|
61
|
+
scanPath,
|
|
62
|
+
ignoreDirs: ignoreDirs ? (0, requests_1.splitCsvToList)(ignoreDirs) : [],
|
|
63
|
+
repositoryName: gitRepositoryName,
|
|
64
|
+
});
|
|
65
|
+
// Report scan to Transcend
|
|
66
|
+
await (0, graphql_1.syncCodePackages)(client, results);
|
|
67
|
+
const newUrl = new URL(constants_1.ADMIN_DASH);
|
|
68
|
+
newUrl.pathname = '/code-scanning/code-packages';
|
|
69
|
+
// Indicate success
|
|
70
|
+
logger_1.logger.info(colors_1.default.green(`Scan found ${results.length} packages at ${scanPath}! ` +
|
|
71
|
+
`View results at '${newUrl.href}'`));
|
|
72
|
+
}
|
|
73
|
+
main();
|
|
74
|
+
//# sourceMappingURL=cli-scan-packages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-scan-packages.js","sourceRoot":"","sources":["../src/cli-scan-packages.ts"],"names":[],"mappings":";;;;;;AACA,gEAAiC;AACjC,qCAAkC;AAClC,oDAA4B;AAC5B,2CAAgE;AAChE,mDAA2D;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AiB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;KACF;IAED,0BAA0B;IAC1B,MAAM,MAAM,GAAG,IAAA,qCAA2B,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAE/D,0CAA0C;IAC1C,MAAM,OAAO,GAAG,MAAM,IAAA,wCAAwB,EAAC;QAC7C,QAAQ;QACR,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,IAAA,yBAAc,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;QACxD,cAAc,EAAE,iBAAiB;KAClC,CAAC,CAAC;IAEH,2BAA2B;IAC3B,MAAM,IAAA,0BAAgB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAExC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,sBAAU,CAAC,CAAC;IACnC,MAAM,CAAC,QAAQ,GAAG,8BAA8B,CAAC;IAEjD,mBAAmB;IACnB,eAAM,CAAC,IAAI,CACT,gBAAM,CAAC,KAAK,CACV,cAAc,OAAO,CAAC,MAAM,gBAAgB,QAAQ,IAAI;QACtD,oBAAoB,MAAM,CAAC,IAAI,GAAG,CACrC,CACF,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CodeScanningConfig } from './types';
|
|
2
|
+
import { CodePackageType } from '@transcend-io/privacy-types';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated TODO: https://transcend.height.app/T-32325 - use code scanning instead
|
|
5
|
+
*/
|
|
6
|
+
export declare const SILO_DISCOVERY_CONFIGS: {
|
|
7
|
+
[k in string]: CodeScanningConfig;
|
|
8
|
+
};
|
|
9
|
+
export declare const CODE_SCANNING_CONFIGS: {
|
|
10
|
+
[k in CodePackageType]: CodeScanningConfig;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/code-scanning/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAS7C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE;KAClC,CAAC,IAAI,MAAM,GAAG,kBAAkB;CAQlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE;KACjC,CAAC,IAAI,eAAe,GAAG,kBAAkB;CAQ3C,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CODE_SCANNING_CONFIGS = exports.SILO_DISCOVERY_CONFIGS = void 0;
|
|
4
|
+
const integrations_1 = require("./integrations");
|
|
5
|
+
const privacy_types_1 = require("@transcend-io/privacy-types");
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated TODO: https://transcend.height.app/T-32325 - use code scanning instead
|
|
8
|
+
*/
|
|
9
|
+
exports.SILO_DISCOVERY_CONFIGS = {
|
|
10
|
+
cocoaPods: integrations_1.cocoaPods,
|
|
11
|
+
gradle: integrations_1.gradle,
|
|
12
|
+
javascriptPackageJson: integrations_1.javascriptPackageJson,
|
|
13
|
+
pythonRequirementsTxt: integrations_1.pythonRequirementsTxt,
|
|
14
|
+
gemfile: integrations_1.gemfile,
|
|
15
|
+
pubspec: integrations_1.pubspec,
|
|
16
|
+
};
|
|
17
|
+
exports.CODE_SCANNING_CONFIGS = {
|
|
18
|
+
[privacy_types_1.CodePackageType.CocoaPods]: integrations_1.cocoaPods,
|
|
19
|
+
[privacy_types_1.CodePackageType.Gradle]: integrations_1.gradle,
|
|
20
|
+
[privacy_types_1.CodePackageType.PackageJson]: integrations_1.javascriptPackageJson,
|
|
21
|
+
[privacy_types_1.CodePackageType.RequirementsTxt]: integrations_1.pythonRequirementsTxt,
|
|
22
|
+
[privacy_types_1.CodePackageType.Gemfile]: integrations_1.gemfile,
|
|
23
|
+
[privacy_types_1.CodePackageType.Pubspec]: integrations_1.pubspec,
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/code-scanning/constants.ts"],"names":[],"mappings":";;;AACA,iDAOwB;AACxB,+DAA8D;AAE9D;;GAEG;AACU,QAAA,sBAAsB,GAE/B;IACF,SAAS,EAAT,wBAAS;IACT,MAAM,EAAN,qBAAM;IACN,qBAAqB,EAArB,oCAAqB;IACrB,qBAAqB,EAArB,oCAAqB;IACrB,OAAO,EAAP,sBAAO;IACP,OAAO,EAAP,sBAAO;CACR,CAAC;AAEW,QAAA,qBAAqB,GAE9B;IACF,CAAC,+BAAe,CAAC,SAAS,CAAC,EAAE,wBAAS;IACtC,CAAC,+BAAe,CAAC,MAAM,CAAC,EAAE,qBAAM;IAChC,CAAC,+BAAe,CAAC,WAAW,CAAC,EAAE,oCAAqB;IACpD,CAAC,+BAAe,CAAC,eAAe,CAAC,EAAE,oCAAqB;IACxD,CAAC,+BAAe,CAAC,OAAO,CAAC,EAAE,sBAAO;IAClC,CAAC,+BAAe,CAAC,OAAO,CAAC,EAAE,sBAAO;CACnC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CodePackageInput } from '../codecs';
|
|
2
|
+
/**
|
|
3
|
+
* Helper to scan and discovery all of the code packages within a folder
|
|
4
|
+
*
|
|
5
|
+
* @param options - Options
|
|
6
|
+
* @returns the list of integrations
|
|
7
|
+
*/
|
|
8
|
+
export declare function findCodePackagesInFolder({ scanPath, ignoreDirs, repositoryName, }: {
|
|
9
|
+
/** The name of the github repository reporting packages for */
|
|
10
|
+
repositoryName: string;
|
|
11
|
+
/** Where to look for package.json files */
|
|
12
|
+
scanPath: string;
|
|
13
|
+
/** The directories to ignore (excludes node_modules and serverless-build) */
|
|
14
|
+
ignoreDirs?: string[];
|
|
15
|
+
}): Promise<CodePackageInput[]>;
|
|
16
|
+
//# sourceMappingURL=findCodePackagesInFolder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findCodePackagesInFolder.d.ts","sourceRoot":"","sources":["../../src/code-scanning/findCodePackagesInFolder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAK7C;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,QAAQ,EACR,UAAe,EACf,cAAc,GACf,EAAE;IACD,+DAA+D;IAC/D,cAAc,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAyD9B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.findCodePackagesInFolder = void 0;
|
|
7
|
+
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
8
|
+
const type_utils_1 = require("@transcend-io/type-utils");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const logger_1 = require("../logger");
|
|
11
|
+
/**
|
|
12
|
+
* Helper to scan and discovery all of the code packages within a folder
|
|
13
|
+
*
|
|
14
|
+
* @param options - Options
|
|
15
|
+
* @returns the list of integrations
|
|
16
|
+
*/
|
|
17
|
+
async function findCodePackagesInFolder({ scanPath, ignoreDirs = [], repositoryName, }) {
|
|
18
|
+
const allCodePackages = await Promise.all((0, type_utils_1.getEntries)(constants_1.CODE_SCANNING_CONFIGS).map(async ([codePackageType, config]) => {
|
|
19
|
+
const { ignoreDirs: configIgnoreDirs, supportedFiles, scanFunction, } = config;
|
|
20
|
+
const dirsToIgnore = [...ignoreDirs, ...configIgnoreDirs].filter((dir) => dir.length > 0);
|
|
21
|
+
try {
|
|
22
|
+
const filesToScan = await (0, fast_glob_1.default)(`${scanPath}/**/${supportedFiles.join('|')}`, {
|
|
23
|
+
ignore: dirsToIgnore.map((dir) => `${scanPath}/**/${dir}`),
|
|
24
|
+
unique: true,
|
|
25
|
+
onlyFiles: true,
|
|
26
|
+
});
|
|
27
|
+
logger_1.logger.info(`Scanning: ${filesToScan.length} files of type ${codePackageType}`);
|
|
28
|
+
const allPackages = filesToScan
|
|
29
|
+
.map((filePath) => scanFunction(filePath).map((result) => ({
|
|
30
|
+
...result,
|
|
31
|
+
relativePath: filePath.replace(`${scanPath}/`, ''),
|
|
32
|
+
})))
|
|
33
|
+
.flat();
|
|
34
|
+
logger_1.logger.info(`Found: ${allPackages.length} packages and ${allPackages
|
|
35
|
+
.map(({ softwareDevelopmentKits = [] }) => softwareDevelopmentKits)
|
|
36
|
+
.flat().length} sdks`);
|
|
37
|
+
return allPackages.map((pkg) => ({
|
|
38
|
+
...pkg,
|
|
39
|
+
type: codePackageType,
|
|
40
|
+
repositoryName,
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
throw new Error(`Error scanning globs ${supportedFiles} with error: ${error}`);
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
return allCodePackages.flat();
|
|
48
|
+
}
|
|
49
|
+
exports.findCodePackagesInFolder = findCodePackagesInFolder;
|
|
50
|
+
//# sourceMappingURL=findCodePackagesInFolder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findCodePackagesInFolder.js","sourceRoot":"","sources":["../../src/code-scanning/findCodePackagesInFolder.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAiC;AAEjC,yDAAsD;A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;YACV,eAAM,CAAC,IAAI,CACT,UAAU,WAAW,CAAC,MAAM,iBAC1B,WAAW;iBACR,GAAG,CACF,CAAC,EAAE,uBAAuB,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,uBAAuB,CAC9D;iBACA,IAAI,EAAE,CAAC,MACZ,OAAO,CACR,CAAC;YAEF,OAAO,WAAW,CAAC,GAAG,CACpB,CAAC,GAAG,EAAoB,EAAE,CAAC,CAAC;gBAC1B,GAAG,GAAG;gBACN,IAAI,EAAE,eAAe;gBACrB,cAAc;aACf,CAAC,CACH,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,KAAK,CACb,wBAAwB,cAAc,gBAAgB,KAAK,EAAE,CAC9D,CAAC;SACH;IACH,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,eAAe,CAAC,IAAI,EAAE,CAAC;AAChC,CAAC;AApED,4DAoEC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CodeScanningConfig } from './types';
|
|
2
|
+
export interface SiloDiscoveryRawResults {
|
|
3
|
+
/** The name of the potential data silo entry */
|
|
4
|
+
name: string;
|
|
5
|
+
/** A unique UUID (represents the same resource across different silo discovery runs) */
|
|
6
|
+
resourceId: string;
|
|
7
|
+
/** Any hosts associated with the entry */
|
|
8
|
+
host?: string;
|
|
9
|
+
/** Type of data silo */
|
|
10
|
+
type?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Helper to scan for data silos in all package.json files that it can find in a directory
|
|
14
|
+
*
|
|
15
|
+
* @deprecated TODO: https://transcend.height.app/T-32325 - use code scanning instead
|
|
16
|
+
* @param options - Options
|
|
17
|
+
* @returns the list of integrations
|
|
18
|
+
*/
|
|
19
|
+
export declare function findFilesToScan({ scanPath, fileGlobs, ignoreDirs, config, }: {
|
|
20
|
+
/** Where to look for package.json files */
|
|
21
|
+
scanPath: string;
|
|
22
|
+
/** Globs to look for */
|
|
23
|
+
fileGlobs: string;
|
|
24
|
+
/** The directories to ignore (excludes node_modules and serverless-build) */
|
|
25
|
+
ignoreDirs: string;
|
|
26
|
+
/** Silo Discovery configuration */
|
|
27
|
+
config: CodeScanningConfig;
|
|
28
|
+
}): Promise<SiloDiscoveryRawResults[]>;
|
|
29
|
+
//# sourceMappingURL=findFilesToScan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findFilesToScan.d.ts","sourceRoot":"","sources":["../../src/code-scanning/findFilesToScan.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,WAAW,uBAAuB;IACtC,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,EACpC,QAAQ,EACR,SAAS,EACT,UAAU,EACV,MAAM,GACP,EAAE;IACD,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,MAAM,EAAE,kBAAkB,CAAC;CAC5B,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAsCrC"}
|
|
@@ -9,13 +9,11 @@ const logger_1 = require("../logger");
|
|
|
9
9
|
/**
|
|
10
10
|
* Helper to scan for data silos in all package.json files that it can find in a directory
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
13
|
-
* @param
|
|
14
|
-
* @param ignoreDirs - The directories to ignore (excludes node_modules and serverless-build)
|
|
15
|
-
* @param config - Silo Discovery configuration
|
|
12
|
+
* @deprecated TODO: https://transcend.height.app/T-32325 - use code scanning instead
|
|
13
|
+
* @param options - Options
|
|
16
14
|
* @returns the list of integrations
|
|
17
15
|
*/
|
|
18
|
-
|
|
16
|
+
async function findFilesToScan({ scanPath, fileGlobs, ignoreDirs, config, }) {
|
|
19
17
|
const { ignoreDirs: IGNORE_DIRS, supportedFiles, scanFunction } = config;
|
|
20
18
|
const globsToSupport = fileGlobs === ''
|
|
21
19
|
? supportedFiles
|
|
@@ -28,22 +26,24 @@ const findFilesToScan = async (scanPath, fileGlobs, ignoreDirs, config) => {
|
|
|
28
26
|
onlyFiles: true,
|
|
29
27
|
});
|
|
30
28
|
logger_1.logger.info(`Scanning: ${filesToScan.length} files`);
|
|
31
|
-
const
|
|
29
|
+
const allPackages = filesToScan
|
|
32
30
|
.map((filePath) => scanFunction(filePath))
|
|
33
31
|
.flat();
|
|
34
|
-
const
|
|
32
|
+
const allSdks = allPackages
|
|
33
|
+
.map((appPackage) => appPackage.softwareDevelopmentKits || [])
|
|
34
|
+
.flat();
|
|
35
|
+
const uniqueDeps = new Set(allSdks.map((sdk) => sdk.name));
|
|
35
36
|
const deps = [...uniqueDeps];
|
|
36
37
|
logger_1.logger.info(`Found: ${deps.length} unique dependencies`);
|
|
37
38
|
return deps.map((dep) => ({
|
|
38
|
-
name: dep
|
|
39
|
-
|
|
40
|
-
resourceId: `${scanPath}/**/${dep.name}`,
|
|
39
|
+
name: dep,
|
|
40
|
+
resourceId: `${scanPath}/**/${dep}`,
|
|
41
41
|
useStrictClassifier: true,
|
|
42
42
|
}));
|
|
43
43
|
}
|
|
44
44
|
catch (error) {
|
|
45
|
-
throw new Error(`Error scanning globs ${
|
|
45
|
+
throw new Error(`Error scanning globs ${findFilesToScan} with error: ${error}`);
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|
|
48
48
|
exports.findFilesToScan = findFilesToScan;
|
|
49
49
|
//# sourceMappingURL=findFilesToScan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findFilesToScan.js","source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CAAC;aAC7D,IAAI,EAAE,CAAC;QACV,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3D,MAAM,IAAI,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;QAC7B,eAAM,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,MAAM,sBAAsB,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACxB,IAAI,EAAE,GAAG;YACT,UAAU,EAAE,GAAG,QAAQ,OAAO,GAAG,EAAE;YACnC,mBAAmB,EAAE,IAAI;SAC1B,CAAC,CAAC,CAAC;KACL;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CACb,wBAAwB,eAAe,gBAAgB,KAAK,EAAE,CAC/D,CAAC;KACH;AACH,CAAC;AApDD,0CAoDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-scanning/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,4BAA4B,CAAC"}
|
|
@@ -15,6 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./constants"), exports);
|
|
18
|
-
__exportStar(require("./typeguards"), exports);
|
|
19
18
|
__exportStar(require("./types"), exports);
|
|
19
|
+
__exportStar(require("./findCodePackagesInFolder"), exports);
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/code-scanning/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,0CAAwB;AACxB,6DAA2C"}
|