Skip to content
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

accurics.gcp.NS.112 suggest basic auth is enabled when is not #394

Closed
lucas-giaco opened this issue Nov 19, 2020 · 2 comments · Fixed by #396
Closed

accurics.gcp.NS.112 suggest basic auth is enabled when is not #394

lucas-giaco opened this issue Nov 19, 2020 · 2 comments · Fixed by #396

Comments

@lucas-giaco
Copy link
Contributor

  • terrascan version: v0.1.10
  • Operating System: MacOS 10.15.7

Description

As per Hardening your cluster doc, we should disable basic-auth.
As per Terraform docs the way to accomplish so is by providing an empty username and password.
However, terrascan is suggesting that I have basic-auth enabled which I'm not.
Please note that not specifying these fields at all won't enable basic-auth and doesn't fire the rule.

What I Did

cat <<EOF > cluster.tf
resource "google_container_cluster" "cluster" {
  master_auth {
    username = ""
    password = ""
  }
}
EOF
terrascan scan -t gcp -f cluster.tf
results:
  violations:
  - rule_name: gkeBasicAuthDisabled
    description: Ensure GKE basic auth is disabled.
    rule_id: accurics.gcp.IAM.110
    severity: HIGH
    category: Identity & Access Management
    resource_name: cluster
    resource_type: google_container_cluster
    file: cluster.tf
    line: 1
  count:
    low: 0
    medium: 0
    high: 1
    total: 1

What I Expect

cat <<EOF > cluster.tf
resource "google_container_cluster" "cluster" {
  master_auth {
    username = ""
    password = ""
  }
}
EOF
terrascan scan -t gcp -f cluster.tf
results:
  violations: []
  count:
    low: 0
    medium: 0
    high: 0
    total: 0
acc-jon pushed a commit to acc-jon/terrascan that referenced this issue Nov 20, 2020
cesar-rodriguez pushed a commit that referenced this issue Nov 20, 2020
#394: recognize that empty values for username and password in master…
@acc-jon
Copy link
Contributor

acc-jon commented Nov 20, 2020

Thanks for catching this and providing a reproducer, @lucas-giaco!

@lucas-giaco
Copy link
Contributor Author

Thanks to you for the quick fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants