https://github.com/awslabs/aws-config-rdklib
Python library to enable you to run custom AWS Config Rules at scale, using Lambda Layer.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.6%) to scientific vocabulary
Keywords from Contributors
Repository
Python library to enable you to run custom AWS Config Rules at scale, using Lambda Layer.
Basic Info
Statistics
- Stars: 98
- Watchers: 12
- Forks: 27
- Open Issues: 5
- Releases: 8
Metadata Files
README.md
RDKlib
RDKlib is a Python library to enable you to run custom AWS Config Rules at scale. The library can be used to:
- Help you to focus only on the compliance logic, while the library does the heavy lifting
- Ease maintenance by moving the boilerplate code as a AWS Lambda Layer
- Ease deployment by using AWS Serverless Application Repository
RDKLib works in synergy with the AWS Config Rule Development Kit.
Getting Started
Install the library locally
bash
pip install rdklib
Create a rule using the RDK
Note: you need to install the RDK first.
To use rdklib, specify a python3.x-lib runtime when you run rdk create (or don't specify any runtime; rdklib is now the default for rdk create). This will populate the rdklib runtime in the RDK parameters.json of your Rule template. Examples:
- For periodic trigger:
bash
rdk create YOUR_RULE_NAME --runtime python3.12-lib --maximum-frequency TwentyFour_Hours
- For configuration change trigger (for example S3 Bucket):
bash
rdk create YOUR_RULE_NAME --runtime python3.12-lib --resource-types AWS::S3::Bucket
After you've created your rule, update the .py file that was generated, adding your custom logic within the evaluate_change() method for change-triggered rules or the evaluate_periodic() method for periodic rules (you may need to uncomment evaluate_periodic(). If you need to create a boto3 client, use the client_factory helper (eg. instead of boto3.client("s3"), use client_factory.build_client("s3")). Examples of rdklib rules can be found here.
Deploy your rule with RDKlib layer
RDKlib is designed to work as a AWS Lambda Layer. It allows you to use the library without needing to include it in your deployment package.
- Install RDKlib layer (with AWS CLI)
```bash aws serverlessrepo create-cloud-formation-change-set --application-id arn:aws:serverlessrepo:ap-southeast-1:711761543063:applications/rdklib --stack-name RDKlib-Layer
# Copy/paste the full change-set ARN to customize the following command
aws cloudformation execute-change-set --change-set-name NAME_OF_THE_CHANGE_SET
aws cloudformation describe-stack-resources --stack-name serverlessrepo-RDKlib-Layer
# Copy the ARN of the Lambda layer in the "PhysicalResourceId" key (i.e. arn:aws:lambda:YOUR_REGION:YOUR_ACCOUNT:layer:rdklib-layer:1).
```
Note: You can do the same step manually going to https://console.aws.amazon.com/lambda/home#/create/function?tab=serverlessApps and find "rdklib"
- Deploy the rule
bash
rdk deploy YOUR_RULE_NAME --rdklib-layer-arn YOUR_RDKLIB_LAYER_ARN
FAQs
- Q. What is the
client_factorythat I see in myrdklibrules?- A. A
client_factoryis a class that allows for dynamic provisioning of aboto3client. In anrdklibrule, you should treatclient_factoryas the way to create aboto3client. So instead of callingclient = boto3.client("s3"), you would callclient = client_factory.build_client("s3").- Q. ...Why?
- A. It's mainly there to allow for cross-account functionality so that your client evaluates the rule in the right account.
- Q. ...Why?
- A. A
License
This project is licensed under the Apache-2.0 License.
Feedback / Questions
Feel free to email rdk-maintainers@amazon.com
Contacts
- Benjamin Morris - Maintainer, code, testing
Acknowledgements
- Mark Beacom - Maintainer, code, testing
- Michael Borchert - Design, code, testing, feedback
- Ricky Chau - Maintainer, code, testing
- Julio Delgado Jr. - Design, testing, feedback
- Chris Gutierrez - Design, feedback
- Joe Lee - Design, feedback
- Jonathan Rault - Maintainer, design, code, testing, feedback
- Carlo DePaolis - Maintainer, code, testing
Owner
- Name: Amazon Web Services - Labs
- Login: awslabs
- Kind: organization
- Location: Seattle, WA
- Website: http://amazon.com/aws/
- Repositories: 914
- Profile: https://github.com/awslabs
AWS Labs
GitHub Events
Total
- Watch event: 1
- Push event: 11
- Pull request event: 4
- Fork event: 1
- Create event: 2
Last Year
- Watch event: 1
- Push event: 11
- Pull request event: 4
- Fork event: 1
- Create event: 2
Committers
Last synced: over 3 years ago
All Time
- Total Commits: 88
- Total Committers: 12
- Avg Commits per committer: 7.333
- Development Distribution Score (DDS): 0.398
Top Committers
| Name | Commits | |
|---|---|---|
| jrault | j****t@g****m | 53 |
| rickychau2780 | c****u@a****m | 10 |
| Mark Beacom | 7****m@u****m | 5 |
| rickychau2780 | r****0@h****m | 5 |
| Prakasha Ramachandra | p****a@n****m | 4 |
| Gábor Lipták | g****k@g****m | 3 |
| Chau | c****u@3****m | 3 |
| Amazon GitHub Automation | 5****o@u****m | 1 |
| Julio Delgado Jr | d****l@a****m | 1 |
| Kyle McDonald | k****n@a****m | 1 |
| Smith | c****s@a****m | 1 |
| Andy Shinn | a****s@a****s | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 22
- Total pull requests: 62
- Average time to close issues: 12 months
- Average time to close pull requests: 18 days
- Total issue authors: 13
- Total pull request authors: 15
- Average comments per issue: 1.05
- Average comments per pull request: 0.27
- Merged pull requests: 52
- Bot issues: 0
- Bot pull requests: 13
Past Year
- Issues: 0
- Pull requests: 5
- Average time to close issues: N/A
- Average time to close pull requests: 25 minutes
- Issue authors: 0
- Pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.2
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 1
Top Authors
Issue Authors
- 0xjjoyy (8)
- bmorrissirromb (2)
- jongogogo (2)
- fitzoh (1)
- andrew-m-h (1)
- 4power (1)
- rchanter (1)
- yukihiko-shinoda (1)
- giovanni-riva (1)
- abaki007 (1)
- mbeacom (1)
- Dicondur (1)
- AlexChesters (1)
Pull Request Authors
- bmorrissirromb (25)
- dependabot[bot] (21)
- jongogogo (8)
- mbeacom (4)
- gliptak (3)
- prakashar11 (3)
- yukihiko-shinoda (2)
- RhysHoad (2)
- tekdj7 (1)
- corysaws (1)
- kaveman22 (1)
- rickychau2780 (1)
- andyshinn (1)
- AlexChesters (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 1,596 last-month
- Total dependent packages: 0
- Total dependent repositories: 4
- Total versions: 12
- Total maintainers: 2
pypi.org: rdklib
Rule Development Kit Library for AWS Config
- Homepage: https://github.com/awslabs/aws-config-rdklib
- Documentation: https://aws-config-rdklib.readthedocs.io
- License: Apache-2.0
-
Latest release: 0.3.8
published about 1 year ago
Rankings
Dependencies
- boto3 *
- botocore *
- rdk *
- boto3 *
- botocore *
- rdk *
- actions/checkout v2 composite
- actions/setup-python v1 composite