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

Release 3.1.3 -- log API Secret error, increase log retention #152

Merged
merged 6 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Test and Deploy

on:
push:
branches: ["**"]
paths-ignore:
- 'terraform/**'

env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dev-server:
node development/server

dynamodb:
docker-compose up -d dynamodb
docker compose up -d dynamodb

dynamodb-tables: dynamodb
./development/create-tables.sh
Expand All @@ -11,10 +11,10 @@ list-dev-api-keys:
./development/list-api-keys.sh

do-full-recovery:
docker-compose run --rm do-full-recovery
docker compose run --rm do-full-recovery

test:
docker-compose run --rm dev bash -c "npm ci && npm test"
docker compose run --rm dev bash -c "npm ci && npm test"

update:
docker-compose run --rm dev bash -c "npm update"
docker compose run --rm dev bash -c "npm update"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ To run this locally (such as for development)...
To start a local container for development of Serverless configuration:

```
docker-compose run --rm dev bash
docker compose run --rm dev bash
```
## Credential Rotation
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3"

services:
do-full-recovery:
build: recovery
Expand Down
2 changes: 2 additions & 0 deletions models/api-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ const isValidApiSecret = (apiKeyRecord, apiSecret = '') => {
const isValid = password.compare(apiSecret, apiKeyRecord.hashedApiSecret);
if (isValid !== true) {
console.log('The given API Secret is NOT valid for the given API Key record.');
const redactedApiSecret = apiSecret.substring(0, 3) + '...[snip]...' + apiSecret.substring(apiSecret.length - 3);
console.log(redactedApiSecret);
return false;
}

Expand Down
20 changes: 10 additions & 10 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,50 +175,50 @@ resources:
ApiKeyActivateLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: "30"
RetentionInDays: "60"
Tags: ${self:custom.resourceTags}
ApiKeyCreateLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: "30"
RetentionInDays: "60"
Tags: ${self:custom.resourceTags}
TotpCreateLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: "30"
RetentionInDays: "60"
Tags: ${self:custom.resourceTags}
TotpDeleteLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: "30"
RetentionInDays: "60"
Tags: ${self:custom.resourceTags}
TotpValidateLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: "30"
RetentionInDays: "60"
Tags: ${self:custom.resourceTags}
U2fCreateAuthenticationLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: "30"
RetentionInDays: "60"
Tags: ${self:custom.resourceTags}
U2fCreateRegistrationLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: "30"
RetentionInDays: "60"
Tags: ${self:custom.resourceTags}
U2fDeleteLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: "30"
RetentionInDays: "60"
Tags: ${self:custom.resourceTags}
U2fValidateAuthenticationLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: "30"
RetentionInDays: "60"
Tags: ${self:custom.resourceTags}
U2fValidateRegistrationLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: "30"
RetentionInDays: "60"
Tags: ${self:custom.resourceTags}
1 change: 1 addition & 0 deletions terraform/.terraform.lock.hcl

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

3 changes: 1 addition & 2 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ locals {
module "serverless_user" {
count = var.app_environment == "staging" ? 1 : 0
source = "silinternational/serverless-user/aws"
version = "0.3.2"
version = "0.4.2"

app_name = var.app_name
aws_region = var.aws_region
aws_region_policy = "*"
enable_api_gateway = true

Expand Down