Comments (6)
@cesar-rodriguez is there any guide on how to contribute to terrascan policies?. I wrote an OPA for the above misconfiguration. However, if there is any guide to contribute, I would love to know.
from terrascan.
Hi @harkirat22. We still need to add better documentation on how to contribute policies, but a good place to get started is this comment from @williepaul : #326 (comment)
Here's also a policy only PR that was recently merge you could use as a reference: #350
Feel free to comment here if you get stuck or have any questions. Looking forward to your contribution!
from terrascan.
@cesar-rodriguez. Yup sure, I will have a look at that. I have written OPA policies and ran them on terraform plan converted to JSON format. I will write the same as per terrascan format.
from terrascan.
@cesar-rodriguez @williepaul, I wrote the policy for this issue. Please have a look, afterwards, I will create a pull request
I war trying to create the same format as most of the policies have under aws. Some have rc with base64, which I checked is having a remidiation code, do I have to include it for this policy?
package accurics
EC2withSecrets[retVal] {
pattern := ["[A-Za-z0-9/+=]{40}","(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}","("|')?(AWS|aws|Aws)??(SECRET|secret|Secret)??(ACCESS|access|Access)??(KEY|key|Key)("|')?\s*(:|=>|=)\s*("|')?[A-Za-z0-9/\+=]{40}("|')?"]
some i
instance := input.aws_instance[]
user_data := instance.config.user_data
regex.match(pattern[i],user_data)
retVal := { "Id": instance.id, "ReplaceType": "edit", "CodeType": "block", "Traverse": "", "Attribute": "", "AttributeDataType": "", "Expected": "No AWS Secrets in user data", "Actual": instance.config.user_data }
}
from terrascan.
Looks good @harkirat22! No need to include rc for this. Thanks!
from terrascan.
@harkirat22 , Can we close this issue? Is there any action pending on this one?
from terrascan.
Related Issues (20)
- Unsupported argument; An argument named "replace_triggered_by" is not expected here.
- Missing support for Terraform import blocks HOT 2
- now terrascan just hangs in a pre-commit HOT 1
- Rule ID AC_AWS_0472 broken
- Rule ID AC_AWS_0214 relies on deprecated Terraform code
- Rule ID AC_K8S_0080 broken
- False positive from Terrasan when scanning helm files ?
- Terrascan issue with aws terraform
- OpenTofu (nÊe OpenTF) support HOT 2
- `terrascan` fails when using Terraform + variable image name with Kubernetes
- Scanning Terraform modules from private git repositories
- Terrascan casually panicing when downloading GCP provider
- AC_DOCKER_0041 false positive for "FROM scratch" in Dockerfile HOT 2
- Terraform init: Unsupported block type; Blocks of type "moved" are not expected here HOT 2
- Tool throws a panic error when there is a null type in the ternary operator
- terrascan not able to get administrative privileges
- Terrascan init fails on Windows since ~Oct 19 (?) HOT 1
- unable to find possible reverse shell
- No support for precondition in lifecycle HOT 1
- False positive for Docker error AC_DOCKER_0013 - workaround is to remove quotes when call WORKDIR HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ī¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terrascan.