-
Notifications
You must be signed in to change notification settings - Fork 353
fix(query): fn for Trusted Microsoft Services Not Enabled - ARM #7587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(query): fn for Trusted Microsoft Services Not Enabled - ARM #7587
Conversation
cx-artur-ribeiro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey André,
Please take a look at my comments and I'll review again after.
If you need any help, please fell free to contact 😄
assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/query.rego
Outdated
Show resolved
Hide resolved
assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/query.rego
Outdated
Show resolved
Hide resolved
…0723--FN_Trusted_Microsoft_Services_Not_Enabled--ARM
…RM' of https://github.com/cx-andre-pereira/kics into AST-40723--FN_Trusted_Microsoft_Services_Not_Enabled--ARM
cx-artur-ribeiro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey André, besides my comment, the only other strange thing is this result:
{
"queryName": "Trusted Microsoft Services Not Enabled",
"severity": "MEDIUM",
"line": 19,
"fileName": "positive6.json"
},
Seems like we are pointing to "types" instead of the resource but I can't understand why. It seems to be related to the .json file somehow.
Other than that, everything seems good.
assets/queries/azureResourceManager/trusted_microsoft_services_not_enabled/query.rego
Outdated
Show resolved
Hide resolved
…0723--FN_Trusted_Microsoft_Services_Not_Enabled--ARM
cx-artur-ribeiro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 19562607 | Triggered | Generic Password | ffdb371 | assets/queries/common/passwords_and_secrets/test/positive53.json | View secret |
| 4266022 | Triggered | Generic Password | c9ec1e3 | assets/queries/cloudFormation/aws/amplify_branch_basic_auth_config_password_exposed/test/negative7.yaml | View secret |
| 9419039 | Triggered | Username Password | c9ec1e3 | assets/queries/cloudFormation/aws/amplify_branch_basic_auth_config_password_exposed/test/positive5.yaml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Reason for Proposed Changes
Microsoft.Storage/storageAccountsresources by assuring the fieldproperties.networkAcls.defaultActionis not set as "Allow" , and thatproperties.networkAcls.bypassdoes not contain "AzureServices" as either of those scenarios would enable "Trusted Microsoft Services".properties,properties.networkAclsorproperties.networkAcls.defaultAction/bypassfields entirely.Proposed Changes
defaultActionand/orbypassnested fields exists. Moreover the lack of a complete path will properly flag the Microsoft Services as Not Enabled and point to the "deepest" field along the path route(either"","properties"or"properties.networkAcls") on the "searchKey".Note: I could not find explicit documentation stating the effects of missing "networkAcls" or other fields, but it seems to result in unexpected behavior depending on file/system context which, i feel, still makes this flag pertinent.
I submit this contribution under the Apache-2.0 license.