Skip to content

Commit fefa7f0

Browse files
micheelengronnechris-rock
authored andcommitted
use input instead of attribute
In the last versions of Inspec and cinc-auditor, attribute is deprecated and input should be used. https://docs.chef.io/workstation/cookstyle/inspec_deprecations_attributehelper/ Signed-off-by: Michée Lengronne <michee.lengronne@coppint.com>
1 parent 4987d50 commit fefa7f0

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

controls/nginx_spec.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,67 +22,67 @@
2222
title 'NGINX server config'
2323

2424
# attributes
25-
CLIENT_MAX_BODY_SIZE = attribute(
25+
CLIENT_MAX_BODY_SIZE = input(
2626
'client_max_body_size',
2727
description: 'Sets the maximum allowed size of the client request body, specified in the “Content-Length” request header field. If the size in a request exceeds the configured value, the 413 (Request Entity Too Large) error is returned to the client. Please be aware that browsers cannot correctly display this error. Setting size to 0 disables checking of client request body size.',
2828
value: '1k'
2929
)
3030

31-
CLIENT_BODY_BUFFER_SIZE = attribute(
31+
CLIENT_BODY_BUFFER_SIZE = input(
3232
'client_body_buffer_size',
3333
description: 'Sets buffer size for reading client request body. In case the request body is larger than the buffer, the whole body or only its part is written to a temporary file. By default, buffer size is equal to two memory pages. This is 8K on x86, other 32-bit platforms, and x86-64. It is usually 16K on other 64-bit platforms.',
3434
value: '1k'
3535
)
3636

37-
CLIENT_HEADER_BUFFER_SIZE = attribute(
37+
CLIENT_HEADER_BUFFER_SIZE = input(
3838
'client_header_buffer_size',
3939
description: 'Sets buffer size for reading client request header. For most requests, a buffer of 1K bytes is enough. However, if a request includes long cookies, or comes from a WAP client, it may not fit into 1K. If a request line or a request header field does not fit into this buffer then larger buffers, configured by the large_client_header_buffers directive, are allocated.',
4040
value: '1k'
4141
)
4242

43-
LARGE_CLIENT_HEADER_BUFFER = attribute(
43+
LARGE_CLIENT_HEADER_BUFFER = input(
4444
'large_client_header_buffers',
4545
description: 'Sets the maximum number and size of buffers used for reading large client request header. A request line cannot exceed the size of one buffer, or the 414 (Request-URI Too Large) error is returned to the client. A request header field cannot exceed the size of one buffer as well, or the 400 (Bad Request) error is returned to the client. Buffers are allocated only on demand. By default, the buffer size is equal to 8K bytes. If after the end of request processing a connection is transitioned into the keep-alive state, these buffers are released.',
4646
value: '2 1k'
4747
)
4848

49-
KEEPALIVE_TIMEOUT = attribute(
49+
KEEPALIVE_TIMEOUT = input(
5050
'keepalive_timeout',
5151
description: 'The first parameter sets a timeout during which a keep-alive client connection will stay open on the server side. The zero value disables keep-alive client connections. The optional second parameter sets a value in the “Keep-Alive: timeout=time” response header field. Two parameters may differ.',
5252
value: '5 5'
5353
)
5454

55-
CLIENT_BODY_TIMEOUT = attribute(
55+
CLIENT_BODY_TIMEOUT = input(
5656
'client_body_timeout',
5757
description: 'Defines a timeout for reading client request body. The timeout is set only for a period between two successive read operations, not for the transmission of the whole request body. If a client does not transmit anything within this time, the 408 (Request Time-out) error is returned to the client.',
5858
value: '10'
5959
)
6060

61-
CLIENT_HEADER_TIMEOUT = attribute(
61+
CLIENT_HEADER_TIMEOUT = input(
6262
'client_header_timeout',
6363
description: 'Defines a timeout for reading client request header. If a client does not transmit the entire header within this time, the 408 (Request Time-out) error is returned to the client.',
6464
value: '10'
6565
)
6666

67-
SEND_TIMEOUT = attribute(
67+
SEND_TIMEOUT = input(
6868
'send_timeout',
6969
description: 'Sets a timeout for transmitting a response to the client. The timeout is set only between two successive write operations, not for the transmission of the whole response. If the client does not receive anything within this time, the connection is closed.',
7070
value: '10'
7171
)
7272

73-
HTTP_METHODS = attribute(
73+
HTTP_METHODS = input(
7474
'http_methods',
7575
description: 'Specify the used HTTP methods',
7676
value: 'GET\|HEAD\|POST'
7777
)
7878

79-
HTTP_METHODS_CHECK = attribute(
79+
HTTP_METHODS_CHECK = input(
8080
'http_methods_check',
8181
description: 'Defines if http_methods should be checked in the nginx configuration',
8282
value: false
8383
)
8484

85-
NGINX_COOKIE_FLAG_MODULE = attribute(
85+
NGINX_COOKIE_FLAG_MODULE = input(
8686
'nginx_cookie_flag_module',
8787
description: 'Defines if nginx has been compiled with nginx_cookie_flag_module',
8888
value: false
@@ -93,7 +93,7 @@
9393
end
9494

9595
# determine all required paths
96-
nginx_path = attribute('nginx_path', value: '/etc/nginx', description: 'Default nginx configurations path')
96+
nginx_path = input('nginx_path', value: '/etc/nginx', description: 'Default nginx configurations path')
9797
nginx_conf = File.join(nginx_path, 'nginx.conf')
9898
nginx_confd = File.join(nginx_path, 'conf.d')
9999
nginx_enabled = File.join(nginx_path, 'sites-enabled')

0 commit comments

Comments
 (0)