You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: data_logger/README.md
+61-3Lines changed: 61 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,38 @@ This repository makes use of a Makefile to execute common commands. To view all
26
26
make all
27
27
```
28
28
29
+
## `config.json`
30
+
31
+
The lambda function contains a configuration file ([`config.json`](./config/config.json)). This file is used to setup key values within the script.
32
+
33
+
`config.json` is divided into 2 high level keys: features and settings.
34
+
35
+
The features key is used to enable or disable specific features within the tool (for example if you didn't want to collect dependabot information).
36
+
37
+
The settings key is used to store key values used to collect and process data. This includes values such as how many threads to collect data with and how many years a repository must go without updates before it is considered inactive.
38
+
39
+
The table below describes each configuration parameter and its use.
40
+
41
+
### Features
42
+
43
+
| Parameter | Description | Default |
44
+
| --------- | ----------- | ------- |
45
+
|`repository_collection`| Whether to collect repository data or not. | true |
46
+
|`dependabot_collection`| Whether to collect dependabot data or not. | true |
47
+
|`secret_scanning_collection`| Whether to collection secret scanning data or not. | true |
48
+
|`show_log_locally`| This is for development purposes. This controls whether the log is stored locally as `debug.log`. This allows developers to see logging outputs when running the tool locally | true |
49
+
|`write_to_s3`| Whether the tool should write its outputs to S3 or store them locally. Local storage is useful when testing / developing the tool locally. Local outputs are kept within `./output/`. When deploying to AWS, this key should **always** be `true`. | true |
50
+
51
+
### Settings
52
+
53
+
| Parameter | Description | Default |
54
+
| --------- | ----------- | ------- |
55
+
|`thread_count`| The number of threads to collect and process data with. | 20 |
56
+
|`dependabot_thresholds`| This contains information about how many days a dependabot alert for a given severity is open before being considered a policy breach. | critical (5), high (15), medium (60), low (90) |
57
+
|`secret_scanning_threshold`| The number of days a secret scanning alert must be open for before being considered a policy breach. | 5 days |
58
+
|`inactivity_threshold`| The number of years a project goes without updates before being considered inactive. | 1 year |
59
+
|`signed_commit_number`| The number of repository commits to check within the signed commit check (for example, when set to 15, only the 15 most recent commits). | 15 |
60
+
29
61
## Development
30
62
31
63
To work on this project, you need to:
@@ -217,23 +249,31 @@ All of the commands (steps 2-5) are available for your environment within the AW
@@ -243,6 +283,22 @@ Once pushed, you should be able to see your new image version within the ECR rep
243
283
244
284
### Deploying the Lambda
245
285
286
+
#### Configuration
287
+
288
+
##### `lambda_memory`
289
+
290
+
Within your `.tfvars`for the respective environment, you can define the amount of memory assigned to the lambda function. The amount of memory given to a lambda also affects how much CPU resource is assigned to it. For more information on this see:
Within our environments, this value will need to vary.
296
+
297
+
- For **sdp-dev**, `lambda_memory` should be set to 128. This is to reduce cost and, because of the decreased volume of information, reduces wasted resource.
298
+
- For **sdp-prod**, `lambda_memory` should be set to 1024. This is because of the larger volume of data needing to be processed within the lambda's runtime (15 minutes).
299
+
300
+
#### Instructions
301
+
246
302
Once AWS ECR has the new container image, we need to update the Lambda's configuration to use it. To do this, use the repository's provided [Terraform](./terraform/).
247
303
248
304
Within the terraform directory, there is a [service](../terraform/data_logger/) subdirectory which contains the terraform to setup the lambda on AWS.
@@ -261,6 +317,8 @@ Within the terraform directory, there is a [service](../terraform/data_logger/)
261
317
262
318
**It is crucial that the completed `.tfvars` file does not get committed to GitHub.**
263
319
320
+
Ensure that you have read the [configuration guide](#configuration) **before** deployment.
321
+
264
322
3. Initialise the terraform using the appropriate `.tfbackend` file for the environment (`env/dev/backend-dev.tfbackend` or `env/prod/backend-prod.tfbackend`).
0 commit comments