Skip to content

Commit

Permalink
CICD Integration test: iam client fix (data-dot-all#1604)
Browse files Browse the repository at this point in the history
### Feature or Bugfix
<!-- please choose -->
- Bugfix

### Detail
- iam client tries to get_role and creates one if it's none.

### Relates
- <URL or Ticket>

### Security
Please answer the questions below briefly where applicable, or write
`N/A`. Based on
[OWASP 10](https://owasp.org/Top10/en/).

- Does this PR introduce or modify any input fields or queries - this
includes
fetching data from storage outside the application (e.g. a database, an
S3 bucket)?
  - Is the input sanitized?
- What precautions are you taking before deserializing the data you
consume?
  - Is injection prevented by parametrizing queries?
  - Have you ensured no `eval` or similar functions are used?
- Does this PR introduce any functionality or component that requires
authorization?
- How have you ensured it respects the existing AuthN/AuthZ mechanisms?
  - Are you logging failed auth attempts?
- Are you using or adding any cryptographic features?
  - Do you use a standard proven implementations?
  - Are the used keys controlled by the customer? Where are they stored?
- Are you introducing any new policies/roles/users?
  - Have you used the least-privilege principle? How?


By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Co-authored-by: Sofia Sazonova <[email protected]>
  • Loading branch information
SofiaSazonova and Sofia Sazonova authored Oct 2, 2024
1 parent 4fd6caa commit c5f3f9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests_new/integration_tests/aws_clients/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ def __init__(self, session=boto3.Session(), region=os.environ.get('AWS_REGION',
self._region = region

def get_role(self, role_name):
role = self._client.get_role(RoleName=role_name)
return role
try:
role = self._client.get_role(RoleName=role_name)
return role
except self._client.exceptions.NoSuchEntityException as e:
log.info(f'Error occurred: {e}')
return None

def delete_role(self, role_name):
self._client.delete_role(RoleName=role_name)
Expand Down

0 comments on commit c5f3f9e

Please sign in to comment.