Security and Resiliency Analytics for Smart Grids: Static and Dynamic Approaches