This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Please diff with https://raw.githubusercontent.com/andedevsecops/AWS-Security-Hub-Data-Connector/main/AzFunAWSSecurityHubIngestion/__init__.py | |
| # To see what's changed | |
| # import requests | |
| import datetime | |
| import dateutil | |
| import logging | |
| import boto3 | |
| # import gzip | |
| import io |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # Implementing this with dummy data: https://aws.amazon.com/blogs/database/multi-tenant-data-isolation-with-postgresql-row-level-security/ | |
| from faker import Faker | |
| from faker.providers import person, company | |
| import random | |
| fake = Faker() | |
| fake.add_provider(person) | |
| fake.add_provider(company) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"). You | |
| # may not use this file except in compliance with the License. A copy of | |
| # the License is located at | |
| # | |
| # http://aws.amazon.com/apache2.0/ | |
| # | |
| # or in the "license" file accompanying this file. This file is | |
| # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use futures::{stream, Stream, TryStreamExt}; | |
| use rusoto_core::RusotoError; | |
| use rusoto_core::credential::ChainProvider; | |
| use rusoto_core::request::HttpClient; | |
| use rusoto_core::Region; | |
| use rusoto_s3::{ListObjectsV2Error, ListObjectsV2Request, Object, S3, S3Client}; | |
| use std::{pin::Pin}; | |
| //Lifted from here | |
| //https://github.com/softprops/dynomite/blob/master/dynomite/src/ext.rs | |
| // S3Stream provides streaming APIs for S3 client operations. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: "2010-09-09" | |
| Description: | | |
| Publishes findings from a detector in one region to an S3 bucket | |
| Parameters: | |
| DestinationArn: | |
| Type: String | |
| Description: ARN of the S3 bucket that you want GuardDuty to push findings to, GuardDuty must have permissions to write to this bucket | |
| KmsKeyArn: | |
| Type: String | |
| Description: The key that GuardDuty should use to encrypt findings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "ParameterKey": "RawDBName", | |
| "ParameterValue": "raw_db_vpc_flow_logs" | |
| }, | |
| { | |
| "ParameterKey": "RawTableName", | |
| "ParameterValue": "raw_table_vpc_flow_logs" | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: "2010-09-09" | |
| Description: "Create a glue job to process S3 Data events" | |
| Parameters: | |
| LogBucket: | |
| Type: String | |
| GlueAssetsBucket: | |
| Type: String | |
| RawDBName: | |
| Type: String | |
| RawTableName: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| STACK_NAME=MyStack | |
| TEMPLATE_FILE=template.yaml | |
| CAPABILITIES=CAPABILITY_NAMED_IAM | |
| validate: | |
| aws cloudformation validate-template --template-body file://$(TEMPLATE_FILE) | |
| create-stack: validate | |
| aws cloudformation deploy --template-file $(TEMPLATE_FILE) --stack-name $(STACK_NAME) --capabilities $(CAPABILITIES) --parameter-overrides ProjectId=$(STACK_NAME) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| rm policies.js | |
| rm service_actions.txt | |
| curl -s https://awsiamconsole.s3.amazonaws.com/iam/assets/js/bundles/policies.js -O && node -e "app={}; EnvInfo ={}; _ = {has: function() {return false;}, extend: function(){},};require('./policies.js'); console.log(JSON.stringify(app));" | jq .PolicyEditorConfig.serviceMap > service_actions.txt | |
| python iam_actions.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - '*' | |
| jobs: |