Skip to content

Commit

Permalink
Add description for S6437 for Go
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-teuchert-sonarsource committed Jan 31, 2025
1 parent 9559082 commit ed4c660
Showing 1 changed file with 51 additions and 19 deletions.
70 changes: 51 additions & 19 deletions rules/S6437/go/rule.adoc
Original file line number Diff line number Diff line change
@@ -1,44 +1,76 @@
FIXME: add a description

// If you want to factorize the description uncomment the following line and create the file.
//include::../description.adoc[]
include::../../../shared_content/secrets/description.adoc[]

== Why is this an issue?

FIXME: remove the unused optional headers (that are commented out)
include::../../../shared_content/secrets/rationale.adoc[]

=== What is the potential impact?

include::../common/impact/rationale.adoc[]

include::../../../shared_content/secrets/impact/financial_loss.adoc[]

//=== What is the potential impact?
include::../../../shared_content/secrets/impact/security_downgrade.adoc[]

== How to fix it
//== How to fix it in FRAMEWORK NAME

include::../../../shared_content/secrets/fix/revoke.adoc[]

include::../../../shared_content/secrets/fix/recent_use.adoc[]

include::../../../shared_content/secrets/fix/vault.adoc[]

=== Code examples

include::../common/fix/code-rationale.adoc[]

==== Noncompliant code example

[source,go,diff-id=1,diff-type=noncompliant]
----
FIXME
import (
"net/url"
)
func main() {
url.UserPassword("user", "password") // Noncompliant
}
----

==== Compliant solution

[source,go,diff-id=1,diff-type=compliant]
----
FIXME
import (
"net/url"
"os"
)
func main() {
url.UserPassword(os.Getenv("USER"), os.Getenv("PASSWORD"))
}
----

//=== How does this work?
include::../common/fix/how-it-works.adoc[]

== Resources

include::../common/resources/documentation.adoc[]

include::../common/resources/standards.adoc[]

ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)

=== Message

//=== Pitfalls
Revoke and change this password, as it is compromised.

//=== Going the extra mile
=== Highlighting

Highlight the credential use and its initialization.

//== Resources
//=== Documentation
//=== Articles & blog posts
//=== Conference presentations
//=== Standards
//=== External coding guidelines
//=== Benchmarks
'''
endif::env-github,rspecator-view[]

0 comments on commit ed4c660

Please sign in to comment.