Skip to content

Commit d58eeed

Browse files
authored
Improving Codespaces and Setup Experince (#9)
* So many nice changes to put into one * making it executable * Code cleanup task * Changelog updates * updated information
1 parent e708a4c commit d58eeed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+12449
-30593
lines changed

.devcontainer/devcontainer.json

+19-18
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
2-
"name": "nickliffen/ghas-enablement",
3-
"image": "ghcr.io/nickliffen/csenv:main",
4-
"settings": {},
5-
"extensions": [
6-
"dbaeumer.vscode-eslint",
7-
"hookyqr.beautify",
8-
"naumovs.color-highlight",
9-
"redhat.vscode-yaml",
10-
"vscode-icons-team.vscode-icons",
11-
"wayou.vscode-todo-highlight",
12-
"esbenp.prettier-vscode",
13-
"ms-vscode.vscode-typescript-next",
14-
"github.copilot",
15-
"donjayamanne.githistory",
16-
"nixon.env-cmd-file-syntax"
17-
],
18-
"remoteUser": "root"
19-
}
2+
"name": "nickliffen/GSSAR",
3+
"image": "ghcr.io/nickliffen/csenv:main",
4+
"settings": {},
5+
"extensions": [
6+
"dbaeumer.vscode-eslint",
7+
"hookyqr.beautify",
8+
"naumovs.color-highlight",
9+
"redhat.vscode-yaml",
10+
"vscode-icons-team.vscode-icons",
11+
"wayou.vscode-todo-highlight",
12+
"esbenp.prettier-vscode",
13+
"ms-vscode.vscode-typescript-next",
14+
"github.copilot",
15+
"donjayamanne.githistory",
16+
"nixon.env-cmd-file-syntax"
17+
],
18+
"postCreateCommand": "yarn install --frozen-lockfile && yarn run codespace-setup",
19+
"remoteUser": "root"
20+
}

.devcontainer/setup.sh

100644100755
+6-6
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ function setup {
55
[ -L "${d%/}" ] && continue
66
echo "Processing $d"
77
cd "$d"
8-
npm install
9-
npm run format
10-
npm run build
8+
yarn
119
cd ..
1210
done
1311
}
1412

15-
cd /workspaces/GCSMTTR/functions/helpers
13+
cd /workspaces/GSSAR/functions/helpers
1614

1715
setup
1816

19-
cd /workspaces/GCSMTTR/functions/authorizers
17+
cd /workspaces/GSSAR/functions/authorizers
2018

2119
setup
2220

23-
cd /workspaces/GCSMTTR/functions/remediators
21+
cd /workspaces/GSSAR/functions/remediators
22+
23+
setup
File renamed without changes.

.eslintrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint"],
5+
"extends": [
6+
"eslint:recommended",
7+
"plugin:@typescript-eslint/eslint-recommended",
8+
"plugin:@typescript-eslint/recommended"
9+
]
10+
}

.github/workflows/deploy.yaml

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Deploying GSSAR
2-
'on':
2+
"on":
33
push:
44
branches:
55
- main
@@ -19,55 +19,55 @@ jobs:
1919
- name: Setup NodeJS
2020
uses: actions/setup-node@v2
2121
with:
22-
node-version: '16'
22+
node-version: "16"
2323
- name: Setup Python
2424
uses: actions/setup-python@v2
2525
with:
26-
python-version: '3.8'
26+
python-version: "3.8"
2727
- name: Setup AWS SAM
2828
uses: aws-actions/setup-sam@v1
2929
- name: Configure AWS Credentials
3030
uses: aws-actions/configure-aws-credentials@v1
3131
with:
32-
aws-access-key-id: '${{ secrets.AWS_ACCESS_KEY_ID }}'
33-
aws-secret-access-key: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
34-
aws-region: '${{ env.REGION }}'
32+
aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}"
33+
aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
34+
aws-region: "${{ env.REGION }}"
3535
- name: Install and Build Function (GithubWebhookIPValidator)
3636
run: |
3737
cd ./functions/authorizers/githubWebhookIPValidator
38-
npm cache clean --force
39-
npm install
40-
npm run build
38+
yarn cache clean --force
39+
yarn install --frozen-lockfile
40+
yarn run build
4141
- name: Install and Build Function (GithubWebhookSecretValidator)
4242
run: |
4343
cd ./functions/authorizers/githubWebhookSecretValidator
44-
npm cache clean --force
45-
npm install
46-
npm run build
44+
yarn cache clean --force
45+
yarn install --frozen-lockfile
46+
yarn run build
4747
- name: Install and Build Function (GetSecretDetails)
4848
run: |
4949
cd ./functions/helpers/getSecretDetails
50-
npm cache clean --force
51-
npm install
52-
npm run build
50+
yarn cache clean --force
51+
yarn install --frozen-lockfile
52+
yarn run build
5353
- name: Install and Build Function (CloseSecret)
5454
run: |
5555
cd ./functions/helpers/closeSecret
56-
npm cache clean --force
57-
npm install
58-
npm run build
56+
yarn cache clean --force
57+
yarn install --frozen-lockfile
58+
yarn run build
5959
- name: Install and Build Function (GithubIssueNotifier)
6060
run: |
6161
cd ./functions/helpers/githubIssueNotifier
62-
npm cache clean --force
63-
npm install
64-
npm run build
62+
yarn cache clean --force
63+
yarn install --frozen-lockfile
64+
yarn run build
6565
- name: Install and Build Function (RemediateAWSAccessKey)
6666
run: |
6767
cd ./functions/remediators/remediateAWSAccessKey
68-
npm cache clean --force
69-
npm install
70-
npm run build
68+
yarn cache clean --force
69+
yarn install --frozen-lockfile
70+
yarn run build
7171
- name: SAM Build
7272
run: sam build --use-container
7373
- name: SAM Deploy

.github/workflows/test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Testing GSSAR
2-
'on':
2+
"on":
33
push:
44
branches:
55
- main

.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
yarn run check

CHANGELOG.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [v1.1.0](https://github.com/NickLiffen/GSSAR/releases/v1.1.0) - 2021-12-06
9+
10+
- Better Codespaces setup
11+
- More consistentcy across `README.md` files.
12+
- Moving from `npm` to `yarn`.
13+
814
## [v1.0.1](https://github.com/NickLiffen/GSSAR/releases/v1.0.0) - 2021-09-09
915

1016
- Authorizers: Fixed a bug where the github secret was not getting validated
1117

1218
## [v1.0.0](https://github.com/NickLiffen/GSSAR/releases/v1.0.0) - 2021-09-03
1319

1420
- Authorizers: Functions that validates the webhook comes from a valid GitHub IP and validates the secret.
15-
- Helpers: Functions that support the end-to-end process for GSSAR but do not perform any remediation. E.G. Function for closing a secret.
16-
- Remediators: Functions that revoke certain secret types.
17-
- GitHub workflow that deploys the solution to AWS.
18-
- Infrastructure as Code (IaC) written in Cloud Formation.
21+
- Helpers: Functions that support the end-to-end process for GSSAR but do not perform any remediation. E.G. Function for closing a secret.
22+
- Remediators: Functions that revoke certain secret types.
23+
- GitHub workflow that deploys the solution to AWS.
24+
- Infrastructure as Code (IaC) written in Cloud Formation.

0 commit comments

Comments
 (0)