Coder Social home page Coder Social logo

k-paulius / pht-prowler-searchcluster Goto Github PK

View Code? Open in Web Editor NEW

This project forked from primeharbor/pht-prowler-searchcluster

0.0 0.0 0.0 251 KB

Manage Prowler findings in ElasticSearch

License: Apache License 2.0

Shell 15.38% Python 75.47% Makefile 7.70% Dockerfile 1.45%

pht-prowler-searchcluster's Introduction

prowler-searchcluster

Manage Prowler & Security Hub findings in OpenSearch

Deploying Prowler

  1. Create a config file named config.FOO with your specific settings.
export DEPLOY_BUCKET=fooli-deploy
export DEPLOY_PREFIX=prowler
export CHECKS_FILE=fooli-checks.json
export CONFIG_FILE=fooli-config.yaml
export PROWLER_MANIFEST=Fooli-Prowler-Manifest.yaml
export IMAGE_VERSION=20230805-1201

# Used by a local run
export ROLENAME=fooli-audit
export PAYER_ID=123456789012
export OUTPUT_BUCKET=fooli-prowler
  1. Create Manifest. cft-generate-manifest -m Fooli-Prowler-Manifest.yaml -t cloudformation/Prowler-Template.yaml
  2. Edit Manifest.
    1. If you're not using opensearch, you can just set the pDomainEndpoint to the value of NONE
  3. Make the ECR Repo: make env=FOO repo
  4. Push the container: make env=FOO push (you need docker running)
    1. Update the Config file to set the correct IMAGE_VERSION
  5. Deploy: make env=FOO prowler-deploy

Deploying OpenSearch

  1. Generate a cft-deploy Manifest file:
cft-generate-manifest -m Manifests/my-Opensearch-Manifest.yaml -t pht-prowler-searchcluster/cloudformation/OpenSearch-Template.yaml
  1. Edit the values in that template to match your environment.
  2. It's recommended to adjust the timeout to 45min or more.
  3. Deploy the stack with cft-deploy -m Manifests/my-Opensearch-Manifest.yaml
  4. Get the Admin Password from Secrets Manager
  5. Enable IAM Mapping. This is needed to leveage IAM roles to access the OpenSearch.
  6. ./scripts/enable_iam_roles.sh <OpenSearch-StackName> <Prowler-StackName>

Deploying OpenSearch / AWS Identity Center Integration

This process is based on this Blog Post

All Settings from AWS Identity Center are placed into a Secrets Manager secret for use by CloudFormation when deploying or updating the OpenSearch Cluster.

  1. To begin, go to AWS Identity Center, and click "Add application"
  2. Choose "I have an application I want to set up", then "SAML 2.0", then "Next"
  3. For Display Name, use choose what to call this, such as "Prowler OpenSearch". Add a description if so desired.
  4. Download the IAM Identity Center SAML metadata file to your computer
  5. Copy the IAM Identity Center SAML issuer URL
  6. Enter https://DOMAIN_ENDPOINT_URL/_dashboards/_opendistro/_security/saml/acs/idpinitiated for "Application ACS URL"
  7. You can get the value of DOMAIN_ENDPOINT_URL from the output of the OpenSearch stack. If you choose a custom endpoint, you can should use that here (such as prowler.fooli.media)
  8. Enter https://DOMAIN_ENDPOINT_URL for Application SAML audience
  9. Click "Submit"
  10. Edit the Attribute Mappings. They should look like: Attribute Mappings
  11. Create an admin Group for OpenSearch.
  12. Enter a group name, such as "prowler-opensearch-admin"
  13. Add users to the group
  14. Click Create
  15. Go back to the group you just created, and under "General Information", copy the Group ID. It should look like 046988c4-70e1-70bf-8071-ff5a9e1b82b4
  16. You should have three values saved:
  17. The Admin Group ID
  18. The IAM Identity Center SAML issuer URL
  19. The contents of the SAML metadata file.

In the AWS account with the OpenSearch cluster, create a AWS Secrets Manager Secret. Map these values:

  • SAMLEntityId -> IAM Identity Center SAML issuer URL
  • SAMLMetadataContent -> The contents of the metadata file you downloaded
  • AdminGroupId -> The ID of the group created in AWS Identity Center

The values should look like: Setting up AWS Secrets Manager

Finally, update the OpenSearch Manifest pSAMLConfigSecret with the name of the Secrets Manager secret, and re-deploy OpenSearch.

pht-prowler-searchcluster's People

Contributors

jchrisfarris avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.