- If behavioral analysis is required, then the kernel module is required
- The inspector agent cannot be compiled for container linux because the source code is not open
- The inspector agent is dynamically linked and therefore must be run on a supported filesystem/OS
- Therefore, the inspector agent must be run inside of a container
- Once the inspector agent in the container needs to have the correct mounts and capabilites to scan the host systems
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
| # Lambda function / Python to create athena partitions for Cloudtrail log between any given days. | |
| # If you run this in AWS Lambda then it can't able to ceate all the partitions. | |
| # Because lambda can run any functions up to 5mins. But create partition query will take avg 6 secs. | |
| # I did a benchmark on lambda, it created upto 3 months of partitions on 16 regions. | |
| ''' | |
| ----------------------------------------------------------------- | |
| AWS Athena Create Partitions Automatically For Given Any TWO DAYS | |
| ----------------------------------------------------------------- | |
| Version 1.0 |
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 python | |
| import click | |
| import configparser | |
| import json | |
| import os | |
| import requests | |
| import webbrowser | |
| from boto.sts import STSConnection | |
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
| Setting up the following will enable running a notebook from CLI and create a plotly image from the generated graph: | |
| CLI: | |
| sudo jupyter nbconvert --execute notebook.ipynb | |
| Python: | |
| At top of notebook: offline.init_notebook_mode() | |
| After defining data and figure: | |
| offline.iplot(fig, filename='graph', image='png') |
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
| """An AWS SNS example.""" | |
| import logging | |
| import time | |
| import boto3 | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format='[%(asctime)s] %(levelname)s:%(name)s:%(message)s' |
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
| response = client.get_metric_data( | |
| MetricDataQueries=[ | |
| { | |
| 'Id': 'm1', | |
| 'MetricStat': { | |
| 'Metric': { | |
| 'Namespace': 'AWS/DynamoDB', | |
| 'MetricName': 'ProvisionedReadCapacityUnits', | |
| 'Dimensions': [ | |
| { |
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
| AWS PRODUCTS | |
| Amazon EC2 | |
| Amazon Elastic Container Registry | |
| Amazon Elastic Container Service | |
| AWS Lambda | |
| Amazon Virtual Private Cloud | |
| AWS Elastic Beanstalk | |
| Auto Scaling | |
| Elastic Load Balancing | |
| Amazon S3 |
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
| # -*- coding: utf-8 -*- | |
| import os, boto3, botocore | |
| S3BUCKET=os.environ.get('S3BUCKET', None) | |
| S3PREFIX=os.environ.get('S3PREFIX', 'rds/') | |
| LASTRECEIVEDFILENAME=os.environ.get('LASTRECEIVEDFILENAME', '.timestamp') | |
| def lambda_handler(event, context): | |
| log_file_data = "" |
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
| UserPool: | |
| Type: "AWS::Cognito::UserPool" | |
| Description: "A Cognito user pool for authenticating users" | |
| Properties: | |
| UserPoolName: !Sub ${APIName}-user-pool | |
| AutoVerifiedAttributes: | |
| - phone_number | |
| MfaConfiguration: "ON" | |
| SmsConfiguration: | |
| ExternalId: !Sub ${APIName}-external |
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
| --- | |
| Description: AWS AppSync Notes API | |
| Parameters: | |
| APIName: | |
| Type: String | |
| Description: Name of the API - used to generate unique names for resources | |
| MinLength: 3 | |
| MaxLength: 20 | |
| AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$' |