-
Notifications
You must be signed in to change notification settings - Fork 324
AWS S3 Authentication and Fuzzing for Ceph RGW #962
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
base: main
Are you sure you want to change the base?
Conversation
|
|
@marina-p could please have another look at the PR? |
| auth_module = Settings().authentication['module'] | ||
| signing_function = auth_module.get('function', 'sign_request') | ||
| signing_module = __import__(auth_module['name'], fromlist=[signing_function]) | ||
| sign_request = getattr(signing_module, signing_function) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please use the helper import_attr in import_utilities.py?
restler/utils/aws_sigv4_auth.py
Outdated
| import boto3 | ||
| from botocore.auth import SigV4Auth | ||
| from botocore.awsrequest import AWSRequest | ||
| from botocore.credentials import Credentials |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module needs to be part of your own team's deployment - RESTler does not maintain authentication for specific services in the code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this could be added under an "examples" directory, to give users an idea of how to configure a signer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally such samples would be working samples with their own set of dependencies that could be installed, tested etc. Since we don't have such samples today, could you please open an issue and attach this there to track adding such examples, but keep it separate from this PR so as not to block the PR?
marina-p
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
|
|
||
| # Add request signing if enabled in authentication settings | ||
| if Settings().authentication and Settings().authentication.get('module', {}).get('signing'): | ||
| try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be catching this at PR time - could you please make this consistent with the other authentication dictionary structure, so "authentication": { "signing": {"module": {"file"/"function"/...}}}. See SettingsFile.md for the structure.
| message = _append_to_header(message, f"x-restler-sequence-id: {sequence_id}") | ||
|
|
||
| # Add request signing if enabled in authentication settings | ||
| if Settings().authentication and Settings().authentication.get('module', {}).get('signing'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Ideally, some tests should be added for this using the unit test server. This can be done in a future PR if you've already validated these changes - could you please open an issue to track this? In reply to: 3395031310 |
this configuration and signing mechanism is tested against our server. if we want to add a dedicated test to restler we probably dont want to test against a full S3 gateway.
|
|
hey @marina-p, can you review the PR once again. Thanks! |
|
Done - just one remaining comment RE: restler/utls, everything else looks good! In reply to: 3408292266 |
…iguration structure - Import and use import_attr helper from utils.import_utilities for cleaner module loading - Update AWS SigV4 authentication module comments to reflect new config structure - Document request signing authentication in Authentication.md and SettingsFile.md
|
@Suyashd999 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Hi @marina-p! I have made that change as well. Please do check once ! Thankyou !! |
Summary
This pull request adds support for AWS Signature Version 4 (SigV4) authentication in RESTler, enabling fuzzing of AWS S3-compatible endpoints that require AWS request signing.
Details
aws_sigv4_auth.py(originally located inrestler/utils) to demonstrate how RESTler can sign requests using AWS S3 credentials (AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY), leveragingboto3andbotocore.restler/utilsto avoid including service-specific logic in the RESTler core codebase.Usage
aws_sigv4_auth.pyexample in Issue #987.pip install boto3 botocoreRelated