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

Fix job params #13

Merged
merged 7 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def parse(self, payload):
:raises: KeyError, JSONDecodeError
"""
remediation_entry = json.loads(payload)
logging.info("unparsed params")
logging.info(f" {remediation_entry}")

account_name = remediation_entry["notificationInfo"]["FindingInfo"]["ObjectId"]
region = remediation_entry["notificationInfo"]["FindingInfo"]["Region"]

object_chain = remediation_entry["notificationInfo"]["FindingInfo"]["ObjectChain"]
object_chain = remediation_entry["notificationInfo"]["FindingInfo"][
"ObjectChain"
]
object_chain_dict = json.loads(object_chain)
subscription_id = object_chain_dict["cloudAccountId"]

Expand Down Expand Up @@ -93,9 +93,7 @@ def remediate(self, client, resource_group_name, account_name):
# Allow only https traffic for the storage account
logging.info("Enabling HTTPS only traffic for storage account")
try:
logging.info(
" executing client.storage_accounts.update"
)
logging.info(" executing client.storage_accounts.update")
logging.info(f" resource_group_name={resource_group_name}")
logging.info(f" account_name={account_name}")
client.storage_accounts.update(
Expand Down Expand Up @@ -126,7 +124,7 @@ def run(self, args):

client = StorageManagementClient(credentials, params["subscription_id"])
return self.remediate(
client, params["resource_group_name"], params["account_name"], params["container_name"]
client, params["resource_group_name"], params["account_name"]
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,7 @@ def run(self, args):
compute_client = ComputeManagementClient(credentials, params["subscription_id"])
nw_client = NetworkManagementClient(credentials, params["subscription_id"])
return self.remediate(
compute_client,
nw_client,
params["resource_group_name"],
params["security_group_name"],
compute_client, nw_client, params["resource_group_name"], params["vm_name"],
)


Expand Down