Skip to content

Commit

Permalink
first full resource pass for aws
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Sep 20, 2024
1 parent a651dfd commit 7865150
Show file tree
Hide file tree
Showing 548 changed files with 13,871 additions and 6,442 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@5c02493ebfd65b28fd3b082c65e5af2cd745d91f # codeql-bundle-v2.18.2
uses: github/codeql-action/init@5618c9fc1e675841ca52c1c6b1304f5255a905a0 # codeql-bundle-v2.19.0
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -57,7 +57,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@5c02493ebfd65b28fd3b082c65e5af2cd745d91f # codeql-bundle-v2.18.2
uses: github/codeql-action/autobuild@5618c9fc1e675841ca52c1c6b1304f5255a905a0 # codeql-bundle-v2.19.0

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -70,4 +70,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@5c02493ebfd65b28fd3b082c65e5af2cd745d91f # codeql-bundle-v2.18.2
uses: github/codeql-action/analyze@5618c9fc1e675841ca52c1c6b1304f5255a905a0 # codeql-bundle-v2.19.0
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
platform: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
- uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # v3.1.1
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
terraform_version: 1.5.4
- name: Checkout code
Expand Down
262 changes: 226 additions & 36 deletions src/aws.go

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/aws_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,13 @@ func AwsDataLookup(find string) interface{} { //nolint:maintidx
"aws_ecr_repository_creation_template": dataAwsEcrRepositoryCreationTemplate,
"aws_rds_cluster_parameter_group": dataAwsRdsClusterParameterGroup,
"aws_secretsmanager_secret_versions": dataAwsSecretsmanagerSecretVersions,
"aws_bedrockagent_agent_versions": dataAwsBedrockAgentVersions,
"aws_glue_registry": dataAwsGlueRegistry,
"aws_organizations_organizational_unit_descendant_organizational_units": dataAwsOrganizationsOrganizationalUnitDescendantOrganizationalUnits,
"aws_quicksight_analysis": dataAwsQuicksightAnalysis,
"aws_route53_zones": dataAwsRoute53Zones,
"aws_shield_protection": dataAwsShieldProtection,
"aws_ssoadmin_permission_sets": dataAwsSsoadminPermissionSets,
}

return TFLookup[find]
Expand Down
20 changes: 10 additions & 10 deletions src/azure_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ func AzureDataLookup(name string) interface{} {
"azurerm_source_control_token": placeholder,
"azurerm_spring_cloud_app": dataAzurermSpringCloudApp,
"azurerm_spring_cloud_service": dataAzurermSpringCloudService,
"azurerm_sql_database": dataAzurermSqlDatabase,
"azurerm_sql_managed_instance": dataAzurermSqlManagedInstance,
"azurerm_sql_server": dataAzurermSqlServer,
"azurerm_sql_database": dataAzurermSQLDatabase,
"azurerm_sql_managed_instance": dataAzurermSQLManagedInstance,
"azurerm_sql_server": dataAzurermSQLServer,
"azurerm_ssh_public_key": dataAzurermSSHPublicKey,
"azurerm_stack_hci_cluster": dataAzurermStackHCICluster,
"azurerm_storage_account": dataAzurermStorageAccount,
Expand Down Expand Up @@ -116,13 +116,13 @@ func AzureDataLookup(name string) interface{} {
"azurerm_web_pubsub_private_link_resource": placeholder,
"azurerm_windows_function_app": dataAzurermWindowsFunctionApp,
"azurerm_windows_web_app": dataAzurermWindowsWebApp,
"azurerm_api_management": dataAzurermApiManagement,
"azurerm_api_management_api": dataAzurermApiManagementApi,
"azurerm_api_management_api_version_set": dataAzurermApiManagementVersionSet,
"azurerm_api_management_gateway": dataAzurermApiManagementGateway,
"azurerm_api_management_gateway_host_name_configuration": dataAzurermApiManagementGatewayHostNameConfiguration,
"azurerm_api_management_group": dataAzurermApiManagementGroup,
"azurerm_api_management_product": dataAzurermApiManagmentProduct,
"azurerm_api_management": dataAzurermAPIManagement,
"azurerm_api_management_api": dataAzurermAPIManagementAPI,
"azurerm_api_management_api_version_set": dataAzurermAPIManagementVersionSet,
"azurerm_api_management_gateway": dataAzurermAPIManagementGateway,
"azurerm_api_management_gateway_host_name_configuration": dataAzurermAPIManagementGatewayHostNameConfiguration,
"azurerm_api_management_group": dataAzurermAPIManagementGroup,
"azurerm_api_management_product": dataAzurermAPIManagmentProduct,
"azurerm_api_management_user": dataAzurermApiManagementUser,
"azurerm_app_configuration": dataAzurermAppConfiguration,
"azurerm_app_configuration_key": dataAzurermAppConfigurationKey,
Expand Down
2 changes: 2 additions & 0 deletions src/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func TestGetAZUREPermissions(t *testing.T) {

return
}

if !reflect.DeepEqual(got, tt.want) {
t.Errorf("GetAZUREPermissions() = %v, want %v", got, tt.want)
}
Expand Down Expand Up @@ -152,6 +153,7 @@ func TestGetAZUREResourcePermissions(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
got, err := pike.GetAZUREResourcePermissions(tt.args.result)

if (err != nil) != tt.wantErr {
t.Errorf("GetAZUREResourcePermissions() error = %v, wantErr %v", err, tt.wantErr)

Expand Down
2 changes: 2 additions & 0 deletions src/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func Compare(directory string, arn string, init bool) (bool, error) {
func CompareIAMPolicy(policy string, oldPolicy string) (bool, error) {
differ := diff.New()
compare, err := differ.Compare([]byte(policy), []byte(oldPolicy))

if err != nil {
return false, err
}
Expand All @@ -69,6 +70,7 @@ func CompareIAMPolicy(policy string, oldPolicy string) (bool, error) {

myFormatter := formatter.NewAsciiFormatter(aJSON, myConfig)
diffString, err := myFormatter.Format(compare)

if err != nil {
return false, err
}
Expand Down
Loading

0 comments on commit 7865150

Please sign in to comment.