diff --git a/rules/S7024/secrets/rule.adoc b/rules/S7024/secrets/rule.adoc index 6c64663d1f3..2868c7679b9 100644 --- a/rules/S7024/secrets/rule.adoc +++ b/rules/S7024/secrets/rule.adoc @@ -28,7 +28,7 @@ include::../../../shared_content/secrets/fix/vault.adoc[] === Code examples :example_secret: 891c8ed850cddbece40760b800867f1231d43f2d2586 -:example_name: ibm-cloud.cos_hmac.secret-access-key +:example_name: ibm-cloud.cos_hmac.secret_access_key :example_env: COS_HMAC_SECRET_ACCESS_KEY include::../../../shared_content/secrets/examples.adoc[] diff --git a/rules/S7025/secrets/rule.adoc b/rules/S7025/secrets/rule.adoc index 005c8d95eb7..f2b95d9f8b2 100644 --- a/rules/S7025/secrets/rule.adoc +++ b/rules/S7025/secrets/rule.adoc @@ -28,11 +28,21 @@ include::../../../shared_content/secrets/fix/vault.adoc[] === Code examples -:example_secret: 10db3f279df241bad2a9692a6a412f80bf3cadba00ace324a1cf6f159f00d019 -:example_name: cloudant.password -:example_env: CLOUDANT_PASSWORD +==== Noncompliant code example -include::../../../shared_content/secrets/examples.adoc[] +[source,java,diff-id=1,diff-type=noncompliant,subs="attributes"] +---- +props.set("cloudant.username", "name"); +props.set("cloudant.password", "10db3f279df241bad2a9692a6a412f80bf3cadba00ace324a1cf6f159f00d019"); // Noncompliant +---- + +==== Compliant solution + +[source,java,diff-id=1,diff-type=compliant,subs="attributes"] +---- +props.set("cloudant.username", System.getenv("CLOUDANT_USERNAME")); +props.set("cloudant.password", System.getenv("CLOUDANT_PASSWORD")); +---- //=== How does this work?