Giter Club home page Giter Club logo

Comments (6)

harkirat22 avatar harkirat22 commented on May 17, 2024

@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.

cesar-rodriguez avatar cesar-rodriguez commented on May 17, 2024

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.

harkirat22 avatar harkirat22 commented on May 17, 2024

@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.

harkirat22 avatar harkirat22 commented on May 17, 2024

@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.

cesar-rodriguez avatar cesar-rodriguez commented on May 17, 2024

Looks good @harkirat22! No need to include rc for this. Thanks!

from terrascan.

kanchwala-yusuf avatar kanchwala-yusuf commented on May 17, 2024

@harkirat22 , Can we close this issue? Is there any action pending on this one?

from terrascan.

Related Issues (20)

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.