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

Move fips_enabled setting to AWS Common #28899

Merged
merged 5 commits into from
Dec 14, 2021

Conversation

legoguy1000
Copy link
Contributor

@legoguy1000 legoguy1000 commented Nov 9, 2021

What does this PR do?

Moves the fips_enabled config option from the aws-s3 input to the AWS Common module to allow for any AWS related module to be able to use FIPS endpoints. Also updated all FIPS capable services to use the above config to set the endpoint. The only service that didn't support FIPS was tagging. Also adds TLS configuration to the AWS common module.

Why is it important?

Currently with the aws-s3 input the S3 bucket operations are able to use the FIPS endpoints but there is a single SQS API call that doesn't utilize FIPS if the setting is configured. Also the Cloudwatch input nor the AWS Metricbeat module are able to use FIPS currently. Reference https://discuss.elastic.co/t/sqs-client-ignores-the-fips-flag-for-the-service-endpoint/288687

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 9, 2021
@mergify
Copy link
Contributor

mergify bot commented Nov 9, 2021

This pull request does not have a backport label. Could you fix it @legoguy1000? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Nov 9, 2021
@legoguy1000
Copy link
Contributor Author

@kaiyan-sheng THoughts? Changes from the Discuss post above.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 9, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-12-14T02:25:27.098+0000

  • Duration: 142 min 24 sec

  • Commit: 79e29a7

Test stats 🧪

Test Results
Failed 0
Passed 28307
Skipped 3038
Total 31345

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@kaiyan-sheng
Copy link
Contributor

@legoguy1000 +1 on moving this config to aws common! Thanks for working on it!

@mtojek mtojek added the Team:Platforms Label for the Integrations - Platforms team label Nov 10, 2021
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Nov 10, 2021
@legoguy1000
Copy link
Contributor Author

I think I just need to update the docs and default config files and then should be ready for review.

@legoguy1000
Copy link
Contributor Author

I did find 1 thing that may be problematic. If you look at https://aws.amazon.com/compliance/fips/, all the US East/West regions support the -fips endpoints but for the US GovCloud regions, some add the -fips and some don't. The SQS FIPS endpoint for GovCloud is sqs.us-gov-..... but the S3 is s3-fips.us-gov-.... so the current logic would break because sqs-fips.us-gov..... endpoint doesn't exist. I can add logic to check for that if we think that makes sense?

@legoguy1000 legoguy1000 marked this pull request as ready for review November 12, 2021 15:41
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Platforms)

@legoguy1000
Copy link
Contributor Author

@kaiyan-sheng I think its ready for review. I added a new TLS config to the AWS common module so if there is a need to change the trusted root certs, set insecure, ..... (mainly for self hosted/3rd party services). Also can be used for testing with something like https://localstack.cloud/.

@mergify
Copy link
Contributor

mergify bot commented Nov 15, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b aws-fips upstream/aws-fips
git merge upstream/master
git push upstream aws-fips

@mergify
Copy link
Contributor

mergify bot commented Nov 18, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b aws-fips upstream/aws-fips
git merge upstream/master
git push upstream aws-fips

@kaiyan-sheng
Copy link
Contributor

@legoguy1000 Sorry I just came back from vacation. Will review this today!!

@kaiyan-sheng
Copy link
Contributor

/test

@kaiyan-sheng
Copy link
Contributor

Overall it looks good to me besides make update needs to be ran everywhere seems like 😬 @leehinman Could you also take a look at this PR please?

@legoguy1000
Copy link
Contributor Author

@kaiyan-sheng I think i ran all the make updates that I needed too.

Copy link
Contributor

@leehinman leehinman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

One minor comment below. I'm ok with merging if the comment doesn't resonate with you.

func CreateServiceName(serviceName string, fipsEnabled bool, region string) string {
if fipsEnabled {
OptionalGovCloudFIPS := []string{"s3"}
_, found := Find(OptionalGovCloudFIPS, serviceName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit. If you switch to a Map, you can get rid of the Find function. Also might be nice to have the OptionalGovCloudFIPS var be package level with a godoc comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change it to a map.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as for where to put the variable, i'm not a GoLang expert to know what is best but I can't see the variable being used outside of this function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the map

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasoning behind moving variable to top level is for doc comments That way the comment shows up in the godoc output. Again not a big deal, and I'm ok with merging without moving.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think i moved it correctly. Please let me know otherwise.

@mergify
Copy link
Contributor

mergify bot commented Dec 1, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b aws-fips upstream/aws-fips
git merge upstream/master
git push upstream aws-fips

@mergify
Copy link
Contributor

mergify bot commented Dec 6, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b aws-fips upstream/aws-fips
git merge upstream/master
git push upstream aws-fips

@kaiyan-sheng
Copy link
Contributor

/test

@kaiyan-sheng kaiyan-sheng added the backport-v8.1.0 Automated backport with mergify label Dec 6, 2021
@mergify mergify bot removed the backport-skip Skip notification from the automated backport with mergify label Dec 6, 2021
@legoguy1000
Copy link
Contributor Author

@kaiyan-sheng @leehinman Anything more I need to do for this PR?

@kaiyan-sheng
Copy link
Contributor

/test

@kaiyan-sheng
Copy link
Contributor

@legoguy1000 Sorry I fixed the merge conflict and then realized lint is not happy 😂 Could you take a look when you get a chance please? TIA!!

@legoguy1000
Copy link
Contributor Author

@legoguy1000 Sorry I fixed the merge conflict and then realized lint is not happy 😂 Could you take a look when you get a chance please? TIA!!

Are you able to tell what's causing the linter to fail?

@legoguy1000
Copy link
Contributor Author

@legoguy1000 Sorry I fixed the merge conflict and then realized lint is not happy 😂 Could you take a look when you get a chance please? TIA!!

Are you able to tell what's causing the linter to fail?

nevermind, I think I found it.

@kaiyan-sheng kaiyan-sheng added backport-v8.0.0 Automated backport with mergify and removed backport-v8.1.0 Automated backport with mergify labels Dec 7, 2021
@legoguy1000
Copy link
Contributor Author

@kaiyan-sheng Looks like AWS tests had issues due to the us-east-1 region issues today. May need to rerun the tests.

@kaiyan-sheng
Copy link
Contributor

/test

@mergify
Copy link
Contributor

mergify bot commented Dec 9, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b aws-fips upstream/aws-fips
git merge upstream/master
git push upstream aws-fips

1 similar comment
@mergify
Copy link
Contributor

mergify bot commented Dec 13, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b aws-fips upstream/aws-fips
git merge upstream/master
git push upstream aws-fips

@kaiyan-sheng kaiyan-sheng self-assigned this Dec 14, 2021
@kaiyan-sheng kaiyan-sheng merged commit 377f97b into elastic:master Dec 14, 2021
mergify bot pushed a commit that referenced this pull request Dec 14, 2021
@legoguy1000 legoguy1000 deleted the aws-fips branch December 14, 2021 12:22
kaiyan-sheng added a commit that referenced this pull request Dec 15, 2021
)

(cherry picked from commit 377f97b)

Co-authored-by: Alex Resnick <[email protected]>
Co-authored-by: kaiyan-sheng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.0.0 Automated backport with mergify Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants