Secrets Configuration
Quick reference for setting up GitHub secrets after creating repositories.
๐ SOC Certification Note: If pursuing SOC 1/2/3 certification, Infracost and FOSSA are required (both are SOC 2 Type II certified). See SOC Compliance for details.
๐ Correct Setup Workflow
โ Create empty repositories on GitHub (no initialization)
โ Configure ALL secrets using this checklist (you are here!)
โ Push code - workflows will now succeed
โ DON'T push before secrets - workflows will fail and spam your inbox
๐ฏ Setup Order
Follow this sequence to avoid dependency issues:
First: Set up AWS credentials and Terraform backend secrets
Second: Deploy infrastructure using Terraform workflows
Third: Get kubeconfig and set up Kubernetes secrets
Fourth: Deploy Helm charts to verify everything works
Last: Set up optional services (Slack, Infracost, etc.)
๐ Where to Add Secrets
Repository Level Secrets:
GitHub Repository โ Settings โ Secrets and variables โ Actions
Organization Level Secrets (Recommended):
GitHub Organization โ Settings โ Secrets and variables โ Actions
Repository Variables:
GitHub Repository โ Settings โ Secrets and variables โ Actions โ Variables tab
๐ก Best Practice: Use organization-level secrets for shared services (Slack, FOSSA) and repository-level secrets for specific infrastructure (AWS roles, Kubernetes).
๐ How to Get Each Secret
๐ AWS Authentication
Option 1: OIDC (Recommended - No long-lived keys)
Create OIDC Provider (run once per AWS account):
aws iam create-open-id-connect-provider \ --url https://token.actions.githubusercontent.com \ --client-id-list sts.amazonaws.com \ --thumbprint-list 6938fd4d98bab03faadb97b34396831e3780aea1
Create IAM Role with this trust policy:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::YOUR_ACCOUNT:oidc-provider/token.actions.githubusercontent.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "token.actions.githubusercontent.com:sub": "repo:capsign/infrastructure:ref:refs/heads/main", "token.actions.githubusercontent.com:aud": "sts.amazonaws.com" } } } ] }
Add these Repository Secrets:
AWS_ROLE_ARN
:arn:aws:iam::YOUR_ACCOUNT:role/GitHubActionsRole
AWS_REGION
:us-west-2
(or your preferred region)
Option 2: Access Keys (Less secure)
Create IAM User with programmatic access
Add these Repository Secrets:
AWS_ACCESS_KEY_ID
: From IAM userAWS_SECRET_ACCESS_KEY
: From IAM userAWS_REGION
:us-west-2
(or your preferred region)
๐๏ธ Terraform Backend
Create S3 bucket and DynamoDB table, then add Repository Secrets:
TF_VAR_terraform_state_bucket
: Your S3 bucket name (e.g.,capsign-terraform-state
)TF_VAR_terraform_state_dynamodb_table
: Your DynamoDB table name (e.g.,capsign-terraform-locks
)TF_VAR_environment
:production
orstaging
โธ๏ธ Kubernetes Access
After EKS cluster is deployed:
Update local kubeconfig:
aws eks update-kubeconfig --region us-west-2 --name capsign-cluster
Encode kubeconfig:
cat ~/.kube/config | base64 | tr -d '\n'
Add Repository Secret:
KUBECONFIG_DATA
: The base64 encoded output from above
๐ฌ Slack Integration
Go to Slack Apps โ Create New App
Enable Incoming Webhooks โ Add New Webhook to Workspace
Copy webhook URL and add as Organization Secrets:
SLACK_WEBHOOK_URL
: General notificationsSLACK_SECURITY_WEBHOOK
: Security alerts (#alerts-security)SLACK_RELEASES_WEBHOOK
: Release notifications (#alerts-releases)
๐ฐ Infracost (Optional - Cost Estimation)
Sign up at infracost.io
Get API key from dashboard
Add Organization Secrets:
INFRACOST_API_KEY
: Your API keyAdd Organization Variable:
INFRACOST_ENABLED
:true
Free Tier: 1,000 runs/month
๐ FOSSA (Optional - License Compliance)
Sign up at fossa.com
Get API key from settings
Add Organization Secrets:
FOSSA_API_KEY
: Your API keyAdd Organization Variable:
FOSSA_ENABLED
:true
Free Tier: 5 projects
๐ GitHub Release Token
GitHub Settings โ Developer settings โ Personal access tokens โ Fine-grained tokens
Create token with Repository permissions:
Contents: Write
,Metadata: Read
Add Organization Secret:
RELEASE_TOKEN
: Your personal access token
๐ Required Secrets by Repository
๐๏ธ Infrastructure Repository (capsign/infrastructure
)
capsign/infrastructure
)AWS Authentication (Choose One):
Terraform Backend:
Optional Services (see Optional Services):
๐ข Helm Charts Repository (capsign/helm-charts
)
capsign/helm-charts
)Kubernetes Access:
Optional Services:
๐ Organization Level (All Repositories)
Team Coordination:
Optional Compliance Services (see Optional Services):
โก Quick Setup Commands
1. Create AWS OIDC Provider
aws iam create-open-id-connect-provider \
--url https://token.actions.githubusercontent.com \
--client-id-list sts.amazonaws.com \
--thumbprint-list 6938fd4d98bab03faadb97b34396831e3780aea1
2. Get Base64 Kubeconfig
# After EKS cluster is created
aws eks update-kubeconfig --region us-west-2 --name capsign-cluster
cat ~/.kube/config | base64 | tr -d '\n'
3. Test Secrets
# Test AWS
aws sts get-caller-identity
# Test Kubernetes
kubectl get nodes
# Test Slack webhook
curl -X POST -H 'Content-type: application/json' \
--data '{"text":"CapSign test"}' \
$SLACK_WEBHOOK_URL
โ
Ready to Push Code?
Once all secrets are configured:
Return to repository setup guide
Continue with Step 3 (Push Infrastructure Repository)
Your CI/CD workflows will now succeed! ๐
Double-check: All required secrets for your repositories are set up before pushing code.
๐ก Tip: Use organization-level secrets for shared services (Slack, FOSSA) and repository-level secrets for specific infrastructure (AWS, Kubernetes).
๐จ Important: Test each secret after adding to ensure CI/CD workflows work correctly!
Quick reference for setting up GitHub secrets after creating repositories.
๐ SOC Certification Note: If pursuing SOC 1/2/3 certification, Infracost and FOSSA are required (both are SOC 2 Type II certified). See SOC Compliance for details.
๐ Correct Setup Workflow
โ Create empty repositories on GitHub (no initialization)
โ Configure ALL secrets using this checklist (you are here!)
โ Push code - workflows will now succeed
โ DON'T push before secrets - workflows will fail and spam your inbox
๐ฏ Setup Order
Follow this sequence to avoid dependency issues:
First: Set up AWS credentials and Terraform backend secrets
Second: Deploy infrastructure using Terraform workflows
Third: Get kubeconfig and set up Kubernetes secrets
Fourth: Deploy Helm charts to verify everything works
Last: Set up optional services (Slack, Infracost, etc.)
๐ Where to Add Secrets
Repository Level Secrets:
GitHub Repository โ Settings โ Secrets and variables โ Actions
Organization Level Secrets (Recommended):
GitHub Organization โ Settings โ Secrets and variables โ Actions
Repository Variables:
GitHub Repository โ Settings โ Secrets and variables โ Actions โ Variables tab
๐ก Best Practice: Use organization-level secrets for shared services (Slack, FOSSA) and repository-level secrets for specific infrastructure (AWS roles, Kubernetes).
๐ How to Get Each Secret
๐ AWS Authentication
Option 1: OIDC (Recommended - No long-lived keys)
Create OIDC Provider (run once per AWS account):
aws iam create-open-id-connect-provider \ --url https://token.actions.githubusercontent.com \ --client-id-list sts.amazonaws.com \ --thumbprint-list 6938fd4d98bab03faadb97b34396831e3780aea1
Create IAM Role with this trust policy:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::YOUR_ACCOUNT:oidc-provider/token.actions.githubusercontent.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "token.actions.githubusercontent.com:sub": "repo:capsign/infrastructure:ref:refs/heads/main", "token.actions.githubusercontent.com:aud": "sts.amazonaws.com" } } } ] }
Add these Repository Secrets:
AWS_ROLE_ARN
:arn:aws:iam::YOUR_ACCOUNT:role/GitHubActionsRole
AWS_REGION
:us-west-2
(or your preferred region)
Option 2: Access Keys (Less secure)
Create IAM User with programmatic access
Add these Repository Secrets:
AWS_ACCESS_KEY_ID
: From IAM userAWS_SECRET_ACCESS_KEY
: From IAM userAWS_REGION
:us-west-2
(or your preferred region)
๐๏ธ Terraform Backend
Create S3 bucket and DynamoDB table, then add Repository Secrets:
TF_VAR_terraform_state_bucket
: Your S3 bucket name (e.g.,capsign-terraform-state
)TF_VAR_terraform_state_dynamodb_table
: Your DynamoDB table name (e.g.,capsign-terraform-locks
)TF_VAR_environment
:production
orstaging
โธ๏ธ Kubernetes Access
After EKS cluster is deployed:
Update local kubeconfig:
aws eks update-kubeconfig --region us-west-2 --name capsign-cluster
Encode kubeconfig:
cat ~/.kube/config | base64 | tr -d '\n'
Add Repository Secret:
KUBECONFIG_DATA
: The base64 encoded output from above
๐ฌ Slack Integration
Go to Slack Apps โ Create New App
Enable Incoming Webhooks โ Add New Webhook to Workspace
Copy webhook URL and add as Organization Secrets:
SLACK_WEBHOOK_URL
: General notificationsSLACK_SECURITY_WEBHOOK
: Security alerts (#alerts-security)SLACK_RELEASES_WEBHOOK
: Release notifications (#alerts-releases)
๐ฐ Infracost (Optional - Cost Estimation)
Sign up at infracost.io
Get API key from dashboard
Add Organization Secrets:
INFRACOST_API_KEY
: Your API keyAdd Organization Variable:
INFRACOST_ENABLED
:true
Free Tier: 1,000 runs/month
๐ FOSSA (Optional - License Compliance)
Sign up at fossa.com
Get API key from settings
Add Organization Secrets:
FOSSA_API_KEY
: Your API keyAdd Organization Variable:
FOSSA_ENABLED
:true
Free Tier: 5 projects
๐ GitHub Release Token
GitHub Settings โ Developer settings โ Personal access tokens โ Fine-grained tokens
Create token with Repository permissions:
Contents: Write
,Metadata: Read
Add Organization Secret:
RELEASE_TOKEN
: Your personal access token
๐ Required Secrets by Repository
๐๏ธ Infrastructure Repository (capsign/infrastructure
)
capsign/infrastructure
)AWS Authentication (Choose One):
Terraform Backend:
Optional Services (see Optional Services):
๐ข Helm Charts Repository (capsign/helm-charts
)
capsign/helm-charts
)Kubernetes Access:
Optional Services:
๐ Organization Level (All Repositories)
Team Coordination:
Optional Compliance Services (see Optional Services):
โก Quick Setup Commands
1. Create AWS OIDC Provider
aws iam create-open-id-connect-provider \
--url https://token.actions.githubusercontent.com \
--client-id-list sts.amazonaws.com \
--thumbprint-list 6938fd4d98bab03faadb97b34396831e3780aea1
2. Get Base64 Kubeconfig
# After EKS cluster is created
aws eks update-kubeconfig --region us-west-2 --name capsign-cluster
cat ~/.kube/config | base64 | tr -d '\n'
3. Test Secrets
# Test AWS
aws sts get-caller-identity
# Test Kubernetes
kubectl get nodes
# Test Slack webhook
curl -X POST -H 'Content-type: application/json' \
--data '{"text":"CapSign test"}' \
$SLACK_WEBHOOK_URL
โ
Ready to Push Code?
Once all secrets are configured:
Return to repository setup guide
Continue with Step 3 (Push Infrastructure Repository)
Your CI/CD workflows will now succeed! ๐
Double-check: All required secrets for your repositories are set up before pushing code.
๐ก Tip: Use organization-level secrets for shared services (Slack, FOSSA) and repository-level secrets for specific infrastructure (AWS, Kubernetes).
๐จ Important: Test each secret after adding to ensure CI/CD workflows work correctly!
Last updated
Was this helpful?