@@ -55,11 +55,11 @@ public class ClearTextProtocolsCheckPart extends AbstractCdkResourceCheck {
55
55
* Constant wrapper of sensitive protocols and ports of AWS::ElasticLoadBalancing
56
56
*/
57
57
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 (
59
59
prefix ("LoadBalancingProtocol.TCP" ),
60
60
prefix ("LoadBalancingProtocol.HTTP" )
61
61
);
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" );
63
63
64
64
static String prefix (String lbName ) {
65
65
return "aws_cdk.aws_elasticloadbalancing." + lbName ;
@@ -70,13 +70,13 @@ static String prefix(String lbName) {
70
70
* Constant wrapper of sensitive protocols and ports of AWS::ElasticLoadBalancingV2
71
71
*/
72
72
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 (
75
75
prefix ("Protocol.TCP" ),
76
76
prefix ("Protocol.UDP" ),
77
77
prefix ("Protocol.TCP_UDP" )
78
78
);
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" );
80
80
81
81
static String prefix (String lbName ) {
82
82
return "aws_cdk.aws_elasticloadbalancingv2." + lbName ;
@@ -85,7 +85,7 @@ static String prefix(String lbName) {
85
85
86
86
private static class Kinesis {
87
87
88
- static final String SENSITIVE_STREAM_ENCRYPTION_FQN = prefix ("StreamEncryption.UNENCRYPTED" );
88
+ private static final String SENSITIVE_STREAM_ENCRYPTION_FQN = prefix ("StreamEncryption.UNENCRYPTED" );
89
89
static String prefix (String lbName ) {
90
90
return "aws_cdk.aws_kinesis." + lbName ;
91
91
}
@@ -133,7 +133,7 @@ protected void registerFqnConsumer() {
133
133
getArgument (ctx , call , PROTOCOL ).ifPresentOrElse (
134
134
protocol -> protocol .addIssueIf (isFqn (Elbv2 .SENSITIVE_HTTP_PROTOCOL_FQN ), LB_MESSAGE ),
135
135
() -> getArgument (ctx , call , "port" ).ifPresent (
136
- port -> port .addIssueIf (isHttpProtocolPort (), LB_MESSAGE , call ))));
136
+ port -> port .addIssueIf (isSensitiveHttpProtocolPort (), LB_MESSAGE ))));
137
137
138
138
139
139
// 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<
246
246
/**
247
247
* @return Predicate which tests if expression is an integer and is in sensitive port list
248
248
*/
249
- private static Predicate <Expression > isHttpProtocolPort () {
249
+ private static Predicate <Expression > isSensitiveHttpProtocolPort () {
250
250
return expression -> CdkUtils .getInt (expression ).filter (HTTP_PROTOCOL_PORTS ::contains ).isPresent ();
251
251
}
252
252
0 commit comments