Story highlights Kelly said states will be offered help on a "voluntary basis"

Midterms are less than two years away, Kelly pointed out

Washington (CNN) Attempts to hack elections will continue in the future, the secretary of Homeland Security said Wednesday -- so election officials better prepare.

Secretary John Kelly was speaking about the difficult balance his agency must strike -- on the one hand protecting the nation from cyber intruders while on the other, respecting state and local governments' autonomy.

Kelly said at an event at the Center for a New American Security that his agency will offer to help states and localities on an entirely "voluntary basis" -- but strongly encouraged officials to get help from somewhere.

"I would say that if they don't want our help, and even if they do want our help, they'd be well advised to hire some very, very, very good hired cyber guns, if you will, to help protect, because this is the way of the future," Kelly said.

He added the threat is imminent.

Read More