Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
Refactor AWS environment configuration variables
Browse files Browse the repository at this point in the history
  • Loading branch information
austinsonger committed Sep 26, 2024
1 parent e290b1a commit 199c78d
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 40 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/prep/setup-aws-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ jobs:
- name: Configure Corporate AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.DEVOPS_CORP_AUTOMATION_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEVOPS_CORP_AUTOMATION_AWS_SECRET_ACCESS_KEY }}
aws-access-key-id: ${{ secrets.DEVOPS_CORP_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEVOPS_CORP_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ inputs.corp-aws-region }}

- name: Configure Federal AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.DEVOPS_DOOP_AUTOMATION_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEVOPS_DOOP_AUTOMATION_AWS_SECRET_ACCESS_KEY }}
aws-access-key-id: ${{ secrets.DEVOPS_FEDERAL_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEVOPS_FEDERAL_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ inputs.federal-aws-region }}

- name: Checkout repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
# Setup environments dictionary with AWS credentials and output file paths
environments = {
'private-sector': {
'access_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_CORP_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'private_sector_output_file': f"/evidence-artifacts/{current_year}/private-sector/replay_resistant_auth.json"
},
'federal': {
'access_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_FEDERAL_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_FEDERAL_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'federal_output_file': f"/evidence-artifacts/{current_year}/federal/replay_resistant_auth.json"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

environments = {
'private-sector': {
'access_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_CORP_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'private_sector_output_file': f"/evidence-artifacts/{current_year}/private-sector/sso_enforcement_for_application_accounts.json"
},
'federal': {
'access_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_FEDERAL_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_FEDERAL_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'federal_output_file': f"/evidence-artifacts/{current_year}/federal/sso_enforcement_for_application_accounts.json"
}
Expand Down
8 changes: 4 additions & 4 deletions services/tools/aws/Access Control/users_active_access_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

environments = {
'private-sector': {
'access_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_CORP_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'private_sector_output_file': f"/evidence-artifacts/{current_year}/private-sector/users_active_access_keys.json"
},
'federal': {
'access_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_FEDERAL_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_FEDERAL_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'federal_output_file': f"/evidence-artifacts/{current_year}/federal/users_active_access_keys.json"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

environments = {
'private-sector': {
'access_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_CORP_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'private_sector_output_file': f"/evidence-artifacts/{current_year}/private-sector/users_configured_with_sso.json"
},
'federal': {
'access_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_FEDERAL_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_FEDERAL_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'federal_output_file': f"/evidence-artifacts/{current_year}/federal/users_configured_with_sso.json"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
# Environment setup
environments = {
'private-sector': {
'access_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_CORP_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'private_sector_output_file': f"/evidence-artifacts/{current_year}/private-sector/data_encryption_check.json"
},
'federal': {
'access_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_FEDERAL_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_FEDERAL_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'federal_output_file': f"/evidence-artifacts/{current_year}/federal/data_encryption_check.json"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

environments = {
'private-sector': {
'access_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_CORP_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'private_sector_output_file': f"/evidence-artifacts/{current_year}/private-sector/"
},
'federal': {
'access_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_FEDERAL_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_FEDERAL_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'federal_output_file': f"/evidence-artifacts/{current_year}/federal/"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
# Dictionary holding environments configuration
environments = {
'private-sector': {
'access_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_CORP_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_CORP_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'private_sector_output_file': f"/evidence-artifacts/{current_year}/private-sector/"
},
'federal': {
'access_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
'access_key': os.getenv('DEVOPS_FEDERAL_AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('DEVOPS_FEDERAL_AWS_SECRET_ACCESS_KEY'),
'region': 'us-east-1',
'federal_output_file': f"/evidence-artifacts/{current_year}/federal/"
}
Expand Down
8 changes: 4 additions & 4 deletions services/tools/aws/_config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ The module defines configurations for two environments:
#### Environment Details

- **private-sector**
- Access Key: Retrieved from `DEVOPS_CORP_AUTOMATION_AWS_ACCESS_KEY_ID` environment variable.
- Secret Key: Retrieved from `DEVOPS_CORP_AUTOMATION_AWS_SECRET_ACCESS_KEY` environment variable.
- Access Key: Retrieved from `DEVOPS_CORP_AWS_ACCESS_KEY_ID` environment variable.
- Secret Key: Retrieved from `DEVOPS_CORP_AWS_SECRET_ACCESS_KEY` environment variable.
- Region: `us-east-1`
- **federal**
- Access Key: Retrieved from `DEVOPS_DOOP_AUTOMATION_AWS_ACCESS_KEY_ID` environment variable.
- Secret Key: Retrieved from `DEVOPS_DOOP_AUTOMATION_AWS_SECRET_ACCESS_KEY` environment variable.
- Access Key: Retrieved from `DEVOPS_FEDERAL_AWS_ACCESS_KEY_ID` environment variable.
- Secret Key: Retrieved from `DEVOPS_FEDERAL_AWS_SECRET_ACCESS_KEY` environment variable.
- Region: `us-east-1`


8 changes: 4 additions & 4 deletions services/tools/aws/_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ def set_aws_credentials(self):

environments = {
'private-sector': EnvironmentConfig(
access_key=os.getenv('DEVOPS_CORP_AUTOMATION_AWS_ACCESS_KEY_ID'),
secret_key=os.getenv('DEVOPS_CORP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
access_key=os.getenv('DEVOPS_CORP_AWS_ACCESS_KEY_ID'),
secret_key=os.getenv('DEVOPS_CORP_AWS_SECRET_ACCESS_KEY'),
region='us-east-1'
),
'federal': EnvironmentConfig(
access_key=os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_ACCESS_KEY_ID'),
secret_key=os.getenv('DEVOPS_DOOP_AUTOMATION_AWS_SECRET_ACCESS_KEY'),
access_key=os.getenv('DEVOPS_FEDERAL_AWS_ACCESS_KEY_ID'),
secret_key=os.getenv('DEVOPS_FEDERAL_AWS_SECRET_ACCESS_KEY'),
region='us-east-1'
)
}

0 comments on commit 199c78d

Please sign in to comment.