@@ -55,11 +55,11 @@ public class ClearTextProtocolsCheckPart extends AbstractCdkResourceCheck {
5555 * Constant wrapper of sensitive protocols and ports of AWS::ElasticLoadBalancing
5656 */
5757 private static class Elb {
58- static final Set <String > SENSITIVE_TRANSPORT_PROTOCOL_FQNS = Set .of (
58+ private static final Set <String > SENSITIVE_TRANSPORT_PROTOCOL_FQNS = Set .of (
5959 prefix ("LoadBalancingProtocol.TCP" ),
6060 prefix ("LoadBalancingProtocol.HTTP" )
6161 );
62- static final Set <String > SENSITIVE_TRANSPORT_PROTOCOLS = Set .of ("http" , "tcp" );
62+ private static final Set <String > SENSITIVE_TRANSPORT_PROTOCOLS = Set .of ("http" , "tcp" );
6363
6464 static String prefix (String lbName ) {
6565 return "aws_cdk.aws_elasticloadbalancing." + lbName ;
@@ -70,13 +70,13 @@ static String prefix(String lbName) {
7070 * Constant wrapper of sensitive protocols and ports of AWS::ElasticLoadBalancingV2
7171 */
7272 private static class Elbv2 {
73- static final String SENSITIVE_HTTP_PROTOCOL_FQN = prefix ("ApplicationProtocol.HTTP" );
74- static final Set <String > SENSITIVE_TRANSPORT_PROTOCOL_FQNS = Set .of (
73+ private static final String SENSITIVE_HTTP_PROTOCOL_FQN = prefix ("ApplicationProtocol.HTTP" );
74+ private static final Set <String > SENSITIVE_TRANSPORT_PROTOCOL_FQNS = Set .of (
7575 prefix ("Protocol.TCP" ),
7676 prefix ("Protocol.UDP" ),
7777 prefix ("Protocol.TCP_UDP" )
7878 );
79- static final Set <String > SENSITIVE_TRANSPORT_PROTOCOLS = Set .of ("HTTP" , "TCP" , "UDP" , "TCP_UDP" );
79+ private static final Set <String > SENSITIVE_TRANSPORT_PROTOCOLS = Set .of ("HTTP" , "TCP" , "UDP" , "TCP_UDP" );
8080
8181 static String prefix (String lbName ) {
8282 return "aws_cdk.aws_elasticloadbalancingv2." + lbName ;
@@ -85,7 +85,7 @@ static String prefix(String lbName) {
8585
8686 private static class Kinesis {
8787
88- static final String SENSITIVE_STREAM_ENCRYPTION_FQN = prefix ("StreamEncryption.UNENCRYPTED" );
88+ private static final String SENSITIVE_STREAM_ENCRYPTION_FQN = prefix ("StreamEncryption.UNENCRYPTED" );
8989 static String prefix (String lbName ) {
9090 return "aws_cdk.aws_kinesis." + lbName ;
9191 }
@@ -133,7 +133,7 @@ protected void registerFqnConsumer() {
133133 getArgument (ctx , call , PROTOCOL ).ifPresentOrElse (
134134 protocol -> protocol .addIssueIf (isFqn (Elbv2 .SENSITIVE_HTTP_PROTOCOL_FQN ), LB_MESSAGE ),
135135 () -> getArgument (ctx , call , "port" ).ifPresent (
136- port -> port .addIssueIf (isHttpProtocolPort (), LB_MESSAGE , call ))));
136+ port -> port .addIssueIf (isSensitiveHttpProtocolPort (), LB_MESSAGE ))));
137137
138138
139139 // Raise an issue if a `NetworkListener` is instantiated or `add_listener` is called on an `NetworkLoadBalancer` object
@@ -246,7 +246,7 @@ private static Predicate<Expression> isSensitiveTransportProtocolFqn(Collection<
246246 /**
247247 * @return Predicate which tests if expression is an integer and is in sensitive port list
248248 */
249- private static Predicate <Expression > isHttpProtocolPort () {
249+ private static Predicate <Expression > isSensitiveHttpProtocolPort () {
250250 return expression -> CdkUtils .getInt (expression ).filter (HTTP_PROTOCOL_PORTS ::contains ).isPresent ();
251251 }
252252
0 commit comments