henrydenhengst

NetScaler 10.5 VPX

Jun 17th, 2015
1,487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.09 KB | None | 0 0
  1. # THIS SCRIPT IS NOT READY !!!
  2. #
  3. # change the hostname
  4. set ns hostname
  5. # local accounts
  6. show system user
  7. add system user henry Password1
  8. bind system user henry superuser 1
  9. show system user > local-accounts.txt
  10. # DNS server
  11. add dns nameServer 192.168.0.4
  12. add dns suffix example.local
  13. sh dns nameServer > nameserver.txt
  14. sh dns suffix >> nameserver.txt
  15. # NTP server
  16. add ntp server 192.168.0.8
  17. enable ntp sync
  18. show ntp server > ntp-server.txt
  19. show ntp status >> ntp-server.txt
  20. # Linking to the Active Directory
  21. add system group "Domain Admins"
  22. bind system group "Domain Admins" -policyName superuser 1
  23. add authentication ldapAction auth_ad -serverIP 192.168.0.4
  24. -ldapBase "DC=example,DC=local"
  25. -ldapBindDn administrator@example.local
  26. -ldapBindDnPassword Password1 -ldaploginName samAccountName
  27. -groupAttrName memberOf -subAttributeName CN
  28. add authentication ldapPolicy auth_policy ns_true auth_ad
  29. bind system global auth_policy -priority 100
  30. # Timeouts
  31. set system group "Domain Admins" -timeOut 0
  32. show system group "Domain Admins" > timeouts.txt
  33. # add an SNIP or an MIP address to NetScaler
  34. add ns ip 192.168.0.203 255.255.255.0 -type MIP
  35. sh ns ip
  36. save ns config
  37. # create a VLAN
  38. add vlan 20 –aliasName "Network 1"
  39. # next, we need to bind it to an interface.
  40. bind vlan 2 -ifnum 1/8
  41. # show license
  42. show license > license.txt
  43. # Deploying ICA Proxy, enable the NetScaler Gateway feature
  44. enable ns feature SSLVPN
  45. # Load Balancing
  46. enable feature LB
  47. show feature | grep LB > loadbalancing.txt
  48. add server www1 192.168.0.72
  49. add server www2 192.168.0.73
  50. show server >> loadbalancing.txt
  51. add service w1-web www1 HTTP 80
  52. add service w2-web www2 HTTP 80
  53. show service >> loadbalancing.txt
  54. add lb vserver lbvswww HTTP 192.168.0.204 80 -lbmethod ROUNDROBIN
  55. show vserver lbvswww >> loadbalancing.txt
  56. # Netscaler security (SSL Labs)
  57. # https://blog.cjharms.info/2014/05/enable-forward-secrecy-and-secure.html (Forward Secrecy)
  58. #
  59. # Create a DH Key under Traffic Management => SSL => “Create Diffie-Hellman (DH) Key)”.
  60. # Filename:              dhkey-2048.key
  61. # DH Parameters (Bits):  2048
  62. # DH Generator:          2
  63. #
  64. # Go to NetScaler Gateway Virtual Server => SSL Parameters.
  65. # Enable DH Param:       check
  66. # Refesh Count:          1000
  67. # File Path*:            /nsconfig/ssl/dhkey-2048.key
  68. #
  69. # Scoring an A+ at SSLlabs.com with Citrix NetScaler (the sequel)
  70. # http://blogs.citrix.com/2015/05/22/scoring-an-a-at-ssllabs-com-with-citrix-netscaler-the-sequel/
  71. #
  72. # Disable SSLv3 still needs to be scripted
  73. # Disable TLS 1.0 still needs to be scripted
  74. # Disable TLS 1.1 still needs to be scripted
  75. #
  76. # Create a custom Cipher list (VPX)
  77. #
  78. add ssl cipher custom-cipher-list
  79. bind ssl cipher custom-cipher-list -cipherName TLS1.2-ECDHE-RSA-AES-128-SHA256
  80. bind ssl cipher custom-cipher-list -cipherName TLS1-ECDHE-RSA-AES256-SHA
  81. bind ssl cipher custom-cipher-list -cipherName TLS1-ECDHE-RSA-AES128-SHA
  82. bind ssl cipher custom-cipher-list -cipherName TLS1-DHE-RSA-AES-256-CBC-SHA
  83. bind ssl cipher custom-cipher-list -cipherName TLS1-DHE-RSA-AES-128-CBC-SHA
  84. bind ssl cipher custom-cipher-list -cipherName TLS1-AES-256-CBC-SHA
  85. bind ssl cipher custom-cipher-list -cipherName TLS1-AES-128-CBC-SHA
  86. bind ssl cipher custom-cipher-list -cipherName SSL3-DES-CBC3-SHA
  87. #
  88. #
  89. # Strict Transport Security (STS or HSTS) with Citrix NetScaler and Access Gateway Enterprise
  90. # http://blogs.citrix.com/2010/09/10/strict-transport-security-sts-or-hsts-with-citrix-netscaler-and-access-gateway-enterprise/
  91. #
  92. add rewrite action insert_STS_header insert_http_header Strict-Transport-Security "\"max-age=157680000\""
  93. add rewrite policy enforce_STS "true" insert_STS_header
  94. # someserver.example.local needs to be modified
  95. bind lb vserver someserver.example.local -policyName enforce_STS -priority 100 -gotoPriorityExpression END -type RESPONSE
  96. #
  97. # Configure SSL Secure Renegotiations to FRONTEND_CLIENT.
  98. set ssl parameter –denySSLreneg FRONTEND_CLIENT
  99. #
  100. # Enable HA
  101. # Create the HA Pair
  102. add ha node 1 192.168.0.205
  103. add ha node 1 192.168.0.202
  104. #
  105. # change the default password
  106. set system user nsroot password
  107. # save config
  108. save ns config
Advertisement
Add Comment
Please, Sign In to add comment