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

[IBCDPE-1007] Monitoring and security scanning #14

Merged
merged 164 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
c2c74de
Create a spacelift private workerpool
BryanFauble Jul 18, 2024
84c36db
Add the private workerpool module
BryanFauble Jul 18, 2024
3c08ae6
Allow conditional create of the workerpool
BryanFauble Jul 18, 2024
324ce7f
skip creating worker pool
BryanFauble Jul 18, 2024
4546b72
Add missed variable
BryanFauble Jul 18, 2024
d224c1b
increment workerpool
BryanFauble Jul 18, 2024
0e9324b
Correct version of helm chart
BryanFauble Jul 18, 2024
d3d5c24
Increment workerpool module version
BryanFauble Jul 18, 2024
c928d8a
Create the k8s worker pool
BryanFauble Jul 18, 2024
5b39416
Add warning for drift detection
BryanFauble Jul 18, 2024
83b96f1
Set to private worker pool id
BryanFauble Jul 18, 2024
63a6868
Enable drift detection via tf
BryanFauble Jul 18, 2024
f6378bb
correct resource name
BryanFauble Jul 18, 2024
ba2dbb4
Remove drift detection from stack
BryanFauble Jul 18, 2024
97f0412
Remove note
BryanFauble Jul 18, 2024
ebd8b3d
Comment out already imported block
BryanFauble Jul 18, 2024
b4517ec
Add module back for 2 step removal process
BryanFauble Jul 18, 2024
d53caa6
Remove private workerpool module
BryanFauble Jul 18, 2024
d60047a
Leave helm provider
BryanFauble Jul 18, 2024
dbf0d45
Merge branch 'ibcdpe-935-private-worker-pool' into ibcdpe-935-vpc-upd…
BryanFauble Jul 18, 2024
910b4e5
hacking around to get the helm_release out of state
BryanFauble Jul 18, 2024
98efa20
Leave module in to remove resources
BryanFauble Jul 18, 2024
3ada360
Remove module
BryanFauble Jul 18, 2024
846b1c2
Update to specify provider required versions in modules instead of pr…
BryanFauble Jul 18, 2024
90f38ef
Updating modules
BryanFauble Jul 18, 2024
b20890d
Remove provider that is not actually required
BryanFauble Jul 18, 2024
a6229bd
Try setting load bal ip ranges
BryanFauble Jul 18, 2024
589de1d
Capture flow logs
BryanFauble Jul 19, 2024
d1a8d28
Catpure flow logs
BryanFauble Jul 19, 2024
113e816
Add to documentation
BryanFauble Jul 19, 2024
200821a
Allow cloud watch logs to be toggled for the EKS module
BryanFauble Jul 19, 2024
9f7e206
Set cloudwatch retention to 1
BryanFauble Jul 19, 2024
a9cdfc3
Set log group class
BryanFauble Jul 19, 2024
00df837
Update to use new vpc module
BryanFauble Jul 19, 2024
5940683
Enable flow log
BryanFauble Jul 19, 2024
788c531
Increment module
BryanFauble Jul 19, 2024
1946b29
Change which port the frontend is running on
BryanFauble Jul 19, 2024
67d06ae
correct which port front-end is listening on
BryanFauble Jul 19, 2024
28d01db
update ports to 80 across the board
BryanFauble Jul 19, 2024
ffef0b2
Add security enforcement for pod
BryanFauble Jul 19, 2024
2d6694d
Leave enforcement on standard
BryanFauble Jul 19, 2024
169b977
set enforcement mode to strict
BryanFauble Jul 19, 2024
fb63178
Create a security group for client
BryanFauble Jul 19, 2024
45eb37a
Leave security group out
BryanFauble Jul 19, 2024
a6b5ff7
Leave out SG
BryanFauble Jul 20, 2024
33d841c
Leave out SG
BryanFauble Jul 20, 2024
fe22b73
Create aws integration for aws dev account
BryanFauble Jul 22, 2024
41d926f
Update integration ID for AWS
BryanFauble Jul 22, 2024
fda882c
Allow setting AWS account in EKS module
BryanFauble Jul 22, 2024
93ead31
Set AWS account to use for EKS module
BryanFauble Jul 22, 2024
d4e3f72
Change which spotinst account to connect to
BryanFauble Jul 22, 2024
984e83f
Apply pod level security group
BryanFauble Jul 22, 2024
3d84150
Add security groups to all pods
BryanFauble Jul 22, 2024
cf2e616
Single security group block
BryanFauble Jul 22, 2024
1b8fb87
rm tag
BryanFauble Jul 22, 2024
41bc5d9
Allow all ports
BryanFauble Jul 22, 2024
72faf17
egress from self
BryanFauble Jul 22, 2024
db0fb39
Allow self
BryanFauble Jul 22, 2024
6d51e35
Allow traffic from the EKS control plane
BryanFauble Jul 22, 2024
de781ff
Test allow egress to the control plane
BryanFauble Jul 22, 2024
c603640
Update to remove some testing
BryanFauble Jul 22, 2024
80e6308
Allow pod to node port 53 for DNS
BryanFauble Jul 22, 2024
a11ac32
Pass along and use the pod->node SG
BryanFauble Jul 22, 2024
14cda29
Increment EKS module used
BryanFauble Jul 22, 2024
6fbb444
Set type for node SG
BryanFauble Jul 22, 2024
092901b
Increment EKS module being used
BryanFauble Jul 22, 2024
ead32c0
Use private subnet cidrs in DNS rule
BryanFauble Jul 22, 2024
8ad2b53
increment eks module
BryanFauble Jul 22, 2024
ad16193
Correct var name
BryanFauble Jul 22, 2024
c9e6435
Correct definition
BryanFauble Jul 22, 2024
5e48a57
Update module
BryanFauble Jul 22, 2024
fa1d9f2
no array value
BryanFauble Jul 22, 2024
99a4e37
increment
BryanFauble Jul 22, 2024
dbb6403
Add ELB SG to pod
BryanFauble Jul 23, 2024
af78ec5
Allow inbound kubelet port from nodes
BryanFauble Jul 23, 2024
9d40ef8
Test allowing traffic from ELB
BryanFauble Jul 23, 2024
d15aa67
Try allowing all ports
BryanFauble Jul 23, 2024
40309d2
Swap over to standard enforcement
BryanFauble Jul 23, 2024
d70351c
default deny stars and client ns
BryanFauble Jul 23, 2024
bbf9574
Add more allowed connections
BryanFauble Jul 23, 2024
f3d4875
New policies
BryanFauble Jul 23, 2024
1c7cfdd
Capture CW
BryanFauble Jul 23, 2024
2f5947b
Increment module
BryanFauble Jul 23, 2024
3ce93d5
Allow cw logs to be created
BryanFauble Jul 23, 2024
106f75a
increment autoscaler
BryanFauble Jul 23, 2024
e8f82b5
Allow kube system traffic
BryanFauble Jul 23, 2024
e2301d2
correct port
BryanFauble Jul 23, 2024
d573cf7
Add egress policies as well
BryanFauble Jul 23, 2024
c5294f2
Set egress policy for client
BryanFauble Jul 23, 2024
9707f0b
Set NS and pod selector
BryanFauble Jul 23, 2024
11b5848
correct selector
BryanFauble Jul 23, 2024
045e143
Correct NS selectors
BryanFauble Jul 23, 2024
a307ea9
Adding docs and pushing changes to stand alone modules
BryanFauble Jul 23, 2024
63c5804
Point to main branch
BryanFauble Jul 23, 2024
89f7e84
Merge branch 'main' into ibcdpe-935-vpc-updates
BryanFauble Jul 25, 2024
e147349
Default to standard
BryanFauble Jul 25, 2024
07d593a
Add VPC diagram
BryanFauble Jul 25, 2024
525627e
Create VM and point to branch
BryanFauble Jul 26, 2024
62bb601
Delete bad copy
BryanFauble Jul 26, 2024
c8e3906
Remove notes
BryanFauble Jul 26, 2024
4bc4065
Set keepers on version
BryanFauble Jul 26, 2024
b808676
a
BryanFauble Jul 26, 2024
706894a
Deploy VM
BryanFauble Jul 26, 2024
4539387
Correct ID that changed for some reason
BryanFauble Jul 26, 2024
75705d6
Comment out other helm repo
BryanFauble Jul 26, 2024
e30b6cd
Increment
BryanFauble Jul 26, 2024
6c0ccaa
Correct cluster name
BryanFauble Jul 26, 2024
6baea65
Correct ver
BryanFauble Jul 26, 2024
cf9d591
Increment
BryanFauble Jul 26, 2024
b0bab3e
Allow desired capacity to be set
BryanFauble Jul 26, 2024
f34dca6
Bump capacity for testing
BryanFauble Jul 26, 2024
3fdc694
Create otel-collector
BryanFauble Jul 26, 2024
1e29e36
Deploy otel collector
BryanFauble Jul 26, 2024
2989cfe
Correct values interpolation
BryanFauble Jul 26, 2024
18c9a50
Increment
BryanFauble Jul 26, 2024
971cb39
Update values
BryanFauble Jul 26, 2024
a6ef47c
Deploy updated otel collector
BryanFauble Jul 26, 2024
588d36e
Create cert-manager deployment
BryanFauble Jul 26, 2024
96c3c70
Create trivy-operator
BryanFauble Jul 29, 2024
93d03ac
Enabled trivy service scrape
BryanFauble Jul 29, 2024
e29e990
Create a service scrape for the trivy operator
BryanFauble Jul 29, 2024
3e2f867
Create vulnarability dashboard in VM
BryanFauble Jul 29, 2024
7b62255
Remove stack dependency
BryanFauble Jul 29, 2024
cde5502
Exclude amazon specific images
BryanFauble Jul 29, 2024
e13cd42
Increment
BryanFauble Jul 29, 2024
c889cba
Remove var
BryanFauble Jul 29, 2024
d0027bb
Add policy reporter to view scan results
BryanFauble Jul 29, 2024
49718cd
Increment operator
BryanFauble Jul 29, 2024
9644ea2
Update trivy
BryanFauble Jul 29, 2024
ec7dbc8
Increment
BryanFauble Jul 29, 2024
0daffec
Correct mistake
BryanFauble Jul 29, 2024
ca41933
Increment operator
BryanFauble Jul 29, 2024
220739a
Remove CISKubeBenchReport
BryanFauble Jul 29, 2024
0c05c79
Increment
BryanFauble Jul 29, 2024
ed3a8e8
Add to readme
BryanFauble Jul 29, 2024
18beeaa
Remove not yet implemented modules
BryanFauble Jul 29, 2024
eae8e08
Set default resources
BryanFauble Jul 29, 2024
71cd4f5
Increment
BryanFauble Jul 29, 2024
879fb4f
Bump defaults
BryanFauble Jul 29, 2024
3ef7bd7
Bump up version
BryanFauble Jul 29, 2024
ba6caf6
Turn of alert and bump up scrap interval
BryanFauble Jul 30, 2024
6fbc513
Increment
BryanFauble Jul 30, 2024
7dc8b31
Adjust interval back
BryanFauble Jul 30, 2024
0121a37
Increment
BryanFauble Jul 30, 2024
4183734
flips accessGlobalSecretsAndServiceAccount to false for values-trivy …
BWMac Jul 31, 2024
f683b13
increments trivy-operator version
BWMac Jul 31, 2024
d037fba
increments trivy-operator version for deployment
BWMac Jul 31, 2024
97cdff2
Adding apache airflow module
BryanFauble Jul 31, 2024
89b641f
Deploy airflow
BryanFauble Jul 31, 2024
59ea85e
Leave airflow turned off
BryanFauble Jul 31, 2024
b931e5f
Deploy ariflow
BryanFauble Jul 31, 2024
b2c577c
Update eks module
BryanFauble Jul 31, 2024
e776195
Correct var reference
BryanFauble Jul 31, 2024
0bd5037
Correction
BryanFauble Jul 31, 2024
fdeb6f6
Increment eks module
BryanFauble Jul 31, 2024
a154a5f
Increment vpc version
BryanFauble Jul 31, 2024
862838a
Update the autoscaler to use nitro based instances
BryanFauble Jul 31, 2024
51c5318
Increment autoscaler
BryanFauble Jul 31, 2024
1949755
Update where filter is defined
BryanFauble Jul 31, 2024
7e20928
Increment autoscaler
BryanFauble Jul 31, 2024
3ad49d5
Set required properties
BryanFauble Jul 31, 2024
a55a11d
Increment
BryanFauble Jul 31, 2024
abbe412
Remove files that are not needed
BryanFauble Jul 31, 2024
122419c
Merge branch 'main' into ibcdpe-1007-monitoring
BryanFauble Aug 15, 2024
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,4 @@ This document describes the abbreviated process below:
}
```
- Add a new `spacelift_aws_integration` resources to the `common-resources/aws-integrations` directory.

1 change: 1 addition & 0 deletions dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ resource "spacelift_space" "development" {
module "dpe-sandbox-spacelift" {
source = "./spacelift/dpe-sandbox"
parent_space_id = spacelift_space.development.id
admin_stack_id = var.admin_stack_id
}
14 changes: 12 additions & 2 deletions dev/spacelift/dpe-sandbox/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ resource "spacelift_stack" "k8s-stack-deployments" {
space_id = spacelift_space.dpe-sandbox.id
}

# resource "spacelift_stack_dependency" "dependency-on-admin-stack" {
# for_each = {
# k8s-stack = spacelift_stack.k8s-stack,
# k8s-stack-deployments = spacelift_stack.k8s-stack-deployments
# }

# stack_id = each.value.id
# depends_on_stack_id = var.admin_stack_id
# }

resource "spacelift_context_attachment" "k8s-kubeconfig-hooks" {
context_id = "kubernetes-deployments-kubeconfig"
stack_id = spacelift_stack.k8s-stack-deployments.id
Expand Down Expand Up @@ -118,15 +128,15 @@ resource "spacelift_stack_destructor" "k8s-stack-destructor" {

resource "spacelift_aws_integration_attachment" "k8s-aws-integration-attachment" {
# org-sagebase-dnt-dev-aws-integration
integration_id = "01J3DNYVM4AWWSDY3QEVRMQ076"
integration_id = "01J3R9GX6DC09QV7NV872DDYR3"
BryanFauble marked this conversation as resolved.
Show resolved Hide resolved
stack_id = spacelift_stack.k8s-stack.id
read = true
write = true
}

resource "spacelift_aws_integration_attachment" "k8s-deployments-aws-integration-attachment" {
# org-sagebase-dnt-dev-aws-integration
integration_id = "01J3DNYVM4AWWSDY3QEVRMQ076"
integration_id = "01J3R9GX6DC09QV7NV872DDYR3"
stack_id = spacelift_stack.k8s-stack-deployments.id
read = true
write = true
Expand Down
5 changes: 5 additions & 0 deletions dev/spacelift/dpe-sandbox/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ variable "tags" {
"CostCenter" = "No Program / 000000"
}
}

variable "admin_stack_id" {
description = "ID of the admin stack"
type = string
}
20 changes: 19 additions & 1 deletion dev/stacks/dpe-sandbox-k8s-deployments/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
module "sage-aws-eks-autoscaler" {
source = "spacelift.io/sagebionetworks/sage-aws-eks-autoscaler/aws"
version = "0.3.2"
version = "0.4.2"

cluster_name = var.cluster_name
cluster_name = var.cluster_name
private_vpc_subnet_ids = var.private_subnet_ids
vpc_id = var.vpc_id
node_security_group_id = var.node_security_group_id
spotinst_account = var.spotinst_account
# desired_capacity = 2
}

module "victoria-metrics" {
source = "spacelift.io/sagebionetworks/victoria-metrics/aws"
version = "0.0.7"
}

module "trivy-operator" {
source = "spacelift.io/sagebionetworks/trivy-operator/aws"
version = "0.0.12"
}

module "airflow" {
BryanFauble marked this conversation as resolved.
Show resolved Hide resolved
source = "spacelift.io/sagebionetworks/airflow/aws"
version = "0.0.1"
cluster_name = var.cluster_name
}
14 changes: 12 additions & 2 deletions dev/stacks/dpe-sandbox-k8s/main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module "sage-aws-vpc" {
source = "spacelift.io/sagebionetworks/sage-aws-vpc/aws"
version = "0.3.3"
version = "0.3.4"
vpc_name = "dpe-sandbox"
capture_flow_logs = true
flow_log_retention = 1
}

module "sage-aws-eks" {
source = "spacelift.io/sagebionetworks/sage-aws-eks/aws"
version = "0.3.9"
version = "0.4.0"

cluster_name = "dpe-k8-sandbox"
private_vpc_subnet_ids = module.sage-aws-vpc.private_subnet_ids
Expand All @@ -20,4 +20,14 @@ module "sage-aws-eks" {
pod_security_group_enforcing_mode = "standard"
aws_account_id = "631692904429"
private_subnet_cidrs = module.sage-aws-vpc.vpc_private_subnet_cidrs
cluster_name = "dpe-k8-sandbox"
private_vpc_subnet_ids = module.sage-aws-vpc.private_subnet_ids
vpc_id = module.sage-aws-vpc.vpc_id
vpc_security_group_id = module.sage-aws-vpc.vpc_security_group_id
enable_policy_event_logs = true
capture_cloudwatch_logs = true
cloudwatch_retention = 1
pod_security_group_enforcing_mode = "standard"
aws_account_id = "631692904429"
private_subnet_cidrs = module.sage-aws-vpc.vpc_private_subnet_cidrs
}
5 changes: 5 additions & 0 deletions dev/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ variable "parent_space_id" {
description = "ID of the parent spacelift space"
type = string
}

variable "admin_stack_id" {
description = "ID of the admin stack"
type = string
}
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resource "spacelift_stack" "root_administrative_stack" {

administrative = true
autodeploy = true
branch = "main"
branch = "ibcdpe-1007-monitoring"
description = "Manages other spacelift resources"
name = "Root Spacelift Administrative Stack"
project_root = ""
Expand Down Expand Up @@ -56,4 +56,5 @@ module "dev-resources" {
module.terraform-registry,
]
parent_space_id = spacelift_space.environment.id
admin_stack_id = spacelift_stack.root_administrative_stack.id
}
7 changes: 0 additions & 7 deletions modules/apache-airflow/data.tf

This file was deleted.

18 changes: 0 additions & 18 deletions modules/apache-airflow/variables.tf

This file was deleted.

55 changes: 0 additions & 55 deletions modules/internal-k8-infra/data.tf

This file was deleted.

128 changes: 0 additions & 128 deletions modules/internal-k8-infra/main.tf

This file was deleted.

21 changes: 0 additions & 21 deletions modules/internal-k8-infra/provider.tf

This file was deleted.

20 changes: 0 additions & 20 deletions modules/internal-k8-infra/templates/airflow-values.yaml

This file was deleted.

Loading