The only time the rule has been waived for Secretary of Defense was for Marshall during the Korean War. The reason for the rule is a good one and we aren't in anything comparable to Korea. The rule should not be waived for anyone. It's already been weakened from 10 years to 7. Even if it were weakened further to 5 years, Mad Dog still wouldn't be eligible.
Trump knows this, so do you think McConnell and other pubs assured him this would sail through? If not it's a stupid nomination, although I'm in favor of Mattis himself.