rspec/rules/S6418/go/rule.adoc

52 lines
777 B
Plaintext
Raw Normal View History

:detections: variables/fields
:defaultsensibility: 3
include::../description.adoc[]
include::../ask-yourself.adoc[]
include::../recommended.adoc[]
== Sensitive Code Example
[source,go]
----
var secret = "47828a8dd77ee1eb9dde2d5e93cb221ce8c32b37" // Sensitive
func main() {
callMyService(secret)
}
----
== Compliant Solution
[source,go]
----
import "os"
var secret = os.Getenv("SECRET")
func main() {
callMyService(secret)
}
----
include::../see.adoc[]
* MSC - https://wiki.sei.cmu.edu/confluence/x/OjdGBQ[MSC03-J - Never hard code sensitive information]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../parameters.adoc[]
'''
endif::env-github,rspecator-view[]