Jaker,
I assume your ArubaStacks are using dynamic provisioning as opposed to pre-provisioned? With dynamic, the only way to "lock" a stack down would be to effectively max out all the member IDs. That obviously isn't very practical.
With pre-provisioned, you actually lock the switches based on serial numbers as such, if a switch attaches and it isn't in the stack-profile, it will be stuck in a dormant state and not allowed to join. Here is an example of how you would configure it from dynamic to pre-provisioned.
(ArubaStack) #show stacking members
Stack status: Active, Stack Id: 001a1e17b98050f9e894
Stack uptime: 17 days 2 hours 21 minutes 22 seconds
Id Role MAC Address Priority State Model Serial
-- ---- ----------- -------- ----- ----- ------
0 Secondary 00:1a:1e:17:b9:80 255 Active ArubaS3500-24F BW0000044
1 * Primary 00:0b:86:6c:25:00 255 Active ArubaS3500-48P AW0000549
2 Linecard 00:0b:86:6b:7b:c0 128 Active ArubaS3500-48P AW0000446
(ArubaStack) #show stacking generated-preset-profile
Preset-config Profile Command
-----------------------------
stack-profile
member-id 0 serial-number BW0000044 role primary-capable
member-id 1 serial-number AW0000549 role primary-capable
member-id 2 serial-number AW0000446 role line-card
(ArubaStack) #configure t
Enter Configuration commands, one per line. End with CNTL/Z
(ArubaStack) (config) #stack-profile
(ArubaStack) (stack-profile) #no member-id 0 election-priority 255
WARNING!! This profile will not be applied till the configuration is saved.
(ArubaStack) (stack-profile) #no member-id 1 election-priority 255
WARNING!! This profile will not be applied till the configuration is saved.
(ArubaStack) (stack-profile) #member-id 0 serial-number BW0000044 role primary-capable
WARNING!! This profile will not be applied till the configuration is saved.
(ArubaStack) (stack-profile) #member-id 1 serial-number AW0000549 role primary-capable
WARNING!! This profile will not be applied till the configuration is saved.
(ArubaStack) (stack-profile) #member-id 2 serial-number AW0000446 role line-card
WARNING!! This profile will not be applied till the configuration is saved.
(ArubaStack) (stack-profile) #exit
(ArubaStack) (config) #exit
(ArubaStack) #write mem
Saving Configuration......
Configuration Saved.
(ArubaStack) #show stacking members
Stack status: Active, Stack Id: 001a1e17b98050f9e894
Stack uptime: 17 days 2 hours 25 minutes 52 seconds
Id Role MAC Address Priority State Model Serial
-- ---- ----------- -------- ----- ----- ------
0 Secondary 00:1a:1e:17:b9:80 Preset Active ArubaS3500-24F BW0000044
1 * Primary 00:0b:86:6c:25:00 Preset Active ArubaS3500-48P AW0000549
2 Linecard 00:0b:86:6b:7b:c0 Preset Active ArubaS3500-48P AW0000446
Lastly, if you have any standalone switches or stacks that don't have a redundant loop or braid (which I don't recommend), you can also disable the stacking ports.
Best regards,
Madani